ultracart_api 4.0.54.rc → 4.0.57.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -4
- data/docs/CartMarketing.md +2 -0
- data/docs/ConversationParticipant.md +2 -0
- data/docs/ConversationWebchatQueueStatusAgent.md +4 -2
- data/docs/CustomerApi.md +74 -0
- data/docs/CustomerMagicLinkResponse.md +26 -0
- data/docs/ItemReview.md +90 -0
- data/docs/ItemReviews.md +2 -0
- data/docs/OrderBilling.md +4 -0
- data/docs/OrderMarketing.md +2 -0
- data/docs/StoreFront.md +38 -0
- data/docs/StoreFrontsResponse.md +26 -0
- data/docs/StorefrontApi.md +67 -0
- data/lib/ultracart_api/api/customer_api.rb +70 -0
- data/lib/ultracart_api/api/storefront_api.rb +56 -0
- data/lib/ultracart_api/models/cart_marketing.rb +11 -1
- data/lib/ultracart_api/models/conversation_participant.rb +10 -1
- data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +49 -4
- data/lib/ultracart_api/models/customer_magic_link_response.rb +257 -0
- data/lib/ultracart_api/models/item_review.rb +545 -0
- data/lib/ultracart_api/models/item_reviews.rb +12 -1
- data/lib/ultracart_api/models/order_billing.rb +51 -1
- data/lib/ultracart_api/models/order_marketing.rb +11 -1
- data/lib/ultracart_api/models/store_front.rb +309 -0
- data/lib/ultracart_api/models/store_fronts_response.rb +258 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
@@ -6894,6 +6894,62 @@ module UltracartClient
|
|
6894
6894
|
return data, status_code, headers
|
6895
6895
|
end
|
6896
6896
|
|
6897
|
+
# Get storefronts (internal use only for security reasons)
|
6898
|
+
# @param [Hash] opts the optional parameters
|
6899
|
+
# @return [StoreFrontsResponse]
|
6900
|
+
def get_store_fronts(opts = {})
|
6901
|
+
data, _status_code, _headers = get_store_fronts_with_http_info(opts)
|
6902
|
+
data
|
6903
|
+
end
|
6904
|
+
|
6905
|
+
# Get storefronts (internal use only for security reasons)
|
6906
|
+
# @param [Hash] opts the optional parameters
|
6907
|
+
# @return [Array<(StoreFrontsResponse, Integer, Hash)>] StoreFrontsResponse data, response status code and response headers
|
6908
|
+
def get_store_fronts_with_http_info(opts = {})
|
6909
|
+
if @api_client.config.debugging
|
6910
|
+
@api_client.config.logger.debug 'Calling API: StorefrontApi.get_store_fronts ...'
|
6911
|
+
end
|
6912
|
+
# resource path
|
6913
|
+
local_var_path = '/storefront'
|
6914
|
+
|
6915
|
+
# query parameters
|
6916
|
+
query_params = opts[:query_params] || {}
|
6917
|
+
|
6918
|
+
# header parameters
|
6919
|
+
header_params = opts[:header_params] || {}
|
6920
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
6921
|
+
# HTTP header 'Accept' (if needed)
|
6922
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
6923
|
+
|
6924
|
+
# form parameters
|
6925
|
+
form_params = opts[:form_params] || {}
|
6926
|
+
|
6927
|
+
# http body (model)
|
6928
|
+
post_body = opts[:debug_body]
|
6929
|
+
|
6930
|
+
# return_type
|
6931
|
+
return_type = opts[:debug_return_type] || 'StoreFrontsResponse'
|
6932
|
+
|
6933
|
+
# auth_names
|
6934
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
|
6935
|
+
|
6936
|
+
new_options = opts.merge(
|
6937
|
+
:operation => :"StorefrontApi.get_store_fronts",
|
6938
|
+
:header_params => header_params,
|
6939
|
+
:query_params => query_params,
|
6940
|
+
:form_params => form_params,
|
6941
|
+
:body => post_body,
|
6942
|
+
:auth_names => auth_names,
|
6943
|
+
:return_type => return_type
|
6944
|
+
)
|
6945
|
+
|
6946
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
6947
|
+
if @api_client.config.debugging
|
6948
|
+
@api_client.config.logger.debug "API called: StorefrontApi#get_store_fronts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
6949
|
+
end
|
6950
|
+
return data, status_code, headers
|
6951
|
+
end
|
6952
|
+
|
6897
6953
|
# Get thumbnail parameters
|
6898
6954
|
# @param thumbnail_parameters [ThumbnailParametersRequest] Thumbnail Parameters
|
6899
6955
|
# @param [Hash] opts the optional parameters
|
@@ -18,6 +18,9 @@ module UltracartClient
|
|
18
18
|
# The advertising source the customer indicated
|
19
19
|
attr_accessor :advertising_source
|
20
20
|
|
21
|
+
# True if the customer agrees to receiving marketing SMS messages
|
22
|
+
attr_accessor :cell_phone_opt_in
|
23
|
+
|
21
24
|
# True if the customer agrees to receiving marketing emails
|
22
25
|
attr_accessor :mailing_list_opt_in
|
23
26
|
|
@@ -25,6 +28,7 @@ module UltracartClient
|
|
25
28
|
def self.attribute_map
|
26
29
|
{
|
27
30
|
:'advertising_source' => :'advertising_source',
|
31
|
+
:'cell_phone_opt_in' => :'cell_phone_opt_in',
|
28
32
|
:'mailing_list_opt_in' => :'mailing_list_opt_in'
|
29
33
|
}
|
30
34
|
end
|
@@ -38,6 +42,7 @@ module UltracartClient
|
|
38
42
|
def self.openapi_types
|
39
43
|
{
|
40
44
|
:'advertising_source' => :'String',
|
45
|
+
:'cell_phone_opt_in' => :'Boolean',
|
41
46
|
:'mailing_list_opt_in' => :'Boolean'
|
42
47
|
}
|
43
48
|
end
|
@@ -67,6 +72,10 @@ module UltracartClient
|
|
67
72
|
self.advertising_source = attributes[:'advertising_source']
|
68
73
|
end
|
69
74
|
|
75
|
+
if attributes.key?(:'cell_phone_opt_in')
|
76
|
+
self.cell_phone_opt_in = attributes[:'cell_phone_opt_in']
|
77
|
+
end
|
78
|
+
|
70
79
|
if attributes.key?(:'mailing_list_opt_in')
|
71
80
|
self.mailing_list_opt_in = attributes[:'mailing_list_opt_in']
|
72
81
|
end
|
@@ -91,6 +100,7 @@ module UltracartClient
|
|
91
100
|
return true if self.equal?(o)
|
92
101
|
self.class == o.class &&
|
93
102
|
advertising_source == o.advertising_source &&
|
103
|
+
cell_phone_opt_in == o.cell_phone_opt_in &&
|
94
104
|
mailing_list_opt_in == o.mailing_list_opt_in
|
95
105
|
end
|
96
106
|
|
@@ -103,7 +113,7 @@ module UltracartClient
|
|
103
113
|
# Calculates hash code according to all attributes.
|
104
114
|
# @return [Integer] Hash code
|
105
115
|
def hash
|
106
|
-
[advertising_source, mailing_list_opt_in].hash
|
116
|
+
[advertising_source, cell_phone_opt_in, mailing_list_opt_in].hash
|
107
117
|
end
|
108
118
|
|
109
119
|
# Builds the object from hash
|
@@ -30,6 +30,8 @@ module UltracartClient
|
|
30
30
|
# Left conversation date/time
|
31
31
|
attr_accessor :left_dts
|
32
32
|
|
33
|
+
attr_accessor :profile_image_url
|
34
|
+
|
33
35
|
attr_accessor :status
|
34
36
|
|
35
37
|
attr_accessor :unread_messages
|
@@ -43,6 +45,7 @@ module UltracartClient
|
|
43
45
|
:'joined_dts' => :'joined_dts',
|
44
46
|
:'last_message_dts' => :'last_message_dts',
|
45
47
|
:'left_dts' => :'left_dts',
|
48
|
+
:'profile_image_url' => :'profile_image_url',
|
46
49
|
:'status' => :'status',
|
47
50
|
:'unread_messages' => :'unread_messages'
|
48
51
|
}
|
@@ -62,6 +65,7 @@ module UltracartClient
|
|
62
65
|
:'joined_dts' => :'String',
|
63
66
|
:'last_message_dts' => :'String',
|
64
67
|
:'left_dts' => :'String',
|
68
|
+
:'profile_image_url' => :'String',
|
65
69
|
:'status' => :'String',
|
66
70
|
:'unread_messages' => :'Integer'
|
67
71
|
}
|
@@ -112,6 +116,10 @@ module UltracartClient
|
|
112
116
|
self.left_dts = attributes[:'left_dts']
|
113
117
|
end
|
114
118
|
|
119
|
+
if attributes.key?(:'profile_image_url')
|
120
|
+
self.profile_image_url = attributes[:'profile_image_url']
|
121
|
+
end
|
122
|
+
|
115
123
|
if attributes.key?(:'status')
|
116
124
|
self.status = attributes[:'status']
|
117
125
|
end
|
@@ -145,6 +153,7 @@ module UltracartClient
|
|
145
153
|
joined_dts == o.joined_dts &&
|
146
154
|
last_message_dts == o.last_message_dts &&
|
147
155
|
left_dts == o.left_dts &&
|
156
|
+
profile_image_url == o.profile_image_url &&
|
148
157
|
status == o.status &&
|
149
158
|
unread_messages == o.unread_messages
|
150
159
|
end
|
@@ -158,7 +167,7 @@ module UltracartClient
|
|
158
167
|
# Calculates hash code according to all attributes.
|
159
168
|
# @return [Integer] Hash code
|
160
169
|
def hash
|
161
|
-
[conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, joined_dts, last_message_dts, left_dts, status, unread_messages].hash
|
170
|
+
[conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, joined_dts, last_message_dts, left_dts, profile_image_url, status, unread_messages].hash
|
162
171
|
end
|
163
172
|
|
164
173
|
# Builds the object from hash
|
@@ -15,6 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module UltracartClient
|
17
17
|
class ConversationWebchatQueueStatusAgent
|
18
|
+
# Status of the agent
|
18
19
|
attr_accessor :agent_status
|
19
20
|
|
20
21
|
attr_accessor :conversation_participant_arn
|
@@ -26,6 +27,31 @@ module UltracartClient
|
|
26
27
|
|
27
28
|
attr_accessor :next_round_robin
|
28
29
|
|
30
|
+
# Profile image URL
|
31
|
+
attr_accessor :profile_image_url
|
32
|
+
|
33
|
+
class EnumAttributeValidator
|
34
|
+
attr_reader :datatype
|
35
|
+
attr_reader :allowable_values
|
36
|
+
|
37
|
+
def initialize(datatype, allowable_values)
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
39
|
+
case datatype.to_s
|
40
|
+
when /Integer/i
|
41
|
+
value.to_i
|
42
|
+
when /Float/i
|
43
|
+
value.to_f
|
44
|
+
else
|
45
|
+
value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def valid?(value)
|
51
|
+
!value || allowable_values.include?(value)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
29
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
56
|
def self.attribute_map
|
31
57
|
{
|
@@ -33,7 +59,8 @@ module UltracartClient
|
|
33
59
|
:'conversation_participant_arn' => :'conversation_participant_arn',
|
34
60
|
:'conversation_participant_name' => :'conversation_participant_name',
|
35
61
|
:'last_chat_dts' => :'last_chat_dts',
|
36
|
-
:'next_round_robin' => :'next_round_robin'
|
62
|
+
:'next_round_robin' => :'next_round_robin',
|
63
|
+
:'profile_image_url' => :'profile_image_url'
|
37
64
|
}
|
38
65
|
end
|
39
66
|
|
@@ -49,7 +76,8 @@ module UltracartClient
|
|
49
76
|
:'conversation_participant_arn' => :'String',
|
50
77
|
:'conversation_participant_name' => :'String',
|
51
78
|
:'last_chat_dts' => :'String',
|
52
|
-
:'next_round_robin' => :'Boolean'
|
79
|
+
:'next_round_robin' => :'Boolean',
|
80
|
+
:'profile_image_url' => :'String'
|
53
81
|
}
|
54
82
|
end
|
55
83
|
|
@@ -93,6 +121,10 @@ module UltracartClient
|
|
93
121
|
if attributes.key?(:'next_round_robin')
|
94
122
|
self.next_round_robin = attributes[:'next_round_robin']
|
95
123
|
end
|
124
|
+
|
125
|
+
if attributes.key?(:'profile_image_url')
|
126
|
+
self.profile_image_url = attributes[:'profile_image_url']
|
127
|
+
end
|
96
128
|
end
|
97
129
|
|
98
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -105,9 +137,21 @@ module UltracartClient
|
|
105
137
|
# Check to see if the all the properties in the model are valid
|
106
138
|
# @return true if the model is valid
|
107
139
|
def valid?
|
140
|
+
agent_status_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
141
|
+
return false unless agent_status_validator.valid?(@agent_status)
|
108
142
|
true
|
109
143
|
end
|
110
144
|
|
145
|
+
# Custom attribute writer method checking allowed values (enum).
|
146
|
+
# @param [Object] agent_status Object to be assigned
|
147
|
+
def agent_status=(agent_status)
|
148
|
+
validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
149
|
+
unless validator.valid?(agent_status)
|
150
|
+
fail ArgumentError, "invalid value for \"agent_status\", must be one of #{validator.allowable_values}."
|
151
|
+
end
|
152
|
+
@agent_status = agent_status
|
153
|
+
end
|
154
|
+
|
111
155
|
# Checks equality by comparing each attribute.
|
112
156
|
# @param [Object] Object to be compared
|
113
157
|
def ==(o)
|
@@ -117,7 +161,8 @@ module UltracartClient
|
|
117
161
|
conversation_participant_arn == o.conversation_participant_arn &&
|
118
162
|
conversation_participant_name == o.conversation_participant_name &&
|
119
163
|
last_chat_dts == o.last_chat_dts &&
|
120
|
-
next_round_robin == o.next_round_robin
|
164
|
+
next_round_robin == o.next_round_robin &&
|
165
|
+
profile_image_url == o.profile_image_url
|
121
166
|
end
|
122
167
|
|
123
168
|
# @see the `==` method
|
@@ -129,7 +174,7 @@ module UltracartClient
|
|
129
174
|
# Calculates hash code according to all attributes.
|
130
175
|
# @return [Integer] Hash code
|
131
176
|
def hash
|
132
|
-
[agent_status, conversation_participant_arn, conversation_participant_name, last_chat_dts, next_round_robin].hash
|
177
|
+
[agent_status, conversation_participant_arn, conversation_participant_name, last_chat_dts, next_round_robin, profile_image_url].hash
|
133
178
|
end
|
134
179
|
|
135
180
|
# Builds the object from hash
|
@@ -0,0 +1,257 @@
|
|
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 CustomerMagicLinkResponse
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
attr_accessor :metadata
|
21
|
+
|
22
|
+
# Indicates if API call was successful
|
23
|
+
attr_accessor :success
|
24
|
+
|
25
|
+
# URL
|
26
|
+
attr_accessor :url
|
27
|
+
|
28
|
+
attr_accessor :warning
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'error' => :'error',
|
34
|
+
:'metadata' => :'metadata',
|
35
|
+
:'success' => :'success',
|
36
|
+
:'url' => :'url',
|
37
|
+
:'warning' => :'warning'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns all the JSON keys this model knows about
|
42
|
+
def self.acceptable_attributes
|
43
|
+
attribute_map.values
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.openapi_types
|
48
|
+
{
|
49
|
+
:'error' => :'Error',
|
50
|
+
:'metadata' => :'ResponseMetadata',
|
51
|
+
:'success' => :'Boolean',
|
52
|
+
:'url' => :'String',
|
53
|
+
:'warning' => :'Warning'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
])
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
if (!attributes.is_a?(Hash))
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomerMagicLinkResponse` initialize method"
|
68
|
+
end
|
69
|
+
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomerMagicLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
74
|
+
end
|
75
|
+
h[k.to_sym] = v
|
76
|
+
}
|
77
|
+
|
78
|
+
if attributes.key?(:'error')
|
79
|
+
self.error = attributes[:'error']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'metadata')
|
83
|
+
self.metadata = attributes[:'metadata']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'success')
|
87
|
+
self.success = attributes[:'success']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'url')
|
91
|
+
self.url = attributes[:'url']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'warning')
|
95
|
+
self.warning = attributes[:'warning']
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
invalid_properties = Array.new
|
103
|
+
invalid_properties
|
104
|
+
end
|
105
|
+
|
106
|
+
# Check to see if the all the properties in the model are valid
|
107
|
+
# @return true if the model is valid
|
108
|
+
def valid?
|
109
|
+
true
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(o)
|
115
|
+
return true if self.equal?(o)
|
116
|
+
self.class == o.class &&
|
117
|
+
error == o.error &&
|
118
|
+
metadata == o.metadata &&
|
119
|
+
success == o.success &&
|
120
|
+
url == o.url &&
|
121
|
+
warning == o.warning
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see the `==` method
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def eql?(o)
|
127
|
+
self == o
|
128
|
+
end
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Integer] Hash code
|
132
|
+
def hash
|
133
|
+
[error, metadata, success, url, warning].hash
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def self.build_from_hash(attributes)
|
140
|
+
new.build_from_hash(attributes)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def build_from_hash(attributes)
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
|
+
self.class.openapi_types.each_pair do |key, type|
|
150
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
151
|
+
self.send("#{key}=", nil)
|
152
|
+
elsif type =~ /\AArray<(.*)>/i
|
153
|
+
# check to ensure the input is an array given that the attribute
|
154
|
+
# is documented as an array but the input is not
|
155
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
156
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
157
|
+
end
|
158
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
159
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
self
|
164
|
+
end
|
165
|
+
|
166
|
+
# Deserializes the data based on type
|
167
|
+
# @param string type Data type
|
168
|
+
# @param string value Value to be deserialized
|
169
|
+
# @return [Object] Deserialized data
|
170
|
+
def _deserialize(type, value)
|
171
|
+
case type.to_sym
|
172
|
+
when :Time
|
173
|
+
Time.parse(value)
|
174
|
+
when :Date
|
175
|
+
Date.parse(value)
|
176
|
+
when :String
|
177
|
+
value.to_s
|
178
|
+
when :Integer
|
179
|
+
value.to_i
|
180
|
+
when :Float
|
181
|
+
value.to_f
|
182
|
+
when :Boolean
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
184
|
+
true
|
185
|
+
else
|
186
|
+
false
|
187
|
+
end
|
188
|
+
when :Object
|
189
|
+
# generic object (usually a Hash), return directly
|
190
|
+
value
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each do |k, v|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
else # model
|
203
|
+
# models (e.g. Pet) or oneOf
|
204
|
+
klass = UltracartClient.const_get(type)
|
205
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|