ultracart_api 4.0.47.rc → 4.0.50.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 +11 -4
- data/docs/ConversationEventTyping.md +22 -0
- data/docs/ConversationSummary.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_typing.rb +237 -0
- data/lib/ultracart_api/models/conversation_summary.rb +12 -1
- data/lib/ultracart_api/models/conversation_websocket_message.rb +21 -3
- 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 +3 -0
- metadata +8 -2
@@ -24,6 +24,8 @@ module UltracartClient
|
|
24
24
|
|
25
25
|
attr_accessor :event_new_message
|
26
26
|
|
27
|
+
attr_accessor :event_participant_update
|
28
|
+
|
27
29
|
attr_accessor :event_queue_position
|
28
30
|
|
29
31
|
attr_accessor :event_queue_status_update
|
@@ -33,6 +35,8 @@ module UltracartClient
|
|
33
35
|
# Type of event
|
34
36
|
attr_accessor :event_type
|
35
37
|
|
38
|
+
attr_accessor :event_typing
|
39
|
+
|
36
40
|
attr_accessor :event_updated_message
|
37
41
|
|
38
42
|
attr_accessor :message
|
@@ -69,10 +73,12 @@ module UltracartClient
|
|
69
73
|
:'event_conversation_closed' => :'event_conversation_closed',
|
70
74
|
:'event_new_conversation' => :'event_new_conversation',
|
71
75
|
:'event_new_message' => :'event_new_message',
|
76
|
+
:'event_participant_update' => :'event_participant_update',
|
72
77
|
:'event_queue_position' => :'event_queue_position',
|
73
78
|
:'event_queue_status_update' => :'event_queue_status_update',
|
74
79
|
:'event_rrweb' => :'event_rrweb',
|
75
80
|
:'event_type' => :'event_type',
|
81
|
+
:'event_typing' => :'event_typing',
|
76
82
|
:'event_updated_message' => :'event_updated_message',
|
77
83
|
:'message' => :'message',
|
78
84
|
:'type' => :'type'
|
@@ -91,10 +97,12 @@ module UltracartClient
|
|
91
97
|
:'event_conversation_closed' => :'ConversationSummary',
|
92
98
|
:'event_new_conversation' => :'ConversationSummary',
|
93
99
|
:'event_new_message' => :'ConversationSummary',
|
100
|
+
:'event_participant_update' => :'ConversationSummary',
|
94
101
|
:'event_queue_position' => :'ConversationEventQueuePosition',
|
95
102
|
:'event_queue_status_update' => :'ConversationWebchatQueueStatus',
|
96
103
|
:'event_rrweb' => :'ConversationEventRRWeb',
|
97
104
|
:'event_type' => :'String',
|
105
|
+
:'event_typing' => :'ConversationEventTyping',
|
98
106
|
:'event_updated_message' => :'ConversationMessage',
|
99
107
|
:'message' => :'ConversationMessage',
|
100
108
|
:'type' => :'String'
|
@@ -138,6 +146,10 @@ module UltracartClient
|
|
138
146
|
self.event_new_message = attributes[:'event_new_message']
|
139
147
|
end
|
140
148
|
|
149
|
+
if attributes.key?(:'event_participant_update')
|
150
|
+
self.event_participant_update = attributes[:'event_participant_update']
|
151
|
+
end
|
152
|
+
|
141
153
|
if attributes.key?(:'event_queue_position')
|
142
154
|
self.event_queue_position = attributes[:'event_queue_position']
|
143
155
|
end
|
@@ -154,6 +166,10 @@ module UltracartClient
|
|
154
166
|
self.event_type = attributes[:'event_type']
|
155
167
|
end
|
156
168
|
|
169
|
+
if attributes.key?(:'event_typing')
|
170
|
+
self.event_typing = attributes[:'event_typing']
|
171
|
+
end
|
172
|
+
|
157
173
|
if attributes.key?(:'event_updated_message')
|
158
174
|
self.event_updated_message = attributes[:'event_updated_message']
|
159
175
|
end
|
@@ -177,7 +193,7 @@ module UltracartClient
|
|
177
193
|
# Check to see if the all the properties in the model are valid
|
178
194
|
# @return true if the model is valid
|
179
195
|
def valid?
|
180
|
-
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb"])
|
196
|
+
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update"])
|
181
197
|
return false unless event_type_validator.valid?(@event_type)
|
182
198
|
type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping", "check queue position"])
|
183
199
|
return false unless type_validator.valid?(@type)
|
@@ -187,7 +203,7 @@ module UltracartClient
|
|
187
203
|
# Custom attribute writer method checking allowed values (enum).
|
188
204
|
# @param [Object] event_type Object to be assigned
|
189
205
|
def event_type=(event_type)
|
190
|
-
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb"])
|
206
|
+
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update"])
|
191
207
|
unless validator.valid?(event_type)
|
192
208
|
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
193
209
|
end
|
@@ -213,10 +229,12 @@ module UltracartClient
|
|
213
229
|
event_conversation_closed == o.event_conversation_closed &&
|
214
230
|
event_new_conversation == o.event_new_conversation &&
|
215
231
|
event_new_message == o.event_new_message &&
|
232
|
+
event_participant_update == o.event_participant_update &&
|
216
233
|
event_queue_position == o.event_queue_position &&
|
217
234
|
event_queue_status_update == o.event_queue_status_update &&
|
218
235
|
event_rrweb == o.event_rrweb &&
|
219
236
|
event_type == o.event_type &&
|
237
|
+
event_typing == o.event_typing &&
|
220
238
|
event_updated_message == o.event_updated_message &&
|
221
239
|
message == o.message &&
|
222
240
|
type == o.type
|
@@ -231,7 +249,7 @@ module UltracartClient
|
|
231
249
|
# Calculates hash code according to all attributes.
|
232
250
|
# @return [Integer] Hash code
|
233
251
|
def hash
|
234
|
-
[conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_queue_status_update, event_rrweb, event_type, event_updated_message, message, type].hash
|
252
|
+
[conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_participant_update, event_queue_position, event_queue_status_update, event_rrweb, event_type, event_typing, event_updated_message, message, type].hash
|
235
253
|
end
|
236
254
|
|
237
255
|
# 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
@@ -139,6 +139,7 @@ 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
141
|
require 'ultracart_api/models/conversation_event_rr_web'
|
142
|
+
require 'ultracart_api/models/conversation_event_typing'
|
142
143
|
require 'ultracart_api/models/conversation_message'
|
143
144
|
require 'ultracart_api/models/conversation_message_transport_status'
|
144
145
|
require 'ultracart_api/models/conversation_multimedia_upload_url'
|
@@ -277,6 +278,8 @@ require 'ultracart_api/models/email_commseq_postcard_send_test_response'
|
|
277
278
|
require 'ultracart_api/models/email_commseq_postcards_request'
|
278
279
|
require 'ultracart_api/models/email_commseq_postcards_response'
|
279
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'
|
280
283
|
require 'ultracart_api/models/email_commseq_stat'
|
281
284
|
require 'ultracart_api/models/email_commseq_stat_response'
|
282
285
|
require 'ultracart_api/models/email_commseq_step'
|