ultracart_api 4.0.201 → 4.0.202
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +80 -4
- data/docs/ConversationApi.md +3565 -549
- data/docs/ConversationPbxAgent.md +34 -0
- data/docs/ConversationPbxAgentResponse.md +26 -0
- data/docs/ConversationPbxAgentsResponse.md +26 -0
- data/docs/ConversationPbxAudio.md +34 -0
- data/docs/ConversationPbxAudioResponse.md +26 -0
- data/docs/ConversationPbxAudiosResponse.md +26 -0
- data/docs/ConversationPbxCustomerSnapshotRequest.md +32 -0
- data/docs/ConversationPbxCustomerSnapshotResponse.md +30 -0
- data/docs/ConversationPbxMenu.md +36 -0
- data/docs/ConversationPbxMenuMapping.md +24 -0
- data/docs/ConversationPbxMenuResponse.md +26 -0
- data/docs/ConversationPbxMenusResponse.md +26 -0
- data/docs/ConversationPbxPhoneNumber.md +26 -0
- data/docs/ConversationPbxPhoneNumberResponse.md +26 -0
- data/docs/ConversationPbxPhoneNumbersResponse.md +26 -0
- data/docs/ConversationPbxQueue.md +52 -0
- data/docs/ConversationPbxQueueMembers.md +20 -0
- data/docs/ConversationPbxQueueResponse.md +26 -0
- data/docs/ConversationPbxQueuesResponse.md +26 -0
- data/docs/ConversationPbxTimeBased.md +24 -0
- data/docs/ConversationPbxTimeBasedMapping.md +24 -0
- data/docs/ConversationPbxTimeBasedMappingConfig.md +20 -0
- data/docs/ConversationPbxTimeBasedResponse.md +26 -0
- data/docs/ConversationPbxTimeBasedsResponse.md +26 -0
- data/docs/ConversationPbxTimeRange.md +26 -0
- data/docs/ConversationPbxTimeRangeConfig.md +28 -0
- data/docs/ConversationPbxTimeRangeResponse.md +26 -0
- data/docs/ConversationPbxTimeRangesResponse.md +26 -0
- data/docs/ConversationPbxVoicemailMailbox.md +38 -0
- data/docs/ConversationPbxVoicemailMailboxResponse.md +26 -0
- data/docs/ConversationPbxVoicemailMailboxesResponse.md +26 -0
- data/docs/WorkflowApi.md +69 -0
- data/docs/WorkflowTaskTagsResponse.md +26 -0
- data/lib/ultracart_api/api/conversation_api.rb +3422 -649
- data/lib/ultracart_api/api/workflow_api.rb +58 -0
- data/lib/ultracart_api/models/conversation_pbx_agent.rb +360 -0
- data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_audio.rb +390 -0
- data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +283 -0
- data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +278 -0
- data/lib/ultracart_api/models/conversation_pbx_menu.rb +402 -0
- data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +250 -0
- data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +335 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_queue.rb +539 -0
- data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +232 -0
- data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based.rb +246 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +310 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +231 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range.rb +322 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +270 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +440 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +258 -0
- data/lib/ultracart_api/models/workflow_task_tags_response.rb +259 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +32 -0
- metadata +66 -2
@@ -0,0 +1,258 @@
|
|
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 ConversationPbxAgentsResponse
|
18
|
+
attr_accessor :agents
|
19
|
+
|
20
|
+
attr_accessor :error
|
21
|
+
|
22
|
+
attr_accessor :metadata
|
23
|
+
|
24
|
+
# Indicates if API call was successful
|
25
|
+
attr_accessor :success
|
26
|
+
|
27
|
+
attr_accessor :warning
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'agents' => :'agents',
|
33
|
+
:'error' => :'error',
|
34
|
+
:'metadata' => :'metadata',
|
35
|
+
:'success' => :'success',
|
36
|
+
:'warning' => :'warning'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'agents' => :'Array<ConversationPbxAgent>',
|
49
|
+
:'error' => :'Error',
|
50
|
+
:'metadata' => :'ResponseMetadata',
|
51
|
+
:'success' => :'Boolean',
|
52
|
+
:'warning' => :'Warning'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxAgentsResponse` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxAgentsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'agents')
|
78
|
+
if (value = attributes[:'agents']).is_a?(Array)
|
79
|
+
self.agents = value
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'error')
|
84
|
+
self.error = attributes[:'error']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'metadata')
|
88
|
+
self.metadata = attributes[:'metadata']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'success')
|
92
|
+
self.success = attributes[:'success']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'warning')
|
96
|
+
self.warning = attributes[:'warning']
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
101
|
+
# @return Array for valid properties with the reasons
|
102
|
+
def list_invalid_properties
|
103
|
+
invalid_properties = Array.new
|
104
|
+
invalid_properties
|
105
|
+
end
|
106
|
+
|
107
|
+
# Check to see if the all the properties in the model are valid
|
108
|
+
# @return true if the model is valid
|
109
|
+
def valid?
|
110
|
+
true
|
111
|
+
end
|
112
|
+
|
113
|
+
# Checks equality by comparing each attribute.
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def ==(o)
|
116
|
+
return true if self.equal?(o)
|
117
|
+
self.class == o.class &&
|
118
|
+
agents == o.agents &&
|
119
|
+
error == o.error &&
|
120
|
+
metadata == o.metadata &&
|
121
|
+
success == o.success &&
|
122
|
+
warning == o.warning
|
123
|
+
end
|
124
|
+
|
125
|
+
# @see the `==` method
|
126
|
+
# @param [Object] Object to be compared
|
127
|
+
def eql?(o)
|
128
|
+
self == o
|
129
|
+
end
|
130
|
+
|
131
|
+
# Calculates hash code according to all attributes.
|
132
|
+
# @return [Integer] Hash code
|
133
|
+
def hash
|
134
|
+
[agents, error, metadata, success, warning].hash
|
135
|
+
end
|
136
|
+
|
137
|
+
# Builds the object from hash
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
139
|
+
# @return [Object] Returns the model itself
|
140
|
+
def self.build_from_hash(attributes)
|
141
|
+
new.build_from_hash(attributes)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Builds the object from hash
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
+
# @return [Object] Returns the model itself
|
147
|
+
def build_from_hash(attributes)
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
150
|
+
self.class.openapi_types.each_pair do |key, type|
|
151
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
152
|
+
self.send("#{key}=", nil)
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
158
|
+
end
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
171
|
+
def _deserialize(type, value)
|
172
|
+
case type.to_sym
|
173
|
+
when :Time
|
174
|
+
Time.parse(value)
|
175
|
+
when :Date
|
176
|
+
Date.parse(value)
|
177
|
+
when :String
|
178
|
+
value.to_s
|
179
|
+
when :Integer
|
180
|
+
value.to_i
|
181
|
+
when :Float
|
182
|
+
value.to_f
|
183
|
+
when :Boolean
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
+
true
|
186
|
+
else
|
187
|
+
false
|
188
|
+
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each do |k, v|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
else # model
|
204
|
+
# models (e.g. Pet) or oneOf
|
205
|
+
klass = UltracartClient.const_get(type)
|
206
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
if value.nil?
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
231
|
+
end
|
232
|
+
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
@@ -0,0 +1,390 @@
|
|
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 ConversationPbxAudio
|
18
|
+
# Audio S3 Listing Key
|
19
|
+
attr_accessor :audio_s3_listing_key
|
20
|
+
|
21
|
+
# Conversation Pbx Audio UUID
|
22
|
+
attr_accessor :conversation_pbx_audio_uuid
|
23
|
+
|
24
|
+
# If true, this will be the default hold music
|
25
|
+
attr_accessor :default_hold_music
|
26
|
+
|
27
|
+
# Description of this audio
|
28
|
+
attr_accessor :description
|
29
|
+
|
30
|
+
# Filename
|
31
|
+
attr_accessor :filename
|
32
|
+
|
33
|
+
# Merchant Id
|
34
|
+
attr_accessor :merchant_id
|
35
|
+
|
36
|
+
# Mime Type
|
37
|
+
attr_accessor :mime_type
|
38
|
+
|
39
|
+
# User Id
|
40
|
+
attr_accessor :user_id
|
41
|
+
|
42
|
+
# Version
|
43
|
+
attr_accessor :version
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'audio_s3_listing_key' => :'audio_s3_listing_key',
|
49
|
+
:'conversation_pbx_audio_uuid' => :'conversation_pbx_audio_uuid',
|
50
|
+
:'default_hold_music' => :'default_hold_music',
|
51
|
+
:'description' => :'description',
|
52
|
+
:'filename' => :'filename',
|
53
|
+
:'merchant_id' => :'merchant_id',
|
54
|
+
:'mime_type' => :'mime_type',
|
55
|
+
:'user_id' => :'user_id',
|
56
|
+
:'version' => :'version'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# Returns all the JSON keys this model knows about
|
61
|
+
def self.acceptable_attributes
|
62
|
+
attribute_map.values
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute type mapping.
|
66
|
+
def self.openapi_types
|
67
|
+
{
|
68
|
+
:'audio_s3_listing_key' => :'String',
|
69
|
+
:'conversation_pbx_audio_uuid' => :'String',
|
70
|
+
:'default_hold_music' => :'Boolean',
|
71
|
+
:'description' => :'String',
|
72
|
+
:'filename' => :'String',
|
73
|
+
:'merchant_id' => :'String',
|
74
|
+
:'mime_type' => :'String',
|
75
|
+
:'user_id' => :'Integer',
|
76
|
+
:'version' => :'Integer'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# List of attributes with nullable: true
|
81
|
+
def self.openapi_nullable
|
82
|
+
Set.new([
|
83
|
+
])
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
if (!attributes.is_a?(Hash))
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxAudio` initialize method"
|
91
|
+
end
|
92
|
+
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
95
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxAudio`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
97
|
+
end
|
98
|
+
h[k.to_sym] = v
|
99
|
+
}
|
100
|
+
|
101
|
+
if attributes.key?(:'audio_s3_listing_key')
|
102
|
+
self.audio_s3_listing_key = attributes[:'audio_s3_listing_key']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'conversation_pbx_audio_uuid')
|
106
|
+
self.conversation_pbx_audio_uuid = attributes[:'conversation_pbx_audio_uuid']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'default_hold_music')
|
110
|
+
self.default_hold_music = attributes[:'default_hold_music']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'description')
|
114
|
+
self.description = attributes[:'description']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'filename')
|
118
|
+
self.filename = attributes[:'filename']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'merchant_id')
|
122
|
+
self.merchant_id = attributes[:'merchant_id']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'mime_type')
|
126
|
+
self.mime_type = attributes[:'mime_type']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'user_id')
|
130
|
+
self.user_id = attributes[:'user_id']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'version')
|
134
|
+
self.version = attributes[:'version']
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
139
|
+
# @return Array for valid properties with the reasons
|
140
|
+
def list_invalid_properties
|
141
|
+
invalid_properties = Array.new
|
142
|
+
if !@audio_s3_listing_key.nil? && @audio_s3_listing_key.to_s.length > 250
|
143
|
+
invalid_properties.push('invalid value for "audio_s3_listing_key", the character length must be smaller than or equal to 250.')
|
144
|
+
end
|
145
|
+
|
146
|
+
if !@conversation_pbx_audio_uuid.nil? && @conversation_pbx_audio_uuid.to_s.length > 50
|
147
|
+
invalid_properties.push('invalid value for "conversation_pbx_audio_uuid", the character length must be smaller than or equal to 50.')
|
148
|
+
end
|
149
|
+
|
150
|
+
if !@description.nil? && @description.to_s.length > 100
|
151
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 100.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if !@filename.nil? && @filename.to_s.length > 100
|
155
|
+
invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 100.')
|
156
|
+
end
|
157
|
+
|
158
|
+
if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
159
|
+
invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
|
160
|
+
end
|
161
|
+
|
162
|
+
if !@mime_type.nil? && @mime_type.to_s.length > 100
|
163
|
+
invalid_properties.push('invalid value for "mime_type", the character length must be smaller than or equal to 100.')
|
164
|
+
end
|
165
|
+
|
166
|
+
invalid_properties
|
167
|
+
end
|
168
|
+
|
169
|
+
# Check to see if the all the properties in the model are valid
|
170
|
+
# @return true if the model is valid
|
171
|
+
def valid?
|
172
|
+
return false if !@audio_s3_listing_key.nil? && @audio_s3_listing_key.to_s.length > 250
|
173
|
+
return false if !@conversation_pbx_audio_uuid.nil? && @conversation_pbx_audio_uuid.to_s.length > 50
|
174
|
+
return false if !@description.nil? && @description.to_s.length > 100
|
175
|
+
return false if !@filename.nil? && @filename.to_s.length > 100
|
176
|
+
return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
177
|
+
return false if !@mime_type.nil? && @mime_type.to_s.length > 100
|
178
|
+
true
|
179
|
+
end
|
180
|
+
|
181
|
+
# Custom attribute writer method with validation
|
182
|
+
# @param [Object] audio_s3_listing_key Value to be assigned
|
183
|
+
def audio_s3_listing_key=(audio_s3_listing_key)
|
184
|
+
if !audio_s3_listing_key.nil? && audio_s3_listing_key.to_s.length > 250
|
185
|
+
fail ArgumentError, 'invalid value for "audio_s3_listing_key", the character length must be smaller than or equal to 250.'
|
186
|
+
end
|
187
|
+
|
188
|
+
@audio_s3_listing_key = audio_s3_listing_key
|
189
|
+
end
|
190
|
+
|
191
|
+
# Custom attribute writer method with validation
|
192
|
+
# @param [Object] conversation_pbx_audio_uuid Value to be assigned
|
193
|
+
def conversation_pbx_audio_uuid=(conversation_pbx_audio_uuid)
|
194
|
+
if !conversation_pbx_audio_uuid.nil? && conversation_pbx_audio_uuid.to_s.length > 50
|
195
|
+
fail ArgumentError, 'invalid value for "conversation_pbx_audio_uuid", the character length must be smaller than or equal to 50.'
|
196
|
+
end
|
197
|
+
|
198
|
+
@conversation_pbx_audio_uuid = conversation_pbx_audio_uuid
|
199
|
+
end
|
200
|
+
|
201
|
+
# Custom attribute writer method with validation
|
202
|
+
# @param [Object] description Value to be assigned
|
203
|
+
def description=(description)
|
204
|
+
if !description.nil? && description.to_s.length > 100
|
205
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 100.'
|
206
|
+
end
|
207
|
+
|
208
|
+
@description = description
|
209
|
+
end
|
210
|
+
|
211
|
+
# Custom attribute writer method with validation
|
212
|
+
# @param [Object] filename Value to be assigned
|
213
|
+
def filename=(filename)
|
214
|
+
if !filename.nil? && filename.to_s.length > 100
|
215
|
+
fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 100.'
|
216
|
+
end
|
217
|
+
|
218
|
+
@filename = filename
|
219
|
+
end
|
220
|
+
|
221
|
+
# Custom attribute writer method with validation
|
222
|
+
# @param [Object] merchant_id Value to be assigned
|
223
|
+
def merchant_id=(merchant_id)
|
224
|
+
if !merchant_id.nil? && merchant_id.to_s.length > 5
|
225
|
+
fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
|
226
|
+
end
|
227
|
+
|
228
|
+
@merchant_id = merchant_id
|
229
|
+
end
|
230
|
+
|
231
|
+
# Custom attribute writer method with validation
|
232
|
+
# @param [Object] mime_type Value to be assigned
|
233
|
+
def mime_type=(mime_type)
|
234
|
+
if !mime_type.nil? && mime_type.to_s.length > 100
|
235
|
+
fail ArgumentError, 'invalid value for "mime_type", the character length must be smaller than or equal to 100.'
|
236
|
+
end
|
237
|
+
|
238
|
+
@mime_type = mime_type
|
239
|
+
end
|
240
|
+
|
241
|
+
# Checks equality by comparing each attribute.
|
242
|
+
# @param [Object] Object to be compared
|
243
|
+
def ==(o)
|
244
|
+
return true if self.equal?(o)
|
245
|
+
self.class == o.class &&
|
246
|
+
audio_s3_listing_key == o.audio_s3_listing_key &&
|
247
|
+
conversation_pbx_audio_uuid == o.conversation_pbx_audio_uuid &&
|
248
|
+
default_hold_music == o.default_hold_music &&
|
249
|
+
description == o.description &&
|
250
|
+
filename == o.filename &&
|
251
|
+
merchant_id == o.merchant_id &&
|
252
|
+
mime_type == o.mime_type &&
|
253
|
+
user_id == o.user_id &&
|
254
|
+
version == o.version
|
255
|
+
end
|
256
|
+
|
257
|
+
# @see the `==` method
|
258
|
+
# @param [Object] Object to be compared
|
259
|
+
def eql?(o)
|
260
|
+
self == o
|
261
|
+
end
|
262
|
+
|
263
|
+
# Calculates hash code according to all attributes.
|
264
|
+
# @return [Integer] Hash code
|
265
|
+
def hash
|
266
|
+
[audio_s3_listing_key, conversation_pbx_audio_uuid, default_hold_music, description, filename, merchant_id, mime_type, user_id, version].hash
|
267
|
+
end
|
268
|
+
|
269
|
+
# Builds the object from hash
|
270
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
271
|
+
# @return [Object] Returns the model itself
|
272
|
+
def self.build_from_hash(attributes)
|
273
|
+
new.build_from_hash(attributes)
|
274
|
+
end
|
275
|
+
|
276
|
+
# Builds the object from hash
|
277
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
278
|
+
# @return [Object] Returns the model itself
|
279
|
+
def build_from_hash(attributes)
|
280
|
+
return nil unless attributes.is_a?(Hash)
|
281
|
+
attributes = attributes.transform_keys(&:to_sym)
|
282
|
+
self.class.openapi_types.each_pair do |key, type|
|
283
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
284
|
+
self.send("#{key}=", nil)
|
285
|
+
elsif type =~ /\AArray<(.*)>/i
|
286
|
+
# check to ensure the input is an array given that the attribute
|
287
|
+
# is documented as an array but the input is not
|
288
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
289
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
290
|
+
end
|
291
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
292
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
self
|
297
|
+
end
|
298
|
+
|
299
|
+
# Deserializes the data based on type
|
300
|
+
# @param string type Data type
|
301
|
+
# @param string value Value to be deserialized
|
302
|
+
# @return [Object] Deserialized data
|
303
|
+
def _deserialize(type, value)
|
304
|
+
case type.to_sym
|
305
|
+
when :Time
|
306
|
+
Time.parse(value)
|
307
|
+
when :Date
|
308
|
+
Date.parse(value)
|
309
|
+
when :String
|
310
|
+
value.to_s
|
311
|
+
when :Integer
|
312
|
+
value.to_i
|
313
|
+
when :Float
|
314
|
+
value.to_f
|
315
|
+
when :Boolean
|
316
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
317
|
+
true
|
318
|
+
else
|
319
|
+
false
|
320
|
+
end
|
321
|
+
when :Object
|
322
|
+
# generic object (usually a Hash), return directly
|
323
|
+
value
|
324
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
325
|
+
inner_type = Regexp.last_match[:inner_type]
|
326
|
+
value.map { |v| _deserialize(inner_type, v) }
|
327
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
328
|
+
k_type = Regexp.last_match[:k_type]
|
329
|
+
v_type = Regexp.last_match[:v_type]
|
330
|
+
{}.tap do |hash|
|
331
|
+
value.each do |k, v|
|
332
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
333
|
+
end
|
334
|
+
end
|
335
|
+
else # model
|
336
|
+
# models (e.g. Pet) or oneOf
|
337
|
+
klass = UltracartClient.const_get(type)
|
338
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
# Returns the string representation of the object
|
343
|
+
# @return [String] String presentation of the object
|
344
|
+
def to_s
|
345
|
+
to_hash.to_s
|
346
|
+
end
|
347
|
+
|
348
|
+
# to_body is an alias to to_hash (backward compatibility)
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
350
|
+
def to_body
|
351
|
+
to_hash
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the object in the form of hash
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
356
|
+
def to_hash
|
357
|
+
hash = {}
|
358
|
+
self.class.attribute_map.each_pair do |attr, param|
|
359
|
+
value = self.send(attr)
|
360
|
+
if value.nil?
|
361
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
362
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
363
|
+
end
|
364
|
+
|
365
|
+
hash[param] = _to_hash(value)
|
366
|
+
end
|
367
|
+
hash
|
368
|
+
end
|
369
|
+
|
370
|
+
# Outputs non-array value in the form of hash
|
371
|
+
# For object, use to_hash. Otherwise, just return the value
|
372
|
+
# @param [Object] value Any valid value
|
373
|
+
# @return [Hash] Returns the value in the form of hash
|
374
|
+
def _to_hash(value)
|
375
|
+
if value.is_a?(Array)
|
376
|
+
value.compact.map { |v| _to_hash(v) }
|
377
|
+
elsif value.is_a?(Hash)
|
378
|
+
{}.tap do |hash|
|
379
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
380
|
+
end
|
381
|
+
elsif value.respond_to? :to_hash
|
382
|
+
value.to_hash
|
383
|
+
else
|
384
|
+
value
|
385
|
+
end
|
386
|
+
end
|
387
|
+
|
388
|
+
end
|
389
|
+
|
390
|
+
end
|