ultracart_api 3.11.39 → 3.11.41
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 +21 -4
- data/docs/ConversationAgentProfile.md +2 -0
- data/docs/ConversationApi.md +470 -0
- data/docs/ConversationPbxAddress.md +19 -0
- data/docs/ConversationPbxAddressResponse.md +12 -0
- data/docs/ConversationPbxAddressesResponse.md +8 -0
- data/docs/ConversationPbxAvailablePhoneNumber.md +16 -0
- data/docs/ConversationPbxAvailablePhoneNumbersResponse.md +12 -0
- data/docs/ConversationPbxPhoneNumber.md +1 -0
- data/docs/ConversationPbxPhoneNumberPurchaseRequest.md +12 -0
- data/lib/ultracart_api/api/conversation_api.rb +513 -0
- data/lib/ultracart_api/models/conversation_agent_profile.rb +33 -1
- data/lib/ultracart_api/models/conversation_pbx_address.rb +445 -0
- data/lib/ultracart_api/models/conversation_pbx_address_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_addresses_response.rb +186 -0
- data/lib/ultracart_api/models/conversation_pbx_available_phone_number.rb +374 -0
- data/lib/ultracart_api/models/conversation_pbx_available_phone_numbers_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +11 -1
- data/lib/ultracart_api/models/conversation_pbx_phone_number_purchase_request.rb +324 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +6 -0
- metadata +14 -2
|
@@ -0,0 +1,223 @@
|
|
|
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 ConversationPbxAvailablePhoneNumbersResponse
|
|
17
|
+
attr_accessor :available_phone_numbers
|
|
18
|
+
|
|
19
|
+
attr_accessor :error
|
|
20
|
+
|
|
21
|
+
attr_accessor :metadata
|
|
22
|
+
|
|
23
|
+
# Indicates if API call was successful
|
|
24
|
+
attr_accessor :success
|
|
25
|
+
|
|
26
|
+
attr_accessor :warning
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'available_phone_numbers' => :'available_phone_numbers',
|
|
32
|
+
:'error' => :'error',
|
|
33
|
+
:'metadata' => :'metadata',
|
|
34
|
+
:'success' => :'success',
|
|
35
|
+
:'warning' => :'warning'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.swagger_types
|
|
41
|
+
{
|
|
42
|
+
:'available_phone_numbers' => :'Array<ConversationPbxAvailablePhoneNumber>',
|
|
43
|
+
:'error' => :'Error',
|
|
44
|
+
:'metadata' => :'ResponseMetadata',
|
|
45
|
+
:'success' => :'BOOLEAN',
|
|
46
|
+
:'warning' => :'Warning'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
return unless attributes.is_a?(Hash)
|
|
54
|
+
|
|
55
|
+
# convert string to symbol for hash key
|
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
57
|
+
|
|
58
|
+
if attributes.has_key?(:'available_phone_numbers')
|
|
59
|
+
if (value = attributes[:'available_phone_numbers']).is_a?(Array)
|
|
60
|
+
self.available_phone_numbers = value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
if attributes.has_key?(:'error')
|
|
65
|
+
self.error = attributes[:'error']
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
if attributes.has_key?(:'metadata')
|
|
69
|
+
self.metadata = attributes[:'metadata']
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.has_key?(:'success')
|
|
73
|
+
self.success = attributes[:'success']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'warning')
|
|
77
|
+
self.warning = attributes[:'warning']
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
82
|
+
# @return Array for valid properties with the reasons
|
|
83
|
+
def list_invalid_properties
|
|
84
|
+
invalid_properties = Array.new
|
|
85
|
+
invalid_properties
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check to see if the all the properties in the model are valid
|
|
89
|
+
# @return true if the model is valid
|
|
90
|
+
def valid?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
available_phone_numbers == o.available_phone_numbers &&
|
|
100
|
+
error == o.error &&
|
|
101
|
+
metadata == o.metadata &&
|
|
102
|
+
success == o.success &&
|
|
103
|
+
warning == o.warning
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Fixnum] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[available_phone_numbers, error, metadata, success, warning].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
124
|
+
if type =~ /\AArray<(.*)>/i
|
|
125
|
+
# check to ensure the input is an array given that the attribute
|
|
126
|
+
# is documented as an array but the input is not
|
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
129
|
+
end
|
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
132
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
self
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Deserializes the data based on type
|
|
139
|
+
# @param string type Data type
|
|
140
|
+
# @param string value Value to be deserialized
|
|
141
|
+
# @return [Object] Deserialized data
|
|
142
|
+
def _deserialize(type, value)
|
|
143
|
+
case type.to_sym
|
|
144
|
+
when :DateTime
|
|
145
|
+
DateTime.parse(value)
|
|
146
|
+
when :Date
|
|
147
|
+
Date.parse(value)
|
|
148
|
+
when :String
|
|
149
|
+
value.to_s
|
|
150
|
+
when :Integer
|
|
151
|
+
value.to_i
|
|
152
|
+
when :Float
|
|
153
|
+
value.to_f
|
|
154
|
+
when :BOOLEAN
|
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
156
|
+
true
|
|
157
|
+
else
|
|
158
|
+
false
|
|
159
|
+
end
|
|
160
|
+
when :Object
|
|
161
|
+
# generic object (usually a Hash), return directly
|
|
162
|
+
value
|
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
|
169
|
+
{}.tap do |hash|
|
|
170
|
+
value.each do |k, v|
|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
else # model
|
|
175
|
+
temp_model = UltracartClient.const_get(type).new
|
|
176
|
+
temp_model.build_from_hash(value)
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Returns the string representation of the object
|
|
181
|
+
# @return [String] String presentation of the object
|
|
182
|
+
def to_s
|
|
183
|
+
to_hash.to_s
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
|
188
|
+
def to_body
|
|
189
|
+
to_hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the object in the form of hash
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_hash
|
|
195
|
+
hash = {}
|
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
+
value = self.send(attr)
|
|
198
|
+
next if value.nil?
|
|
199
|
+
hash[param] = _to_hash(value)
|
|
200
|
+
end
|
|
201
|
+
hash
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Outputs non-array value in the form of hash
|
|
205
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
206
|
+
# @param [Object] value Any valid value
|
|
207
|
+
# @return [Hash] Returns the value in the form of hash
|
|
208
|
+
def _to_hash(value)
|
|
209
|
+
if value.is_a?(Array)
|
|
210
|
+
value.compact.map { |v| _to_hash(v) }
|
|
211
|
+
elsif value.is_a?(Hash)
|
|
212
|
+
{}.tap do |hash|
|
|
213
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
214
|
+
end
|
|
215
|
+
elsif value.respond_to? :to_hash
|
|
216
|
+
value.to_hash
|
|
217
|
+
else
|
|
218
|
+
value
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -23,6 +23,9 @@ module UltracartClient
|
|
|
23
23
|
# Conversation Pbx Phone Number UUID
|
|
24
24
|
attr_accessor :conversation_pbx_phone_number_uuid
|
|
25
25
|
|
|
26
|
+
# If true, this phone number cannot be deleted through the API. It must be deleted via the Twilio console.
|
|
27
|
+
attr_accessor :deletion_protected
|
|
28
|
+
|
|
26
29
|
# Merchant Id
|
|
27
30
|
attr_accessor :merchant_id
|
|
28
31
|
|
|
@@ -57,6 +60,7 @@ module UltracartClient
|
|
|
57
60
|
:'action' => :'action',
|
|
58
61
|
:'action_target' => :'action_target',
|
|
59
62
|
:'conversation_pbx_phone_number_uuid' => :'conversation_pbx_phone_number_uuid',
|
|
63
|
+
:'deletion_protected' => :'deletion_protected',
|
|
60
64
|
:'merchant_id' => :'merchant_id',
|
|
61
65
|
:'phone_number' => :'phone_number'
|
|
62
66
|
}
|
|
@@ -68,6 +72,7 @@ module UltracartClient
|
|
|
68
72
|
:'action' => :'String',
|
|
69
73
|
:'action_target' => :'String',
|
|
70
74
|
:'conversation_pbx_phone_number_uuid' => :'String',
|
|
75
|
+
:'deletion_protected' => :'BOOLEAN',
|
|
71
76
|
:'merchant_id' => :'String',
|
|
72
77
|
:'phone_number' => :'String'
|
|
73
78
|
}
|
|
@@ -93,6 +98,10 @@ module UltracartClient
|
|
|
93
98
|
self.conversation_pbx_phone_number_uuid = attributes[:'conversation_pbx_phone_number_uuid']
|
|
94
99
|
end
|
|
95
100
|
|
|
101
|
+
if attributes.has_key?(:'deletion_protected')
|
|
102
|
+
self.deletion_protected = attributes[:'deletion_protected']
|
|
103
|
+
end
|
|
104
|
+
|
|
96
105
|
if attributes.has_key?(:'merchant_id')
|
|
97
106
|
self.merchant_id = attributes[:'merchant_id']
|
|
98
107
|
end
|
|
@@ -200,6 +209,7 @@ module UltracartClient
|
|
|
200
209
|
action == o.action &&
|
|
201
210
|
action_target == o.action_target &&
|
|
202
211
|
conversation_pbx_phone_number_uuid == o.conversation_pbx_phone_number_uuid &&
|
|
212
|
+
deletion_protected == o.deletion_protected &&
|
|
203
213
|
merchant_id == o.merchant_id &&
|
|
204
214
|
phone_number == o.phone_number
|
|
205
215
|
end
|
|
@@ -213,7 +223,7 @@ module UltracartClient
|
|
|
213
223
|
# Calculates hash code according to all attributes.
|
|
214
224
|
# @return [Fixnum] Hash code
|
|
215
225
|
def hash
|
|
216
|
-
[action, action_target, conversation_pbx_phone_number_uuid, merchant_id, phone_number].hash
|
|
226
|
+
[action, action_target, conversation_pbx_phone_number_uuid, deletion_protected, merchant_id, phone_number].hash
|
|
217
227
|
end
|
|
218
228
|
|
|
219
229
|
# Builds the object from hash
|
|
@@ -0,0 +1,324 @@
|
|
|
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 ConversationPbxPhoneNumberPurchaseRequest
|
|
17
|
+
# Initial action for incoming calls
|
|
18
|
+
attr_accessor :action
|
|
19
|
+
|
|
20
|
+
# Initial action target UUID
|
|
21
|
+
attr_accessor :action_target
|
|
22
|
+
|
|
23
|
+
# Address SID if required for regulatory compliance
|
|
24
|
+
attr_accessor :address_sid
|
|
25
|
+
|
|
26
|
+
# Friendly name for the phone number
|
|
27
|
+
attr_accessor :friendly_name
|
|
28
|
+
|
|
29
|
+
# Phone number to purchase in E.164 format (from search results)
|
|
30
|
+
attr_accessor :phone_number
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'action' => :'action',
|
|
58
|
+
:'action_target' => :'action_target',
|
|
59
|
+
:'address_sid' => :'address_sid',
|
|
60
|
+
:'friendly_name' => :'friendly_name',
|
|
61
|
+
:'phone_number' => :'phone_number'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.swagger_types
|
|
67
|
+
{
|
|
68
|
+
:'action' => :'String',
|
|
69
|
+
:'action_target' => :'String',
|
|
70
|
+
:'address_sid' => :'String',
|
|
71
|
+
:'friendly_name' => :'String',
|
|
72
|
+
:'phone_number' => :'String'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
return unless attributes.is_a?(Hash)
|
|
80
|
+
|
|
81
|
+
# convert string to symbol for hash key
|
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'action')
|
|
85
|
+
self.action = attributes[:'action']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'action_target')
|
|
89
|
+
self.action_target = attributes[:'action_target']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.has_key?(:'address_sid')
|
|
93
|
+
self.address_sid = attributes[:'address_sid']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.has_key?(:'friendly_name')
|
|
97
|
+
self.friendly_name = attributes[:'friendly_name']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.has_key?(:'phone_number')
|
|
101
|
+
self.phone_number = attributes[:'phone_number']
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
106
|
+
# @return Array for valid properties with the reasons
|
|
107
|
+
def list_invalid_properties
|
|
108
|
+
invalid_properties = Array.new
|
|
109
|
+
if !@action.nil? && @action.to_s.length > 30
|
|
110
|
+
invalid_properties.push('invalid value for "action", the character length must be smaller than or equal to 30.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if !@action_target.nil? && @action_target.to_s.length > 50
|
|
114
|
+
invalid_properties.push('invalid value for "action_target", the character length must be smaller than or equal to 50.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if !@address_sid.nil? && @address_sid.to_s.length > 50
|
|
118
|
+
invalid_properties.push('invalid value for "address_sid", the character length must be smaller than or equal to 50.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if !@friendly_name.nil? && @friendly_name.to_s.length > 64
|
|
122
|
+
invalid_properties.push('invalid value for "friendly_name", the character length must be smaller than or equal to 64.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if !@phone_number.nil? && @phone_number.to_s.length > 50
|
|
126
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 50.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
action_validator = EnumAttributeValidator.new('String', ['time based', 'menu', 'queue', 'voicemail', 'agent'])
|
|
136
|
+
return false unless action_validator.valid?(@action)
|
|
137
|
+
return false if !@action.nil? && @action.to_s.length > 30
|
|
138
|
+
return false if !@action_target.nil? && @action_target.to_s.length > 50
|
|
139
|
+
return false if !@address_sid.nil? && @address_sid.to_s.length > 50
|
|
140
|
+
return false if !@friendly_name.nil? && @friendly_name.to_s.length > 64
|
|
141
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length > 50
|
|
142
|
+
true
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
146
|
+
# @param [Object] action Object to be assigned
|
|
147
|
+
def action=(action)
|
|
148
|
+
validator = EnumAttributeValidator.new('String', ['time based', 'menu', 'queue', 'voicemail', 'agent'])
|
|
149
|
+
unless validator.valid?(action)
|
|
150
|
+
fail ArgumentError, 'invalid value for "action", must be one of #{validator.allowable_values}.'
|
|
151
|
+
end
|
|
152
|
+
@action = action
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] action_target Value to be assigned
|
|
157
|
+
def action_target=(action_target)
|
|
158
|
+
if !action_target.nil? && action_target.to_s.length > 50
|
|
159
|
+
fail ArgumentError, 'invalid value for "action_target", the character length must be smaller than or equal to 50.'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@action_target = action_target
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Custom attribute writer method with validation
|
|
166
|
+
# @param [Object] address_sid Value to be assigned
|
|
167
|
+
def address_sid=(address_sid)
|
|
168
|
+
if !address_sid.nil? && address_sid.to_s.length > 50
|
|
169
|
+
fail ArgumentError, 'invalid value for "address_sid", the character length must be smaller than or equal to 50.'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
@address_sid = address_sid
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Custom attribute writer method with validation
|
|
176
|
+
# @param [Object] friendly_name Value to be assigned
|
|
177
|
+
def friendly_name=(friendly_name)
|
|
178
|
+
if !friendly_name.nil? && friendly_name.to_s.length > 64
|
|
179
|
+
fail ArgumentError, 'invalid value for "friendly_name", the character length must be smaller than or equal to 64.'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@friendly_name = friendly_name
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] phone_number Value to be assigned
|
|
187
|
+
def phone_number=(phone_number)
|
|
188
|
+
if !phone_number.nil? && phone_number.to_s.length > 50
|
|
189
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 50.'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@phone_number = phone_number
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Checks equality by comparing each attribute.
|
|
196
|
+
# @param [Object] Object to be compared
|
|
197
|
+
def ==(o)
|
|
198
|
+
return true if self.equal?(o)
|
|
199
|
+
self.class == o.class &&
|
|
200
|
+
action == o.action &&
|
|
201
|
+
action_target == o.action_target &&
|
|
202
|
+
address_sid == o.address_sid &&
|
|
203
|
+
friendly_name == o.friendly_name &&
|
|
204
|
+
phone_number == o.phone_number
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# @see the `==` method
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def eql?(o)
|
|
210
|
+
self == o
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Calculates hash code according to all attributes.
|
|
214
|
+
# @return [Fixnum] Hash code
|
|
215
|
+
def hash
|
|
216
|
+
[action, action_target, address_sid, friendly_name, phone_number].hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Builds the object from hash
|
|
220
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
221
|
+
# @return [Object] Returns the model itself
|
|
222
|
+
def build_from_hash(attributes)
|
|
223
|
+
return nil unless attributes.is_a?(Hash)
|
|
224
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
225
|
+
if type =~ /\AArray<(.*)>/i
|
|
226
|
+
# check to ensure the input is an array given that the attribute
|
|
227
|
+
# is documented as an array but the input is not
|
|
228
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
229
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
230
|
+
end
|
|
231
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
232
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
233
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
self
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Deserializes the data based on type
|
|
240
|
+
# @param string type Data type
|
|
241
|
+
# @param string value Value to be deserialized
|
|
242
|
+
# @return [Object] Deserialized data
|
|
243
|
+
def _deserialize(type, value)
|
|
244
|
+
case type.to_sym
|
|
245
|
+
when :DateTime
|
|
246
|
+
DateTime.parse(value)
|
|
247
|
+
when :Date
|
|
248
|
+
Date.parse(value)
|
|
249
|
+
when :String
|
|
250
|
+
value.to_s
|
|
251
|
+
when :Integer
|
|
252
|
+
value.to_i
|
|
253
|
+
when :Float
|
|
254
|
+
value.to_f
|
|
255
|
+
when :BOOLEAN
|
|
256
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
257
|
+
true
|
|
258
|
+
else
|
|
259
|
+
false
|
|
260
|
+
end
|
|
261
|
+
when :Object
|
|
262
|
+
# generic object (usually a Hash), return directly
|
|
263
|
+
value
|
|
264
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
265
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
266
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
267
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
268
|
+
k_type = Regexp.last_match[:k_type]
|
|
269
|
+
v_type = Regexp.last_match[:v_type]
|
|
270
|
+
{}.tap do |hash|
|
|
271
|
+
value.each do |k, v|
|
|
272
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
else # model
|
|
276
|
+
temp_model = UltracartClient.const_get(type).new
|
|
277
|
+
temp_model.build_from_hash(value)
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Returns the string representation of the object
|
|
282
|
+
# @return [String] String presentation of the object
|
|
283
|
+
def to_s
|
|
284
|
+
to_hash.to_s
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
|
289
|
+
def to_body
|
|
290
|
+
to_hash
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Returns the object in the form of hash
|
|
294
|
+
# @return [Hash] Returns the object in the form of hash
|
|
295
|
+
def to_hash
|
|
296
|
+
hash = {}
|
|
297
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
298
|
+
value = self.send(attr)
|
|
299
|
+
next if value.nil?
|
|
300
|
+
hash[param] = _to_hash(value)
|
|
301
|
+
end
|
|
302
|
+
hash
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Outputs non-array value in the form of hash
|
|
306
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
307
|
+
# @param [Object] value Any valid value
|
|
308
|
+
# @return [Hash] Returns the value in the form of hash
|
|
309
|
+
def _to_hash(value)
|
|
310
|
+
if value.is_a?(Array)
|
|
311
|
+
value.compact.map { |v| _to_hash(v) }
|
|
312
|
+
elsif value.is_a?(Hash)
|
|
313
|
+
{}.tap do |hash|
|
|
314
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
315
|
+
end
|
|
316
|
+
elsif value.respond_to? :to_hash
|
|
317
|
+
value.to_hash
|
|
318
|
+
else
|
|
319
|
+
value
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
end
|
|
324
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -198,6 +198,9 @@ require 'ultracart_api/models/conversation_messages_response'
|
|
|
198
198
|
require 'ultracart_api/models/conversation_multimedia_upload_url'
|
|
199
199
|
require 'ultracart_api/models/conversation_multimedia_upload_url_response'
|
|
200
200
|
require 'ultracart_api/models/conversation_participant'
|
|
201
|
+
require 'ultracart_api/models/conversation_pbx_address'
|
|
202
|
+
require 'ultracart_api/models/conversation_pbx_address_response'
|
|
203
|
+
require 'ultracart_api/models/conversation_pbx_addresses_response'
|
|
201
204
|
require 'ultracart_api/models/conversation_pbx_agent'
|
|
202
205
|
require 'ultracart_api/models/conversation_pbx_agent_response'
|
|
203
206
|
require 'ultracart_api/models/conversation_pbx_agents_response'
|
|
@@ -207,6 +210,8 @@ require 'ultracart_api/models/conversation_pbx_audio_upload_url'
|
|
|
207
210
|
require 'ultracart_api/models/conversation_pbx_audio_upload_url_response'
|
|
208
211
|
require 'ultracart_api/models/conversation_pbx_audio_usage_response'
|
|
209
212
|
require 'ultracart_api/models/conversation_pbx_audios_response'
|
|
213
|
+
require 'ultracart_api/models/conversation_pbx_available_phone_number'
|
|
214
|
+
require 'ultracart_api/models/conversation_pbx_available_phone_numbers_response'
|
|
210
215
|
require 'ultracart_api/models/conversation_pbx_customer_snapshot_request'
|
|
211
216
|
require 'ultracart_api/models/conversation_pbx_customer_snapshot_response'
|
|
212
217
|
require 'ultracart_api/models/conversation_pbx_menu'
|
|
@@ -214,6 +219,7 @@ require 'ultracart_api/models/conversation_pbx_menu_mapping'
|
|
|
214
219
|
require 'ultracart_api/models/conversation_pbx_menu_response'
|
|
215
220
|
require 'ultracart_api/models/conversation_pbx_menus_response'
|
|
216
221
|
require 'ultracart_api/models/conversation_pbx_phone_number'
|
|
222
|
+
require 'ultracart_api/models/conversation_pbx_phone_number_purchase_request'
|
|
217
223
|
require 'ultracart_api/models/conversation_pbx_phone_number_response'
|
|
218
224
|
require 'ultracart_api/models/conversation_pbx_phone_numbers_response'
|
|
219
225
|
require 'ultracart_api/models/conversation_pbx_queue'
|