ultracart_api 4.1.13 → 4.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -2
- data/docs/AffiliateApi.md +123 -167
- data/docs/AutoOrderApi.md +1250 -903
- data/docs/CartUpsellAfter.md +6 -2
- data/docs/ChannelPartnerApi.md +1678 -1121
- data/docs/ChargebackApi.md +297 -405
- data/docs/CheckoutApi.md +1622 -1424
- data/docs/ConversationApi.md +4820 -6315
- data/docs/ConversationVirtualAgentCapabilities.md +4 -0
- data/docs/CouponApi.md +1522 -1443
- data/docs/CustomReport.md +36 -0
- data/docs/CustomReportAccountConfig.md +34 -0
- data/docs/CustomReportAccountConfigResponse.md +26 -0
- data/docs/CustomReportExecutionParameter.md +22 -0
- data/docs/CustomReportExecutionRequest.md +18 -0
- data/docs/CustomReportParameter.md +28 -0
- data/docs/CustomReportParameterOption.md +20 -0
- data/docs/CustomReportQuery.md +28 -0
- data/docs/CustomReportResponse.md +26 -0
- data/docs/CustomReportTooltip.md +20 -0
- data/docs/CustomerApi.md +2570 -1845
- data/docs/DatawarehouseApi.md +933 -723
- data/docs/FulfillmentApi.md +567 -441
- data/docs/GiftCertificateApi.md +617 -598
- data/docs/IntegrationLogApi.md +290 -385
- data/docs/Item.md +1 -1
- data/docs/ItemApi.md +2174 -1746
- data/docs/OauthApi.md +203 -163
- data/docs/OrderApi.md +2883 -2177
- data/docs/SsoApi.md +223 -288
- data/docs/StorefrontApi.md +9692 -12967
- data/docs/TaxApi.md +1541 -2017
- data/docs/UserApi.md +606 -790
- data/docs/WebhookApi.md +787 -628
- data/docs/WorkflowApi.md +666 -879
- data/lib/ultracart_api/api/datawarehouse_api.rb +474 -0
- data/lib/ultracart_api/api/order_api.rb +131 -0
- data/lib/ultracart_api/models/cart_upsell_after.rb +25 -5
- data/lib/ultracart_api/models/conversation_virtual_agent_capabilities.rb +55 -1
- data/lib/ultracart_api/models/custom_report.rb +306 -0
- data/lib/ultracart_api/models/custom_report_account_config.rb +296 -0
- data/lib/ultracart_api/models/custom_report_account_config_response.rb +256 -0
- data/lib/ultracart_api/models/custom_report_execution_parameter.rb +237 -0
- data/lib/ultracart_api/models/custom_report_execution_request.rb +221 -0
- data/lib/ultracart_api/models/custom_report_parameter.rb +266 -0
- data/lib/ultracart_api/models/custom_report_parameter_option.rb +228 -0
- data/lib/ultracart_api/models/custom_report_query.rb +266 -0
- data/lib/ultracart_api/models/custom_report_response.rb +256 -0
- data/lib/ultracart_api/models/custom_report_tooltip.rb +228 -0
- data/lib/ultracart_api/models/item.rb +1 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +10 -0
- metadata +22 -2
@@ -21,15 +21,23 @@ module UltracartClient
|
|
21
21
|
# The amount of inactivity in minutes after which the cart should be finalized into an order. This will calculate the finalize_after_dts field.
|
22
22
|
attr_accessor :finalize_after_minutes
|
23
23
|
|
24
|
-
# Upsell path code
|
24
|
+
# Upsell path code (this is for legacy upsells only)
|
25
25
|
attr_accessor :upsell_path_code
|
26
26
|
|
27
|
+
# Upsell path name to start on (StoreFront Upsells). Will only be respected on a handoff API call.
|
28
|
+
attr_accessor :upsell_path_name
|
29
|
+
|
30
|
+
# Upsell path variation to start on (StoreFront Upsells). Will only be respected on a handoff API call.
|
31
|
+
attr_accessor :upsell_path_variation
|
32
|
+
|
27
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
34
|
def self.attribute_map
|
29
35
|
{
|
30
36
|
:'finalize_after_dts' => :'finalize_after_dts',
|
31
37
|
:'finalize_after_minutes' => :'finalize_after_minutes',
|
32
|
-
:'upsell_path_code' => :'upsell_path_code'
|
38
|
+
:'upsell_path_code' => :'upsell_path_code',
|
39
|
+
:'upsell_path_name' => :'upsell_path_name',
|
40
|
+
:'upsell_path_variation' => :'upsell_path_variation'
|
33
41
|
}
|
34
42
|
end
|
35
43
|
|
@@ -43,7 +51,9 @@ module UltracartClient
|
|
43
51
|
{
|
44
52
|
:'finalize_after_dts' => :'String',
|
45
53
|
:'finalize_after_minutes' => :'Integer',
|
46
|
-
:'upsell_path_code' => :'String'
|
54
|
+
:'upsell_path_code' => :'String',
|
55
|
+
:'upsell_path_name' => :'String',
|
56
|
+
:'upsell_path_variation' => :'String'
|
47
57
|
}
|
48
58
|
end
|
49
59
|
|
@@ -79,6 +89,14 @@ module UltracartClient
|
|
79
89
|
if attributes.key?(:'upsell_path_code')
|
80
90
|
self.upsell_path_code = attributes[:'upsell_path_code']
|
81
91
|
end
|
92
|
+
|
93
|
+
if attributes.key?(:'upsell_path_name')
|
94
|
+
self.upsell_path_name = attributes[:'upsell_path_name']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'upsell_path_variation')
|
98
|
+
self.upsell_path_variation = attributes[:'upsell_path_variation']
|
99
|
+
end
|
82
100
|
end
|
83
101
|
|
84
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -116,7 +134,9 @@ module UltracartClient
|
|
116
134
|
self.class == o.class &&
|
117
135
|
finalize_after_dts == o.finalize_after_dts &&
|
118
136
|
finalize_after_minutes == o.finalize_after_minutes &&
|
119
|
-
upsell_path_code == o.upsell_path_code
|
137
|
+
upsell_path_code == o.upsell_path_code &&
|
138
|
+
upsell_path_name == o.upsell_path_name &&
|
139
|
+
upsell_path_variation == o.upsell_path_variation
|
120
140
|
end
|
121
141
|
|
122
142
|
# @see the `==` method
|
@@ -128,7 +148,7 @@ module UltracartClient
|
|
128
148
|
# Calculates hash code according to all attributes.
|
129
149
|
# @return [Integer] Hash code
|
130
150
|
def hash
|
131
|
-
[finalize_after_dts, finalize_after_minutes, upsell_path_code].hash
|
151
|
+
[finalize_after_dts, finalize_after_minutes, upsell_path_code, upsell_path_name, upsell_path_variation].hash
|
132
152
|
end
|
133
153
|
|
134
154
|
# Builds the object from hash
|
@@ -25,6 +25,12 @@ module UltracartClient
|
|
25
25
|
|
26
26
|
attr_accessor :open_support_ticket
|
27
27
|
|
28
|
+
# Channel to use to open the support ticket
|
29
|
+
attr_accessor :open_support_ticket_channel
|
30
|
+
|
31
|
+
# Email to send support ticket to
|
32
|
+
attr_accessor :open_support_ticket_channel_email
|
33
|
+
|
28
34
|
attr_accessor :pause_subscription
|
29
35
|
|
30
36
|
attr_accessor :resume_subscription
|
@@ -33,6 +39,28 @@ module UltracartClient
|
|
33
39
|
|
34
40
|
attr_accessor :update_subscription_credit_card
|
35
41
|
|
42
|
+
class EnumAttributeValidator
|
43
|
+
attr_reader :datatype
|
44
|
+
attr_reader :allowable_values
|
45
|
+
|
46
|
+
def initialize(datatype, allowable_values)
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
48
|
+
case datatype.to_s
|
49
|
+
when /Integer/i
|
50
|
+
value.to_i
|
51
|
+
when /Float/i
|
52
|
+
value.to_f
|
53
|
+
else
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def valid?(value)
|
60
|
+
!value || allowable_values.include?(value)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
36
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
37
65
|
def self.attribute_map
|
38
66
|
{
|
@@ -41,6 +69,8 @@ module UltracartClient
|
|
41
69
|
:'lookup_order_information' => :'lookup_order_information',
|
42
70
|
:'lookup_subscription_information' => :'lookup_subscription_information',
|
43
71
|
:'open_support_ticket' => :'open_support_ticket',
|
72
|
+
:'open_support_ticket_channel' => :'open_support_ticket_channel',
|
73
|
+
:'open_support_ticket_channel_email' => :'open_support_ticket_channel_email',
|
44
74
|
:'pause_subscription' => :'pause_subscription',
|
45
75
|
:'resume_subscription' => :'resume_subscription',
|
46
76
|
:'transfer_chat_to_live_agent' => :'transfer_chat_to_live_agent',
|
@@ -61,6 +91,8 @@ module UltracartClient
|
|
61
91
|
:'lookup_order_information' => :'Boolean',
|
62
92
|
:'lookup_subscription_information' => :'Boolean',
|
63
93
|
:'open_support_ticket' => :'Boolean',
|
94
|
+
:'open_support_ticket_channel' => :'String',
|
95
|
+
:'open_support_ticket_channel_email' => :'String',
|
64
96
|
:'pause_subscription' => :'Boolean',
|
65
97
|
:'resume_subscription' => :'Boolean',
|
66
98
|
:'transfer_chat_to_live_agent' => :'Boolean',
|
@@ -109,6 +141,14 @@ module UltracartClient
|
|
109
141
|
self.open_support_ticket = attributes[:'open_support_ticket']
|
110
142
|
end
|
111
143
|
|
144
|
+
if attributes.key?(:'open_support_ticket_channel')
|
145
|
+
self.open_support_ticket_channel = attributes[:'open_support_ticket_channel']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'open_support_ticket_channel_email')
|
149
|
+
self.open_support_ticket_channel_email = attributes[:'open_support_ticket_channel_email']
|
150
|
+
end
|
151
|
+
|
112
152
|
if attributes.key?(:'pause_subscription')
|
113
153
|
self.pause_subscription = attributes[:'pause_subscription']
|
114
154
|
end
|
@@ -136,9 +176,21 @@ module UltracartClient
|
|
136
176
|
# Check to see if the all the properties in the model are valid
|
137
177
|
# @return true if the model is valid
|
138
178
|
def valid?
|
179
|
+
open_support_ticket_channel_validator = EnumAttributeValidator.new('String', ["none", "email", "UltraCart Task", "Zoho Desk Ticket"])
|
180
|
+
return false unless open_support_ticket_channel_validator.valid?(@open_support_ticket_channel)
|
139
181
|
true
|
140
182
|
end
|
141
183
|
|
184
|
+
# Custom attribute writer method checking allowed values (enum).
|
185
|
+
# @param [Object] open_support_ticket_channel Object to be assigned
|
186
|
+
def open_support_ticket_channel=(open_support_ticket_channel)
|
187
|
+
validator = EnumAttributeValidator.new('String', ["none", "email", "UltraCart Task", "Zoho Desk Ticket"])
|
188
|
+
unless validator.valid?(open_support_ticket_channel)
|
189
|
+
fail ArgumentError, "invalid value for \"open_support_ticket_channel\", must be one of #{validator.allowable_values}."
|
190
|
+
end
|
191
|
+
@open_support_ticket_channel = open_support_ticket_channel
|
192
|
+
end
|
193
|
+
|
142
194
|
# Checks equality by comparing each attribute.
|
143
195
|
# @param [Object] Object to be compared
|
144
196
|
def ==(o)
|
@@ -149,6 +201,8 @@ module UltracartClient
|
|
149
201
|
lookup_order_information == o.lookup_order_information &&
|
150
202
|
lookup_subscription_information == o.lookup_subscription_information &&
|
151
203
|
open_support_ticket == o.open_support_ticket &&
|
204
|
+
open_support_ticket_channel == o.open_support_ticket_channel &&
|
205
|
+
open_support_ticket_channel_email == o.open_support_ticket_channel_email &&
|
152
206
|
pause_subscription == o.pause_subscription &&
|
153
207
|
resume_subscription == o.resume_subscription &&
|
154
208
|
transfer_chat_to_live_agent == o.transfer_chat_to_live_agent &&
|
@@ -164,7 +218,7 @@ module UltracartClient
|
|
164
218
|
# Calculates hash code according to all attributes.
|
165
219
|
# @return [Integer] Hash code
|
166
220
|
def hash
|
167
|
-
[cancel_subscription, delay_subscription, lookup_order_information, lookup_subscription_information, open_support_ticket, pause_subscription, resume_subscription, transfer_chat_to_live_agent, update_subscription_credit_card].hash
|
221
|
+
[cancel_subscription, delay_subscription, lookup_order_information, lookup_subscription_information, open_support_ticket, open_support_ticket_channel, open_support_ticket_channel_email, pause_subscription, resume_subscription, transfer_chat_to_live_agent, update_subscription_credit_card].hash
|
168
222
|
end
|
169
223
|
|
170
224
|
# Builds the object from hash
|
@@ -0,0 +1,306 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module UltracartClient
|
17
|
+
class CustomReport
|
18
|
+
attr_accessor :chart_javascript
|
19
|
+
|
20
|
+
attr_accessor :chart_javascript_url
|
21
|
+
|
22
|
+
attr_accessor :data_warehouse_report_config_oid
|
23
|
+
|
24
|
+
attr_accessor :dataset_security_level
|
25
|
+
|
26
|
+
attr_accessor :group_name
|
27
|
+
|
28
|
+
attr_accessor :merchant_id
|
29
|
+
|
30
|
+
attr_accessor :name
|
31
|
+
|
32
|
+
attr_accessor :parameters
|
33
|
+
|
34
|
+
attr_accessor :queries
|
35
|
+
|
36
|
+
attr_accessor :tooltips
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'chart_javascript' => :'chart_javascript',
|
42
|
+
:'chart_javascript_url' => :'chart_javascript_url',
|
43
|
+
:'data_warehouse_report_config_oid' => :'data_warehouse_report_config_oid',
|
44
|
+
:'dataset_security_level' => :'dataset_security_level',
|
45
|
+
:'group_name' => :'group_name',
|
46
|
+
:'merchant_id' => :'merchant_id',
|
47
|
+
:'name' => :'name',
|
48
|
+
:'parameters' => :'parameters',
|
49
|
+
:'queries' => :'queries',
|
50
|
+
:'tooltips' => :'tooltips'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.openapi_types
|
61
|
+
{
|
62
|
+
:'chart_javascript' => :'String',
|
63
|
+
:'chart_javascript_url' => :'String',
|
64
|
+
:'data_warehouse_report_config_oid' => :'Integer',
|
65
|
+
:'dataset_security_level' => :'String',
|
66
|
+
:'group_name' => :'String',
|
67
|
+
:'merchant_id' => :'String',
|
68
|
+
:'name' => :'String',
|
69
|
+
:'parameters' => :'Array<CustomReportParameter>',
|
70
|
+
:'queries' => :'Array<CustomReportQuery>',
|
71
|
+
:'tooltips' => :'Array<CustomReportTooltip>'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
81
|
+
# Initializes the object
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
def initialize(attributes = {})
|
84
|
+
if (!attributes.is_a?(Hash))
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomReport` initialize method"
|
86
|
+
end
|
87
|
+
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
+
end
|
93
|
+
h[k.to_sym] = v
|
94
|
+
}
|
95
|
+
|
96
|
+
if attributes.key?(:'chart_javascript')
|
97
|
+
self.chart_javascript = attributes[:'chart_javascript']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'chart_javascript_url')
|
101
|
+
self.chart_javascript_url = attributes[:'chart_javascript_url']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'data_warehouse_report_config_oid')
|
105
|
+
self.data_warehouse_report_config_oid = attributes[:'data_warehouse_report_config_oid']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'dataset_security_level')
|
109
|
+
self.dataset_security_level = attributes[:'dataset_security_level']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'group_name')
|
113
|
+
self.group_name = attributes[:'group_name']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'merchant_id')
|
117
|
+
self.merchant_id = attributes[:'merchant_id']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'name')
|
121
|
+
self.name = attributes[:'name']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'parameters')
|
125
|
+
if (value = attributes[:'parameters']).is_a?(Array)
|
126
|
+
self.parameters = value
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'queries')
|
131
|
+
if (value = attributes[:'queries']).is_a?(Array)
|
132
|
+
self.queries = value
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'tooltips')
|
137
|
+
if (value = attributes[:'tooltips']).is_a?(Array)
|
138
|
+
self.tooltips = value
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
144
|
+
# @return Array for valid properties with the reasons
|
145
|
+
def list_invalid_properties
|
146
|
+
invalid_properties = Array.new
|
147
|
+
invalid_properties
|
148
|
+
end
|
149
|
+
|
150
|
+
# Check to see if the all the properties in the model are valid
|
151
|
+
# @return true if the model is valid
|
152
|
+
def valid?
|
153
|
+
true
|
154
|
+
end
|
155
|
+
|
156
|
+
# Checks equality by comparing each attribute.
|
157
|
+
# @param [Object] Object to be compared
|
158
|
+
def ==(o)
|
159
|
+
return true if self.equal?(o)
|
160
|
+
self.class == o.class &&
|
161
|
+
chart_javascript == o.chart_javascript &&
|
162
|
+
chart_javascript_url == o.chart_javascript_url &&
|
163
|
+
data_warehouse_report_config_oid == o.data_warehouse_report_config_oid &&
|
164
|
+
dataset_security_level == o.dataset_security_level &&
|
165
|
+
group_name == o.group_name &&
|
166
|
+
merchant_id == o.merchant_id &&
|
167
|
+
name == o.name &&
|
168
|
+
parameters == o.parameters &&
|
169
|
+
queries == o.queries &&
|
170
|
+
tooltips == o.tooltips
|
171
|
+
end
|
172
|
+
|
173
|
+
# @see the `==` method
|
174
|
+
# @param [Object] Object to be compared
|
175
|
+
def eql?(o)
|
176
|
+
self == o
|
177
|
+
end
|
178
|
+
|
179
|
+
# Calculates hash code according to all attributes.
|
180
|
+
# @return [Integer] Hash code
|
181
|
+
def hash
|
182
|
+
[chart_javascript, chart_javascript_url, data_warehouse_report_config_oid, dataset_security_level, group_name, merchant_id, name, parameters, queries, tooltips].hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Builds the object from hash
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
187
|
+
# @return [Object] Returns the model itself
|
188
|
+
def self.build_from_hash(attributes)
|
189
|
+
new.build_from_hash(attributes)
|
190
|
+
end
|
191
|
+
|
192
|
+
# Builds the object from hash
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
+
# @return [Object] Returns the model itself
|
195
|
+
def build_from_hash(attributes)
|
196
|
+
return nil unless attributes.is_a?(Hash)
|
197
|
+
attributes = attributes.transform_keys(&:to_sym)
|
198
|
+
self.class.openapi_types.each_pair do |key, type|
|
199
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
200
|
+
self.send("#{key}=", nil)
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
202
|
+
# check to ensure the input is an array given that the attribute
|
203
|
+
# is documented as an array but the input is not
|
204
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
205
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
206
|
+
end
|
207
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
208
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
self
|
213
|
+
end
|
214
|
+
|
215
|
+
# Deserializes the data based on type
|
216
|
+
# @param string type Data type
|
217
|
+
# @param string value Value to be deserialized
|
218
|
+
# @return [Object] Deserialized data
|
219
|
+
def _deserialize(type, value)
|
220
|
+
case type.to_sym
|
221
|
+
when :Time
|
222
|
+
Time.parse(value)
|
223
|
+
when :Date
|
224
|
+
Date.parse(value)
|
225
|
+
when :String
|
226
|
+
value.to_s
|
227
|
+
when :Integer
|
228
|
+
value.to_i
|
229
|
+
when :Float
|
230
|
+
value.to_f
|
231
|
+
when :Boolean
|
232
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
233
|
+
true
|
234
|
+
else
|
235
|
+
false
|
236
|
+
end
|
237
|
+
when :Object
|
238
|
+
# generic object (usually a Hash), return directly
|
239
|
+
value
|
240
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
241
|
+
inner_type = Regexp.last_match[:inner_type]
|
242
|
+
value.map { |v| _deserialize(inner_type, v) }
|
243
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
244
|
+
k_type = Regexp.last_match[:k_type]
|
245
|
+
v_type = Regexp.last_match[:v_type]
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each do |k, v|
|
248
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
else # model
|
252
|
+
# models (e.g. Pet) or oneOf
|
253
|
+
klass = UltracartClient.const_get(type)
|
254
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
# Returns the string representation of the object
|
259
|
+
# @return [String] String presentation of the object
|
260
|
+
def to_s
|
261
|
+
to_hash.to_s
|
262
|
+
end
|
263
|
+
|
264
|
+
# to_body is an alias to to_hash (backward compatibility)
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
266
|
+
def to_body
|
267
|
+
to_hash
|
268
|
+
end
|
269
|
+
|
270
|
+
# Returns the object in the form of hash
|
271
|
+
# @return [Hash] Returns the object in the form of hash
|
272
|
+
def to_hash
|
273
|
+
hash = {}
|
274
|
+
self.class.attribute_map.each_pair do |attr, param|
|
275
|
+
value = self.send(attr)
|
276
|
+
if value.nil?
|
277
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
|
+
end
|
280
|
+
|
281
|
+
hash[param] = _to_hash(value)
|
282
|
+
end
|
283
|
+
hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Outputs non-array value in the form of hash
|
287
|
+
# For object, use to_hash. Otherwise, just return the value
|
288
|
+
# @param [Object] value Any valid value
|
289
|
+
# @return [Hash] Returns the value in the form of hash
|
290
|
+
def _to_hash(value)
|
291
|
+
if value.is_a?(Array)
|
292
|
+
value.compact.map { |v| _to_hash(v) }
|
293
|
+
elsif value.is_a?(Hash)
|
294
|
+
{}.tap do |hash|
|
295
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
296
|
+
end
|
297
|
+
elsif value.respond_to? :to_hash
|
298
|
+
value.to_hash
|
299
|
+
else
|
300
|
+
value
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
end
|
305
|
+
|
306
|
+
end
|