dialmycalls_client 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +186 -0
  4. data/dialmycalls_client-1.0.0.gem +0 -0
  5. data/dialmycalls_client.gemspec +55 -0
  6. data/docs/Accessaccount.md +12 -0
  7. data/docs/Account.md +9 -0
  8. data/docs/AccountsApi.md +324 -0
  9. data/docs/CallRecipient.md +19 -0
  10. data/docs/CallerIdsApi.md +386 -0
  11. data/docs/Callerid.md +13 -0
  12. data/docs/CallsApi.md +278 -0
  13. data/docs/Callservice.md +17 -0
  14. data/docs/Contact.md +18 -0
  15. data/docs/ContactAttributes.md +11 -0
  16. data/docs/ContactsApi.md +330 -0
  17. data/docs/CreateAccessAccountParameters.md +10 -0
  18. data/docs/CreateCallParameters.md +18 -0
  19. data/docs/CreateCallerIdParameters.md +9 -0
  20. data/docs/CreateContactParameters.md +14 -0
  21. data/docs/CreateGroupParameters.md +8 -0
  22. data/docs/CreateRecordingByPhoneParameters.md +12 -0
  23. data/docs/CreateRecordingByUrlParameters.md +9 -0
  24. data/docs/CreateRecordingParameters.md +11 -0
  25. data/docs/CreateTextParameters.md +17 -0
  26. data/docs/CreateUnverifiedCallerIdParameters.md +9 -0
  27. data/docs/DoNotContactsApi.md +62 -0
  28. data/docs/Donotcontact.md +12 -0
  29. data/docs/Group.md +12 -0
  30. data/docs/GroupsApi.md +277 -0
  31. data/docs/Identifier.md +8 -0
  32. data/docs/Incomingtext.md +13 -0
  33. data/docs/Keyword.md +12 -0
  34. data/docs/KeywordsApi.md +168 -0
  35. data/docs/Polling.md +10 -0
  36. data/docs/PushToListenAgain.md +9 -0
  37. data/docs/PushToOptOut.md +9 -0
  38. data/docs/PushToRecord.md +9 -0
  39. data/docs/PushToTalk.md +12 -0
  40. data/docs/Recording.md +15 -0
  41. data/docs/RecordingsApi.md +383 -0
  42. data/docs/Service.md +16 -0
  43. data/docs/Shortcode.md +11 -0
  44. data/docs/TextRecipient.md +13 -0
  45. data/docs/TextsApi.md +492 -0
  46. data/docs/UpdateAccessAccountByIdParameters.md +10 -0
  47. data/docs/UpdateCallerIdByIdParameters.md +8 -0
  48. data/docs/UpdateContactByIdParameters.md +14 -0
  49. data/docs/UpdateGroupByIdParameters.md +8 -0
  50. data/docs/UpdateRecordingByIdParameters.md +8 -0
  51. data/docs/UpdateVanityNumberByIdParameters.md +12 -0
  52. data/docs/VanityNumbersApi.md +224 -0
  53. data/docs/Vanitynumber.md +16 -0
  54. data/docs/VerifyCallerIdByIdParameters.md +8 -0
  55. data/git_push.sh +67 -0
  56. data/lib/dialmycalls_client/api/accounts_api.rb +375 -0
  57. data/lib/dialmycalls_client/api/caller_ids_api.rb +440 -0
  58. data/lib/dialmycalls_client/api/calls_api.rb +321 -0
  59. data/lib/dialmycalls_client/api/contacts_api.rb +379 -0
  60. data/lib/dialmycalls_client/api/do_not_contacts_api.rb +90 -0
  61. data/lib/dialmycalls_client/api/groups_api.rb +322 -0
  62. data/lib/dialmycalls_client/api/keywords_api.rb +204 -0
  63. data/lib/dialmycalls_client/api/recordings_api.rb +436 -0
  64. data/lib/dialmycalls_client/api/texts_api.rb +547 -0
  65. data/lib/dialmycalls_client/api/vanity_numbers_api.rb +265 -0
  66. data/lib/dialmycalls_client/api_client.rb +379 -0
  67. data/lib/dialmycalls_client/api_error.rb +47 -0
  68. data/lib/dialmycalls_client/configuration.rb +214 -0
  69. data/lib/dialmycalls_client/models/accessaccount.rb +240 -0
  70. data/lib/dialmycalls_client/models/account.rb +210 -0
  71. data/lib/dialmycalls_client/models/call_recipient.rb +310 -0
  72. data/lib/dialmycalls_client/models/callerid.rb +250 -0
  73. data/lib/dialmycalls_client/models/callservice.rb +290 -0
  74. data/lib/dialmycalls_client/models/contact.rb +300 -0
  75. data/lib/dialmycalls_client/models/contact_attributes.rb +230 -0
  76. data/lib/dialmycalls_client/models/create_access_account_parameters.rb +220 -0
  77. data/lib/dialmycalls_client/models/create_call_parameters.rb +304 -0
  78. data/lib/dialmycalls_client/models/create_caller_id_parameters.rb +210 -0
  79. data/lib/dialmycalls_client/models/create_contact_parameters.rb +262 -0
  80. data/lib/dialmycalls_client/models/create_group_parameters.rb +200 -0
  81. data/lib/dialmycalls_client/models/create_recording_by_phone_parameters.rb +240 -0
  82. data/lib/dialmycalls_client/models/create_recording_by_url_parameters.rb +210 -0
  83. data/lib/dialmycalls_client/models/create_recording_parameters.rb +230 -0
  84. data/lib/dialmycalls_client/models/create_text_parameters.rb +294 -0
  85. data/lib/dialmycalls_client/models/create_unverified_caller_id_parameters.rb +210 -0
  86. data/lib/dialmycalls_client/models/donotcontact.rb +240 -0
  87. data/lib/dialmycalls_client/models/group.rb +240 -0
  88. data/lib/dialmycalls_client/models/identifier.rb +200 -0
  89. data/lib/dialmycalls_client/models/incomingtext.rb +250 -0
  90. data/lib/dialmycalls_client/models/keyword.rb +240 -0
  91. data/lib/dialmycalls_client/models/polling.rb +220 -0
  92. data/lib/dialmycalls_client/models/push_to_listen_again.rb +210 -0
  93. data/lib/dialmycalls_client/models/push_to_opt_out.rb +210 -0
  94. data/lib/dialmycalls_client/models/push_to_record.rb +210 -0
  95. data/lib/dialmycalls_client/models/push_to_talk.rb +240 -0
  96. data/lib/dialmycalls_client/models/recording.rb +270 -0
  97. data/lib/dialmycalls_client/models/service.rb +280 -0
  98. data/lib/dialmycalls_client/models/shortcode.rb +230 -0
  99. data/lib/dialmycalls_client/models/text_recipient.rb +250 -0
  100. data/lib/dialmycalls_client/models/update_access_account_by_id_parameters.rb +220 -0
  101. data/lib/dialmycalls_client/models/update_caller_id_by_id_parameters.rb +200 -0
  102. data/lib/dialmycalls_client/models/update_contact_by_id_parameters.rb +262 -0
  103. data/lib/dialmycalls_client/models/update_group_by_id_parameters.rb +200 -0
  104. data/lib/dialmycalls_client/models/update_recording_by_id_parameters.rb +200 -0
  105. data/lib/dialmycalls_client/models/update_vanity_number_by_id_parameters.rb +242 -0
  106. data/lib/dialmycalls_client/models/vanitynumber.rb +280 -0
  107. data/lib/dialmycalls_client/models/verify_caller_id_by_id_parameters.rb +200 -0
  108. data/lib/dialmycalls_client/version.rb +26 -0
  109. data/lib/dialmycalls_client.rb +99 -0
  110. data/spec/api/accounts_api_spec.rb +118 -0
  111. data/spec/api/caller_ids_api_spec.rb +132 -0
  112. data/spec/api/calls_api_spec.rb +107 -0
  113. data/spec/api/contacts_api_spec.rb +119 -0
  114. data/spec/api/do_not_contacts_api_spec.rb +58 -0
  115. data/spec/api/groups_api_spec.rb +107 -0
  116. data/spec/api/keywords_api_spec.rb +82 -0
  117. data/spec/api/recordings_api_spec.rb +131 -0
  118. data/spec/api/texts_api_spec.rb +155 -0
  119. data/spec/api/vanity_numbers_api_spec.rb +95 -0
  120. data/spec/api_client_spec.rb +237 -0
  121. data/spec/configuration_spec.rb +53 -0
  122. data/spec/models/accessaccount_spec.rb +77 -0
  123. data/spec/models/account_spec.rb +59 -0
  124. data/spec/models/call_recipient_spec.rb +119 -0
  125. data/spec/models/callerid_spec.rb +83 -0
  126. data/spec/models/callservice_spec.rb +107 -0
  127. data/spec/models/contact_attributes_spec.rb +71 -0
  128. data/spec/models/contact_spec.rb +113 -0
  129. data/spec/models/create_access_account_parameters_spec.rb +65 -0
  130. data/spec/models/create_call_parameters_spec.rb +113 -0
  131. data/spec/models/create_caller_id_parameters_spec.rb +59 -0
  132. data/spec/models/create_contact_parameters_spec.rb +89 -0
  133. data/spec/models/create_group_parameters_spec.rb +53 -0
  134. data/spec/models/create_recording_by_phone_parameters_spec.rb +77 -0
  135. data/spec/models/create_recording_by_url_parameters_spec.rb +59 -0
  136. data/spec/models/create_recording_parameters_spec.rb +71 -0
  137. data/spec/models/create_text_parameters_spec.rb +107 -0
  138. data/spec/models/create_unverified_caller_id_parameters_spec.rb +59 -0
  139. data/spec/models/donotcontact_spec.rb +77 -0
  140. data/spec/models/group_spec.rb +77 -0
  141. data/spec/models/identifier_spec.rb +53 -0
  142. data/spec/models/incomingtext_spec.rb +83 -0
  143. data/spec/models/keyword_spec.rb +77 -0
  144. data/spec/models/polling_spec.rb +65 -0
  145. data/spec/models/push_to_listen_again_spec.rb +59 -0
  146. data/spec/models/push_to_opt_out_spec.rb +59 -0
  147. data/spec/models/push_to_record_spec.rb +59 -0
  148. data/spec/models/push_to_talk_spec.rb +77 -0
  149. data/spec/models/recording_spec.rb +95 -0
  150. data/spec/models/service_spec.rb +101 -0
  151. data/spec/models/shortcode_spec.rb +71 -0
  152. data/spec/models/text_recipient_spec.rb +83 -0
  153. data/spec/models/update_access_account_by_id_parameters_spec.rb +65 -0
  154. data/spec/models/update_caller_id_by_id_parameters_spec.rb +53 -0
  155. data/spec/models/update_contact_by_id_parameters_spec.rb +89 -0
  156. data/spec/models/update_group_by_id_parameters_spec.rb +53 -0
  157. data/spec/models/update_recording_by_id_parameters_spec.rb +53 -0
  158. data/spec/models/update_vanity_number_by_id_parameters_spec.rb +77 -0
  159. data/spec/models/vanitynumber_spec.rb +101 -0
  160. data/spec/models/verify_caller_id_by_id_parameters_spec.rb +53 -0
  161. data/spec/spec_helper.rb +122 -0
  162. metadata +436 -0
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #DialMyCalls API
3
+
4
+ #The DialMyCalls API
5
+
6
+ OpenAPI spec version: 2.0.1
7
+ Contact: support@dialmycalls.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module DialMyCalls
27
+
28
+ class TextRecipient
29
+ # The recipient's first name.
30
+ attr_accessor :firstname
31
+
32
+ # The recipient's last name.
33
+ attr_accessor :lastname
34
+
35
+ # The recipient's email address.
36
+ attr_accessor :email
37
+
38
+ # The recipient's phone number.
39
+ attr_accessor :phone
40
+
41
+ # Status of the text. Options: delivered, undeliverable, enroute, unknown, non_mobile, queued
42
+ attr_accessor :status
43
+
44
+ # Whether the text was successful or not.
45
+ attr_accessor :successful
46
+
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'firstname' => :'firstname',
52
+ :'lastname' => :'lastname',
53
+ :'email' => :'email',
54
+ :'phone' => :'phone',
55
+ :'status' => :'status',
56
+ :'successful' => :'successful'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'firstname' => :'String',
64
+ :'lastname' => :'String',
65
+ :'email' => :'String',
66
+ :'phone' => :'String',
67
+ :'status' => :'String',
68
+ :'successful' => :'BOOLEAN'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
79
+
80
+ if attributes.has_key?(:'firstname')
81
+ self.firstname = attributes[:'firstname']
82
+ end
83
+
84
+ if attributes.has_key?(:'lastname')
85
+ self.lastname = attributes[:'lastname']
86
+ end
87
+
88
+ if attributes.has_key?(:'email')
89
+ self.email = attributes[:'email']
90
+ end
91
+
92
+ if attributes.has_key?(:'phone')
93
+ self.phone = attributes[:'phone']
94
+ end
95
+
96
+ if attributes.has_key?(:'status')
97
+ self.status = attributes[:'status']
98
+ end
99
+
100
+ if attributes.has_key?(:'successful')
101
+ self.successful = attributes[:'successful']
102
+ end
103
+
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properies with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ return invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ firstname == o.firstname &&
125
+ lastname == o.lastname &&
126
+ email == o.email &&
127
+ phone == o.phone &&
128
+ status == o.status &&
129
+ successful == o.successful
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Fixnum] Hash code
140
+ def hash
141
+ [firstname, lastname, email, phone, status, successful].hash
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
+ self.class.swagger_types.each_pair do |key, type|
150
+ if type =~ /^Array<(.*)>/i
151
+ # check to ensure the input is an array given that the the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :BOOLEAN
181
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ temp_model = DialMyCalls.const_get(type).new
202
+ temp_model.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ next if value.nil?
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map{ |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #DialMyCalls API
3
+
4
+ #The DialMyCalls API
5
+
6
+ OpenAPI spec version: 2.0.1
7
+ Contact: support@dialmycalls.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module DialMyCalls
27
+
28
+ class UpdateAccessAccountByIdParameters
29
+ # The email address for this access account.
30
+ attr_accessor :email
31
+
32
+ # The password for this access account. Requirements: 8 characters, 1 digit, 1 upper case character.
33
+ attr_accessor :password
34
+
35
+ # The name for this access account.
36
+ attr_accessor :name
37
+
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'email' => :'email',
43
+ :'password' => :'password',
44
+ :'name' => :'name'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'email' => :'String',
52
+ :'password' => :'String',
53
+ :'name' => :'String'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
64
+
65
+ if attributes.has_key?(:'email')
66
+ self.email = attributes[:'email']
67
+ end
68
+
69
+ if attributes.has_key?(:'password')
70
+ self.password = attributes[:'password']
71
+ end
72
+
73
+ if attributes.has_key?(:'name')
74
+ self.name = attributes[:'name']
75
+ end
76
+
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properies with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ return invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ email == o.email &&
98
+ password == o.password &&
99
+ name == o.name
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Fixnum] Hash code
110
+ def hash
111
+ [email, password, name].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ if type =~ /^Array<(.*)>/i
121
+ # check to ensure the input is an array given that the the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ temp_model = DialMyCalls.const_get(type).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ next if value.nil?
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map{ |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #DialMyCalls API
3
+
4
+ #The DialMyCalls API
5
+
6
+ OpenAPI spec version: 2.0.1
7
+ Contact: support@dialmycalls.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module DialMyCalls
27
+
28
+ class UpdateCallerIdByIdParameters
29
+ # (Required) The caller ID's name.
30
+ attr_accessor :name
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'name' => :'name'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'name' => :'String'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+ if attributes.has_key?(:'name')
56
+ self.name = attributes[:'name']
57
+ end
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ return invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ name == o.name
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [name].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ if type =~ /^Array<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
103
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
104
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
105
+ end
106
+ elsif !attributes[self.class.attribute_map[key]].nil?
107
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
108
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
109
+ end
110
+
111
+ self
112
+ end
113
+
114
+ # Deserializes the data based on type
115
+ # @param string type Data type
116
+ # @param string value Value to be deserialized
117
+ # @return [Object] Deserialized data
118
+ def _deserialize(type, value)
119
+ case type.to_sym
120
+ when :DateTime
121
+ DateTime.parse(value)
122
+ when :Date
123
+ Date.parse(value)
124
+ when :String
125
+ value.to_s
126
+ when :Integer
127
+ value.to_i
128
+ when :Float
129
+ value.to_f
130
+ when :BOOLEAN
131
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
132
+ true
133
+ else
134
+ false
135
+ end
136
+ when :Object
137
+ # generic object (usually a Hash), return directly
138
+ value
139
+ when /\AArray<(?<inner_type>.+)>\z/
140
+ inner_type = Regexp.last_match[:inner_type]
141
+ value.map { |v| _deserialize(inner_type, v) }
142
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
+ k_type = Regexp.last_match[:k_type]
144
+ v_type = Regexp.last_match[:v_type]
145
+ {}.tap do |hash|
146
+ value.each do |k, v|
147
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
+ end
149
+ end
150
+ else # model
151
+ temp_model = DialMyCalls.const_get(type).new
152
+ temp_model.build_from_hash(value)
153
+ end
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_body
165
+ to_hash
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map{ |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+
198
+ end
199
+
200
+ end