ultracart_api 4.0.46.rc → 4.0.49.rc
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 +12 -4
- data/docs/ConversationEventRRWeb.md +30 -0
- data/docs/ConversationEventTyping.md +22 -0
- data/docs/ConversationMessage.md +2 -0
- data/docs/ConversationWebsocketMessage.md +4 -0
- data/docs/EmailCommseqSequenceTestRequest.md +32 -0
- data/docs/EmailCommseqSequenceTestResponse.md +24 -0
- data/docs/StorefrontApi.md +74 -0
- data/lib/ultracart_api/api/storefront_api.rb +79 -0
- data/lib/ultracart_api/models/conversation_event_rr_web.rb +308 -0
- data/lib/ultracart_api/models/conversation_event_typing.rb +237 -0
- data/lib/ultracart_api/models/conversation_message.rb +45 -1
- data/lib/ultracart_api/models/conversation_websocket_message.rb +23 -5
- data/lib/ultracart_api/models/email_commseq_sequence_test_request.rb +284 -0
- data/lib/ultracart_api/models/email_commseq_sequence_test_response.rb +247 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
@@ -28,9 +28,13 @@ module UltracartClient
|
|
28
28
|
|
29
29
|
attr_accessor :event_queue_status_update
|
30
30
|
|
31
|
+
attr_accessor :event_rrweb
|
32
|
+
|
31
33
|
# Type of event
|
32
34
|
attr_accessor :event_type
|
33
35
|
|
36
|
+
attr_accessor :event_typing
|
37
|
+
|
34
38
|
attr_accessor :event_updated_message
|
35
39
|
|
36
40
|
attr_accessor :message
|
@@ -69,7 +73,9 @@ module UltracartClient
|
|
69
73
|
:'event_new_message' => :'event_new_message',
|
70
74
|
:'event_queue_position' => :'event_queue_position',
|
71
75
|
:'event_queue_status_update' => :'event_queue_status_update',
|
76
|
+
:'event_rrweb' => :'event_rrweb',
|
72
77
|
:'event_type' => :'event_type',
|
78
|
+
:'event_typing' => :'event_typing',
|
73
79
|
:'event_updated_message' => :'event_updated_message',
|
74
80
|
:'message' => :'message',
|
75
81
|
:'type' => :'type'
|
@@ -90,7 +96,9 @@ module UltracartClient
|
|
90
96
|
:'event_new_message' => :'ConversationSummary',
|
91
97
|
:'event_queue_position' => :'ConversationEventQueuePosition',
|
92
98
|
:'event_queue_status_update' => :'ConversationWebchatQueueStatus',
|
99
|
+
:'event_rrweb' => :'ConversationEventRRWeb',
|
93
100
|
:'event_type' => :'String',
|
101
|
+
:'event_typing' => :'ConversationEventTyping',
|
94
102
|
:'event_updated_message' => :'ConversationMessage',
|
95
103
|
:'message' => :'ConversationMessage',
|
96
104
|
:'type' => :'String'
|
@@ -142,10 +150,18 @@ module UltracartClient
|
|
142
150
|
self.event_queue_status_update = attributes[:'event_queue_status_update']
|
143
151
|
end
|
144
152
|
|
153
|
+
if attributes.key?(:'event_rrweb')
|
154
|
+
self.event_rrweb = attributes[:'event_rrweb']
|
155
|
+
end
|
156
|
+
|
145
157
|
if attributes.key?(:'event_type')
|
146
158
|
self.event_type = attributes[:'event_type']
|
147
159
|
end
|
148
160
|
|
161
|
+
if attributes.key?(:'event_typing')
|
162
|
+
self.event_typing = attributes[:'event_typing']
|
163
|
+
end
|
164
|
+
|
149
165
|
if attributes.key?(:'event_updated_message')
|
150
166
|
self.event_updated_message = attributes[:'event_updated_message']
|
151
167
|
end
|
@@ -169,9 +185,9 @@ module UltracartClient
|
|
169
185
|
# Check to see if the all the properties in the model are valid
|
170
186
|
# @return true if the model is valid
|
171
187
|
def valid?
|
172
|
-
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update"])
|
188
|
+
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb"])
|
173
189
|
return false unless event_type_validator.valid?(@event_type)
|
174
|
-
type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping"])
|
190
|
+
type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping", "check queue position"])
|
175
191
|
return false unless type_validator.valid?(@type)
|
176
192
|
true
|
177
193
|
end
|
@@ -179,7 +195,7 @@ module UltracartClient
|
|
179
195
|
# Custom attribute writer method checking allowed values (enum).
|
180
196
|
# @param [Object] event_type Object to be assigned
|
181
197
|
def event_type=(event_type)
|
182
|
-
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update"])
|
198
|
+
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb"])
|
183
199
|
unless validator.valid?(event_type)
|
184
200
|
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
185
201
|
end
|
@@ -189,7 +205,7 @@ module UltracartClient
|
|
189
205
|
# Custom attribute writer method checking allowed values (enum).
|
190
206
|
# @param [Object] type Object to be assigned
|
191
207
|
def type=(type)
|
192
|
-
validator = EnumAttributeValidator.new('String', ["message", "event", "ping"])
|
208
|
+
validator = EnumAttributeValidator.new('String', ["message", "event", "ping", "check queue position"])
|
193
209
|
unless validator.valid?(type)
|
194
210
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
195
211
|
end
|
@@ -207,7 +223,9 @@ module UltracartClient
|
|
207
223
|
event_new_message == o.event_new_message &&
|
208
224
|
event_queue_position == o.event_queue_position &&
|
209
225
|
event_queue_status_update == o.event_queue_status_update &&
|
226
|
+
event_rrweb == o.event_rrweb &&
|
210
227
|
event_type == o.event_type &&
|
228
|
+
event_typing == o.event_typing &&
|
211
229
|
event_updated_message == o.event_updated_message &&
|
212
230
|
message == o.message &&
|
213
231
|
type == o.type
|
@@ -222,7 +240,7 @@ module UltracartClient
|
|
222
240
|
# Calculates hash code according to all attributes.
|
223
241
|
# @return [Integer] Hash code
|
224
242
|
def hash
|
225
|
-
[conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_queue_status_update, event_type, event_updated_message, message, type].hash
|
243
|
+
[conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_queue_status_update, event_rrweb, event_type, event_typing, event_updated_message, message, type].hash
|
226
244
|
end
|
227
245
|
|
228
246
|
# Builds the object from hash
|
@@ -0,0 +1,284 @@
|
|
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 EmailCommseqSequenceTestRequest
|
18
|
+
attr_accessor :cart_id
|
19
|
+
|
20
|
+
attr_accessor :cart_item_ids
|
21
|
+
|
22
|
+
attr_accessor :esp_commseq_uuid
|
23
|
+
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
attr_accessor :order_id
|
27
|
+
|
28
|
+
attr_accessor :please_review
|
29
|
+
|
30
|
+
attr_accessor :send_to_email
|
31
|
+
|
32
|
+
attr_accessor :send_to_logged_in_user
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'cart_id' => :'cart_id',
|
38
|
+
:'cart_item_ids' => :'cart_item_ids',
|
39
|
+
:'esp_commseq_uuid' => :'esp_commseq_uuid',
|
40
|
+
:'name' => :'name',
|
41
|
+
:'order_id' => :'order_id',
|
42
|
+
:'please_review' => :'please_review',
|
43
|
+
:'send_to_email' => :'send_to_email',
|
44
|
+
:'send_to_logged_in_user' => :'send_to_logged_in_user'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.openapi_types
|
55
|
+
{
|
56
|
+
:'cart_id' => :'String',
|
57
|
+
:'cart_item_ids' => :'Array<String>',
|
58
|
+
:'esp_commseq_uuid' => :'String',
|
59
|
+
:'name' => :'String',
|
60
|
+
:'order_id' => :'String',
|
61
|
+
:'please_review' => :'Boolean',
|
62
|
+
:'send_to_email' => :'String',
|
63
|
+
:'send_to_logged_in_user' => :'Boolean'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailCommseqSequenceTestRequest` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailCommseqSequenceTestRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'cart_id')
|
89
|
+
self.cart_id = attributes[:'cart_id']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'cart_item_ids')
|
93
|
+
if (value = attributes[:'cart_item_ids']).is_a?(Array)
|
94
|
+
self.cart_item_ids = value
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'esp_commseq_uuid')
|
99
|
+
self.esp_commseq_uuid = attributes[:'esp_commseq_uuid']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'name')
|
103
|
+
self.name = attributes[:'name']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'order_id')
|
107
|
+
self.order_id = attributes[:'order_id']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'please_review')
|
111
|
+
self.please_review = attributes[:'please_review']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'send_to_email')
|
115
|
+
self.send_to_email = attributes[:'send_to_email']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'send_to_logged_in_user')
|
119
|
+
self.send_to_logged_in_user = attributes[:'send_to_logged_in_user']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
124
|
+
# @return Array for valid properties with the reasons
|
125
|
+
def list_invalid_properties
|
126
|
+
invalid_properties = Array.new
|
127
|
+
invalid_properties
|
128
|
+
end
|
129
|
+
|
130
|
+
# Check to see if the all the properties in the model are valid
|
131
|
+
# @return true if the model is valid
|
132
|
+
def valid?
|
133
|
+
true
|
134
|
+
end
|
135
|
+
|
136
|
+
# Checks equality by comparing each attribute.
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def ==(o)
|
139
|
+
return true if self.equal?(o)
|
140
|
+
self.class == o.class &&
|
141
|
+
cart_id == o.cart_id &&
|
142
|
+
cart_item_ids == o.cart_item_ids &&
|
143
|
+
esp_commseq_uuid == o.esp_commseq_uuid &&
|
144
|
+
name == o.name &&
|
145
|
+
order_id == o.order_id &&
|
146
|
+
please_review == o.please_review &&
|
147
|
+
send_to_email == o.send_to_email &&
|
148
|
+
send_to_logged_in_user == o.send_to_logged_in_user
|
149
|
+
end
|
150
|
+
|
151
|
+
# @see the `==` method
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
155
|
+
end
|
156
|
+
|
157
|
+
# Calculates hash code according to all attributes.
|
158
|
+
# @return [Integer] Hash code
|
159
|
+
def hash
|
160
|
+
[cart_id, cart_item_ids, esp_commseq_uuid, name, order_id, please_review, send_to_email, send_to_logged_in_user].hash
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def self.build_from_hash(attributes)
|
167
|
+
new.build_from_hash(attributes)
|
168
|
+
end
|
169
|
+
|
170
|
+
# Builds the object from hash
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
172
|
+
# @return [Object] Returns the model itself
|
173
|
+
def build_from_hash(attributes)
|
174
|
+
return nil unless attributes.is_a?(Hash)
|
175
|
+
attributes = attributes.transform_keys(&:to_sym)
|
176
|
+
self.class.openapi_types.each_pair do |key, type|
|
177
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
178
|
+
self.send("#{key}=", nil)
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
180
|
+
# check to ensure the input is an array given that the attribute
|
181
|
+
# is documented as an array but the input is not
|
182
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
183
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
184
|
+
end
|
185
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
186
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
self
|
191
|
+
end
|
192
|
+
|
193
|
+
# Deserializes the data based on type
|
194
|
+
# @param string type Data type
|
195
|
+
# @param string value Value to be deserialized
|
196
|
+
# @return [Object] Deserialized data
|
197
|
+
def _deserialize(type, value)
|
198
|
+
case type.to_sym
|
199
|
+
when :Time
|
200
|
+
Time.parse(value)
|
201
|
+
when :Date
|
202
|
+
Date.parse(value)
|
203
|
+
when :String
|
204
|
+
value.to_s
|
205
|
+
when :Integer
|
206
|
+
value.to_i
|
207
|
+
when :Float
|
208
|
+
value.to_f
|
209
|
+
when :Boolean
|
210
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
211
|
+
true
|
212
|
+
else
|
213
|
+
false
|
214
|
+
end
|
215
|
+
when :Object
|
216
|
+
# generic object (usually a Hash), return directly
|
217
|
+
value
|
218
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
219
|
+
inner_type = Regexp.last_match[:inner_type]
|
220
|
+
value.map { |v| _deserialize(inner_type, v) }
|
221
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
222
|
+
k_type = Regexp.last_match[:k_type]
|
223
|
+
v_type = Regexp.last_match[:v_type]
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each do |k, v|
|
226
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
else # model
|
230
|
+
# models (e.g. Pet) or oneOf
|
231
|
+
klass = UltracartClient.const_get(type)
|
232
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the string representation of the object
|
237
|
+
# @return [String] String presentation of the object
|
238
|
+
def to_s
|
239
|
+
to_hash.to_s
|
240
|
+
end
|
241
|
+
|
242
|
+
# to_body is an alias to to_hash (backward compatibility)
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
244
|
+
def to_body
|
245
|
+
to_hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Returns the object in the form of hash
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
250
|
+
def to_hash
|
251
|
+
hash = {}
|
252
|
+
self.class.attribute_map.each_pair do |attr, param|
|
253
|
+
value = self.send(attr)
|
254
|
+
if value.nil?
|
255
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
256
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
257
|
+
end
|
258
|
+
|
259
|
+
hash[param] = _to_hash(value)
|
260
|
+
end
|
261
|
+
hash
|
262
|
+
end
|
263
|
+
|
264
|
+
# Outputs non-array value in the form of hash
|
265
|
+
# For object, use to_hash. Otherwise, just return the value
|
266
|
+
# @param [Object] value Any valid value
|
267
|
+
# @return [Hash] Returns the value in the form of hash
|
268
|
+
def _to_hash(value)
|
269
|
+
if value.is_a?(Array)
|
270
|
+
value.compact.map { |v| _to_hash(v) }
|
271
|
+
elsif value.is_a?(Hash)
|
272
|
+
{}.tap do |hash|
|
273
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
274
|
+
end
|
275
|
+
elsif value.respond_to? :to_hash
|
276
|
+
value.to_hash
|
277
|
+
else
|
278
|
+
value
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
|
284
|
+
end
|
@@ -0,0 +1,247 @@
|
|
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 EmailCommseqSequenceTestResponse
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
attr_accessor :metadata
|
21
|
+
|
22
|
+
# Indicates if API call was successful
|
23
|
+
attr_accessor :success
|
24
|
+
|
25
|
+
attr_accessor :warning
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'error' => :'error',
|
31
|
+
:'metadata' => :'metadata',
|
32
|
+
:'success' => :'success',
|
33
|
+
:'warning' => :'warning'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'error' => :'Error',
|
46
|
+
:'metadata' => :'ResponseMetadata',
|
47
|
+
:'success' => :'Boolean',
|
48
|
+
:'warning' => :'Warning'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# List of attributes with nullable: true
|
53
|
+
def self.openapi_nullable
|
54
|
+
Set.new([
|
55
|
+
])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Initializes the object
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
60
|
+
def initialize(attributes = {})
|
61
|
+
if (!attributes.is_a?(Hash))
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailCommseqSequenceTestResponse` initialize method"
|
63
|
+
end
|
64
|
+
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailCommseqSequenceTestResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
|
+
end
|
70
|
+
h[k.to_sym] = v
|
71
|
+
}
|
72
|
+
|
73
|
+
if attributes.key?(:'error')
|
74
|
+
self.error = attributes[:'error']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'metadata')
|
78
|
+
self.metadata = attributes[:'metadata']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'success')
|
82
|
+
self.success = attributes[:'success']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'warning')
|
86
|
+
self.warning = attributes[:'warning']
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
91
|
+
# @return Array for valid properties with the reasons
|
92
|
+
def list_invalid_properties
|
93
|
+
invalid_properties = Array.new
|
94
|
+
invalid_properties
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check to see if the all the properties in the model are valid
|
98
|
+
# @return true if the model is valid
|
99
|
+
def valid?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
error == o.error &&
|
109
|
+
metadata == o.metadata &&
|
110
|
+
success == o.success &&
|
111
|
+
warning == o.warning
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[error, metadata, success, warning].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
new.build_from_hash(attributes)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
attributes = attributes.transform_keys(&:to_sym)
|
139
|
+
self.class.openapi_types.each_pair do |key, type|
|
140
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
141
|
+
self.send("#{key}=", nil)
|
142
|
+
elsif type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :Time
|
163
|
+
Time.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
# models (e.g. Pet) or oneOf
|
194
|
+
klass = UltracartClient.const_get(type)
|
195
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the string representation of the object
|
200
|
+
# @return [String] String presentation of the object
|
201
|
+
def to_s
|
202
|
+
to_hash.to_s
|
203
|
+
end
|
204
|
+
|
205
|
+
# to_body is an alias to to_hash (backward compatibility)
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_body
|
208
|
+
to_hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Returns the object in the form of hash
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
213
|
+
def to_hash
|
214
|
+
hash = {}
|
215
|
+
self.class.attribute_map.each_pair do |attr, param|
|
216
|
+
value = self.send(attr)
|
217
|
+
if value.nil?
|
218
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
219
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
220
|
+
end
|
221
|
+
|
222
|
+
hash[param] = _to_hash(value)
|
223
|
+
end
|
224
|
+
hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Outputs non-array value in the form of hash
|
228
|
+
# For object, use to_hash. Otherwise, just return the value
|
229
|
+
# @param [Object] value Any valid value
|
230
|
+
# @return [Hash] Returns the value in the form of hash
|
231
|
+
def _to_hash(value)
|
232
|
+
if value.is_a?(Array)
|
233
|
+
value.compact.map { |v| _to_hash(v) }
|
234
|
+
elsif value.is_a?(Hash)
|
235
|
+
{}.tap do |hash|
|
236
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
237
|
+
end
|
238
|
+
elsif value.respond_to? :to_hash
|
239
|
+
value.to_hash
|
240
|
+
else
|
241
|
+
value
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
246
|
+
|
247
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -138,6 +138,8 @@ require 'ultracart_api/models/conversation'
|
|
138
138
|
require 'ultracart_api/models/conversation_agent_auth'
|
139
139
|
require 'ultracart_api/models/conversation_agent_auth_response'
|
140
140
|
require 'ultracart_api/models/conversation_event_queue_position'
|
141
|
+
require 'ultracart_api/models/conversation_event_rr_web'
|
142
|
+
require 'ultracart_api/models/conversation_event_typing'
|
141
143
|
require 'ultracart_api/models/conversation_message'
|
142
144
|
require 'ultracart_api/models/conversation_message_transport_status'
|
143
145
|
require 'ultracart_api/models/conversation_multimedia_upload_url'
|
@@ -276,6 +278,8 @@ require 'ultracart_api/models/email_commseq_postcard_send_test_response'
|
|
276
278
|
require 'ultracart_api/models/email_commseq_postcards_request'
|
277
279
|
require 'ultracart_api/models/email_commseq_postcards_response'
|
278
280
|
require 'ultracart_api/models/email_commseq_response'
|
281
|
+
require 'ultracart_api/models/email_commseq_sequence_test_request'
|
282
|
+
require 'ultracart_api/models/email_commseq_sequence_test_response'
|
279
283
|
require 'ultracart_api/models/email_commseq_stat'
|
280
284
|
require 'ultracart_api/models/email_commseq_stat_response'
|
281
285
|
require 'ultracart_api/models/email_commseq_step'
|