ultracart_api 3.10.184 → 3.10.186
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +84 -4
- data/docs/ConversationApi.md +2466 -340
- data/docs/ConversationPbxAgent.md +16 -0
- data/docs/ConversationPbxAgentResponse.md +12 -0
- data/docs/ConversationPbxAgentsResponse.md +12 -0
- data/docs/ConversationPbxAudio.md +16 -0
- data/docs/ConversationPbxAudioResponse.md +12 -0
- data/docs/ConversationPbxAudiosResponse.md +12 -0
- data/docs/ConversationPbxCustomerSnapshotRequest.md +15 -0
- data/docs/ConversationPbxCustomerSnapshotResponse.md +14 -0
- data/docs/ConversationPbxMenu.md +17 -0
- data/docs/ConversationPbxMenuMapping.md +11 -0
- data/docs/ConversationPbxMenuResponse.md +12 -0
- data/docs/ConversationPbxMenusResponse.md +12 -0
- data/docs/ConversationPbxPhoneNumber.md +12 -0
- data/docs/ConversationPbxPhoneNumberResponse.md +12 -0
- data/docs/ConversationPbxPhoneNumbersResponse.md +12 -0
- data/docs/ConversationPbxQueue.md +27 -0
- data/docs/ConversationPbxQueueMembers.md +9 -0
- data/docs/ConversationPbxQueueResponse.md +12 -0
- data/docs/ConversationPbxQueuesResponse.md +12 -0
- data/docs/ConversationPbxTimeBased.md +11 -0
- data/docs/ConversationPbxTimeBasedMapping.md +11 -0
- data/docs/ConversationPbxTimeBasedMappingConfig.md +9 -0
- data/docs/ConversationPbxTimeBasedResponse.md +12 -0
- data/docs/ConversationPbxTimeBasedsResponse.md +12 -0
- data/docs/ConversationPbxTimeRange.md +12 -0
- data/docs/ConversationPbxTimeRangeConfig.md +13 -0
- data/docs/ConversationPbxTimeRangeResponse.md +12 -0
- data/docs/ConversationPbxTimeRangesResponse.md +12 -0
- data/docs/ConversationPbxVoicemailMailbox.md +18 -0
- data/docs/ConversationPbxVoicemailMailboxResponse.md +12 -0
- data/docs/ConversationPbxVoicemailMailboxesResponse.md +12 -0
- data/docs/WorkflowAgentAuth.md +10 -0
- data/docs/WorkflowAgentAuthResponse.md +12 -0
- data/docs/WorkflowApi.md +92 -0
- data/docs/WorkflowTaskTagsResponse.md +12 -0
- data/lib/ultracart_api/api/conversation_api.rb +2919 -609
- data/lib/ultracart_api/api/workflow_api.rb +98 -0
- data/lib/ultracart_api/models/conversation_pbx_agent.rb +325 -0
- data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_audio.rb +355 -0
- data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +248 -0
- data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +243 -0
- data/lib/ultracart_api/models/conversation_pbx_menu.rb +367 -0
- data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +215 -0
- data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +300 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_queue.rb +524 -0
- data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +197 -0
- data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based.rb +211 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +275 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +196 -0
- data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range.rb +287 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +235 -0
- data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +405 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +223 -0
- data/lib/ultracart_api/models/workflow_agent_auth.rb +202 -0
- data/lib/ultracart_api/models/workflow_agent_auth_response.rb +221 -0
- data/lib/ultracart_api/models/workflow_task_tags_response.rb +224 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +34 -0
- metadata +70 -2
@@ -0,0 +1,211 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class ConversationPbxTimeBased
|
17
|
+
attr_accessor :conversation_pbx_time_based_uuid
|
18
|
+
|
19
|
+
attr_accessor :mapping_config
|
20
|
+
|
21
|
+
attr_accessor :merchant_id
|
22
|
+
|
23
|
+
attr_accessor :time_based_name
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'conversation_pbx_time_based_uuid' => :'conversationPbxTimeBasedUuid',
|
29
|
+
:'mapping_config' => :'mappingConfig',
|
30
|
+
:'merchant_id' => :'merchantId',
|
31
|
+
:'time_based_name' => :'timeBasedName'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.swagger_types
|
37
|
+
{
|
38
|
+
:'conversation_pbx_time_based_uuid' => :'String',
|
39
|
+
:'mapping_config' => :'ConversationPbxTimeBasedMappingConfig',
|
40
|
+
:'merchant_id' => :'String',
|
41
|
+
:'time_based_name' => :'String'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
52
|
+
|
53
|
+
if attributes.has_key?(:'conversationPbxTimeBasedUuid')
|
54
|
+
self.conversation_pbx_time_based_uuid = attributes[:'conversationPbxTimeBasedUuid']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'mappingConfig')
|
58
|
+
self.mapping_config = attributes[:'mappingConfig']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'merchantId')
|
62
|
+
self.merchant_id = attributes[:'merchantId']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'timeBasedName')
|
66
|
+
self.time_based_name = attributes[:'timeBasedName']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
conversation_pbx_time_based_uuid == o.conversation_pbx_time_based_uuid &&
|
89
|
+
mapping_config == o.mapping_config &&
|
90
|
+
merchant_id == o.merchant_id &&
|
91
|
+
time_based_name == o.time_based_name
|
92
|
+
end
|
93
|
+
|
94
|
+
# @see the `==` method
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def eql?(o)
|
97
|
+
self == o
|
98
|
+
end
|
99
|
+
|
100
|
+
# Calculates hash code according to all attributes.
|
101
|
+
# @return [Fixnum] Hash code
|
102
|
+
def hash
|
103
|
+
[conversation_pbx_time_based_uuid, mapping_config, merchant_id, time_based_name].hash
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.swagger_types.each_pair do |key, type|
|
112
|
+
if type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Deserializes the data based on type
|
127
|
+
# @param string type Data type
|
128
|
+
# @param string value Value to be deserialized
|
129
|
+
# @return [Object] Deserialized data
|
130
|
+
def _deserialize(type, value)
|
131
|
+
case type.to_sym
|
132
|
+
when :DateTime
|
133
|
+
DateTime.parse(value)
|
134
|
+
when :Date
|
135
|
+
Date.parse(value)
|
136
|
+
when :String
|
137
|
+
value.to_s
|
138
|
+
when :Integer
|
139
|
+
value.to_i
|
140
|
+
when :Float
|
141
|
+
value.to_f
|
142
|
+
when :BOOLEAN
|
143
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
144
|
+
true
|
145
|
+
else
|
146
|
+
false
|
147
|
+
end
|
148
|
+
when :Object
|
149
|
+
# generic object (usually a Hash), return directly
|
150
|
+
value
|
151
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
152
|
+
inner_type = Regexp.last_match[:inner_type]
|
153
|
+
value.map { |v| _deserialize(inner_type, v) }
|
154
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
155
|
+
k_type = Regexp.last_match[:k_type]
|
156
|
+
v_type = Regexp.last_match[:v_type]
|
157
|
+
{}.tap do |hash|
|
158
|
+
value.each do |k, v|
|
159
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
else # model
|
163
|
+
temp_model = UltracartClient.const_get(type).new
|
164
|
+
temp_model.build_from_hash(value)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the string representation of the object
|
169
|
+
# @return [String] String presentation of the object
|
170
|
+
def to_s
|
171
|
+
to_hash.to_s
|
172
|
+
end
|
173
|
+
|
174
|
+
# to_body is an alias to to_hash (backward compatibility)
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_body
|
177
|
+
to_hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the object in the form of hash
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_hash
|
183
|
+
hash = {}
|
184
|
+
self.class.attribute_map.each_pair do |attr, param|
|
185
|
+
value = self.send(attr)
|
186
|
+
next if value.nil?
|
187
|
+
hash[param] = _to_hash(value)
|
188
|
+
end
|
189
|
+
hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Outputs non-array value in the form of hash
|
193
|
+
# For object, use to_hash. Otherwise, just return the value
|
194
|
+
# @param [Object] value Any valid value
|
195
|
+
# @return [Hash] Returns the value in the form of hash
|
196
|
+
def _to_hash(value)
|
197
|
+
if value.is_a?(Array)
|
198
|
+
value.compact.map { |v| _to_hash(v) }
|
199
|
+
elsif value.is_a?(Hash)
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
202
|
+
end
|
203
|
+
elsif value.respond_to? :to_hash
|
204
|
+
value.to_hash
|
205
|
+
else
|
206
|
+
value
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|
211
|
+
end
|
@@ -0,0 +1,275 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class ConversationPbxTimeBasedMapping
|
17
|
+
# Action
|
18
|
+
attr_accessor :action
|
19
|
+
|
20
|
+
# Action target
|
21
|
+
attr_accessor :action_target
|
22
|
+
|
23
|
+
# Name
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
# Time range UUID
|
27
|
+
attr_accessor :time_range_uuid
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'action' => :'action',
|
33
|
+
:'action_target' => :'action_target',
|
34
|
+
:'name' => :'name',
|
35
|
+
:'time_range_uuid' => :'time_range_uuid'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'action' => :'String',
|
43
|
+
:'action_target' => :'String',
|
44
|
+
:'name' => :'String',
|
45
|
+
:'time_range_uuid' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
+
|
57
|
+
if attributes.has_key?(:'action')
|
58
|
+
self.action = attributes[:'action']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'action_target')
|
62
|
+
self.action_target = attributes[:'action_target']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'name')
|
66
|
+
self.name = attributes[:'name']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'time_range_uuid')
|
70
|
+
self.time_range_uuid = attributes[:'time_range_uuid']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
if !@action.nil? && @action.to_s.length > 30
|
79
|
+
invalid_properties.push('invalid value for "action", the character length must be smaller than or equal to 30.')
|
80
|
+
end
|
81
|
+
|
82
|
+
if !@action_target.nil? && @action_target.to_s.length > 50
|
83
|
+
invalid_properties.push('invalid value for "action_target", the character length must be smaller than or equal to 50.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if !@name.nil? && @name.to_s.length > 50
|
87
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if !@time_range_uuid.nil? && @time_range_uuid.to_s.length > 50
|
91
|
+
invalid_properties.push('invalid value for "time_range_uuid", the character length must be smaller than or equal to 50.')
|
92
|
+
end
|
93
|
+
|
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
|
+
return false if !@action.nil? && @action.to_s.length > 30
|
101
|
+
return false if !@action_target.nil? && @action_target.to_s.length > 50
|
102
|
+
return false if !@name.nil? && @name.to_s.length > 50
|
103
|
+
return false if !@time_range_uuid.nil? && @time_range_uuid.to_s.length > 50
|
104
|
+
true
|
105
|
+
end
|
106
|
+
|
107
|
+
# Custom attribute writer method with validation
|
108
|
+
# @param [Object] action Value to be assigned
|
109
|
+
def action=(action)
|
110
|
+
if !action.nil? && action.to_s.length > 30
|
111
|
+
fail ArgumentError, 'invalid value for "action", the character length must be smaller than or equal to 30.'
|
112
|
+
end
|
113
|
+
|
114
|
+
@action = action
|
115
|
+
end
|
116
|
+
|
117
|
+
# Custom attribute writer method with validation
|
118
|
+
# @param [Object] action_target Value to be assigned
|
119
|
+
def action_target=(action_target)
|
120
|
+
if !action_target.nil? && action_target.to_s.length > 50
|
121
|
+
fail ArgumentError, 'invalid value for "action_target", the character length must be smaller than or equal to 50.'
|
122
|
+
end
|
123
|
+
|
124
|
+
@action_target = action_target
|
125
|
+
end
|
126
|
+
|
127
|
+
# Custom attribute writer method with validation
|
128
|
+
# @param [Object] name Value to be assigned
|
129
|
+
def name=(name)
|
130
|
+
if !name.nil? && name.to_s.length > 50
|
131
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
|
132
|
+
end
|
133
|
+
|
134
|
+
@name = name
|
135
|
+
end
|
136
|
+
|
137
|
+
# Custom attribute writer method with validation
|
138
|
+
# @param [Object] time_range_uuid Value to be assigned
|
139
|
+
def time_range_uuid=(time_range_uuid)
|
140
|
+
if !time_range_uuid.nil? && time_range_uuid.to_s.length > 50
|
141
|
+
fail ArgumentError, 'invalid value for "time_range_uuid", the character length must be smaller than or equal to 50.'
|
142
|
+
end
|
143
|
+
|
144
|
+
@time_range_uuid = time_range_uuid
|
145
|
+
end
|
146
|
+
|
147
|
+
# Checks equality by comparing each attribute.
|
148
|
+
# @param [Object] Object to be compared
|
149
|
+
def ==(o)
|
150
|
+
return true if self.equal?(o)
|
151
|
+
self.class == o.class &&
|
152
|
+
action == o.action &&
|
153
|
+
action_target == o.action_target &&
|
154
|
+
name == o.name &&
|
155
|
+
time_range_uuid == o.time_range_uuid
|
156
|
+
end
|
157
|
+
|
158
|
+
# @see the `==` method
|
159
|
+
# @param [Object] Object to be compared
|
160
|
+
def eql?(o)
|
161
|
+
self == o
|
162
|
+
end
|
163
|
+
|
164
|
+
# Calculates hash code according to all attributes.
|
165
|
+
# @return [Fixnum] Hash code
|
166
|
+
def hash
|
167
|
+
[action, action_target, name, time_range_uuid].hash
|
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
|
+
self.class.swagger_types.each_pair do |key, type|
|
176
|
+
if type =~ /\AArray<(.*)>/i
|
177
|
+
# check to ensure the input is an array given that the attribute
|
178
|
+
# is documented as an array but the input is not
|
179
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
180
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
181
|
+
end
|
182
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
183
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
184
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
185
|
+
end
|
186
|
+
|
187
|
+
self
|
188
|
+
end
|
189
|
+
|
190
|
+
# Deserializes the data based on type
|
191
|
+
# @param string type Data type
|
192
|
+
# @param string value Value to be deserialized
|
193
|
+
# @return [Object] Deserialized data
|
194
|
+
def _deserialize(type, value)
|
195
|
+
case type.to_sym
|
196
|
+
when :DateTime
|
197
|
+
DateTime.parse(value)
|
198
|
+
when :Date
|
199
|
+
Date.parse(value)
|
200
|
+
when :String
|
201
|
+
value.to_s
|
202
|
+
when :Integer
|
203
|
+
value.to_i
|
204
|
+
when :Float
|
205
|
+
value.to_f
|
206
|
+
when :BOOLEAN
|
207
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
208
|
+
true
|
209
|
+
else
|
210
|
+
false
|
211
|
+
end
|
212
|
+
when :Object
|
213
|
+
# generic object (usually a Hash), return directly
|
214
|
+
value
|
215
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
216
|
+
inner_type = Regexp.last_match[:inner_type]
|
217
|
+
value.map { |v| _deserialize(inner_type, v) }
|
218
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
219
|
+
k_type = Regexp.last_match[:k_type]
|
220
|
+
v_type = Regexp.last_match[:v_type]
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each do |k, v|
|
223
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
else # model
|
227
|
+
temp_model = UltracartClient.const_get(type).new
|
228
|
+
temp_model.build_from_hash(value)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the string representation of the object
|
233
|
+
# @return [String] String presentation of the object
|
234
|
+
def to_s
|
235
|
+
to_hash.to_s
|
236
|
+
end
|
237
|
+
|
238
|
+
# to_body is an alias to to_hash (backward compatibility)
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_body
|
241
|
+
to_hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the object in the form of hash
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_hash
|
247
|
+
hash = {}
|
248
|
+
self.class.attribute_map.each_pair do |attr, param|
|
249
|
+
value = self.send(attr)
|
250
|
+
next if value.nil?
|
251
|
+
hash[param] = _to_hash(value)
|
252
|
+
end
|
253
|
+
hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Outputs non-array value in the form of hash
|
257
|
+
# For object, use to_hash. Otherwise, just return the value
|
258
|
+
# @param [Object] value Any valid value
|
259
|
+
# @return [Hash] Returns the value in the form of hash
|
260
|
+
def _to_hash(value)
|
261
|
+
if value.is_a?(Array)
|
262
|
+
value.compact.map { |v| _to_hash(v) }
|
263
|
+
elsif value.is_a?(Hash)
|
264
|
+
{}.tap do |hash|
|
265
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
266
|
+
end
|
267
|
+
elsif value.respond_to? :to_hash
|
268
|
+
value.to_hash
|
269
|
+
else
|
270
|
+
value
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
end
|
275
|
+
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class ConversationPbxTimeBasedMappingConfig
|
17
|
+
attr_accessor :default
|
18
|
+
|
19
|
+
# Mappings
|
20
|
+
attr_accessor :mappings
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'default' => :'default',
|
26
|
+
:'mappings' => :'mappings'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.swagger_types
|
32
|
+
{
|
33
|
+
:'default' => :'ConversationPbxTimeBasedMapping',
|
34
|
+
:'mappings' => :'Array<ConversationPbxTimeBasedMapping>'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
return unless attributes.is_a?(Hash)
|
42
|
+
|
43
|
+
# convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
45
|
+
|
46
|
+
if attributes.has_key?(:'default')
|
47
|
+
self.default = attributes[:'default']
|
48
|
+
end
|
49
|
+
|
50
|
+
if attributes.has_key?(:'mappings')
|
51
|
+
if (value = attributes[:'mappings']).is_a?(Array)
|
52
|
+
self.mappings = value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
default == o.default &&
|
76
|
+
mappings == o.mappings
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[default, mappings].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def build_from_hash(attributes)
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
98
|
+
# check to ensure the input is an array given that the attribute
|
99
|
+
# is documented as an array but the input is not
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
102
|
+
end
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
106
|
+
end
|
107
|
+
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def _deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :DateTime
|
118
|
+
DateTime.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :BOOLEAN
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
# generic object (usually a Hash), return directly
|
135
|
+
value
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each do |k, v|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
else # model
|
148
|
+
temp_model = UltracartClient.const_get(type).new
|
149
|
+
temp_model.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the object in the form of hash
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_hash
|
168
|
+
hash = {}
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
170
|
+
value = self.send(attr)
|
171
|
+
next if value.nil?
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|