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,280 @@
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 Service
29
+ # Unique identifier for this service.
30
+ attr_accessor :id
31
+
32
+ # Unique identifier for the access account which initiated this if available.
33
+ attr_accessor :accessaccount_id
34
+
35
+ # The name of the service.
36
+ attr_accessor :name
37
+
38
+ # Whether the service has been flagged to be cancelled.
39
+ attr_accessor :pending_cancel
40
+
41
+ # The amount of credits required to schedule this service.
42
+ attr_accessor :credit_cost
43
+
44
+ # The amount of recipients for this service.
45
+ attr_accessor :total_recipients
46
+
47
+ # When the service will be sent.
48
+ attr_accessor :send_at
49
+
50
+ # When the service was created.
51
+ attr_accessor :created_at
52
+
53
+ # When the service was last updated.
54
+ attr_accessor :updated_at
55
+
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'id' => :'id',
61
+ :'accessaccount_id' => :'accessaccount_id',
62
+ :'name' => :'name',
63
+ :'pending_cancel' => :'pending_cancel',
64
+ :'credit_cost' => :'credit_cost',
65
+ :'total_recipients' => :'total_recipients',
66
+ :'send_at' => :'send_at',
67
+ :'created_at' => :'created_at',
68
+ :'updated_at' => :'updated_at'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'id' => :'String',
76
+ :'accessaccount_id' => :'String',
77
+ :'name' => :'String',
78
+ :'pending_cancel' => :'BOOLEAN',
79
+ :'credit_cost' => :'Float',
80
+ :'total_recipients' => :'Float',
81
+ :'send_at' => :'String',
82
+ :'created_at' => :'String',
83
+ :'updated_at' => :'String'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
94
+
95
+ if attributes.has_key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.has_key?(:'accessaccount_id')
100
+ self.accessaccount_id = attributes[:'accessaccount_id']
101
+ end
102
+
103
+ if attributes.has_key?(:'name')
104
+ self.name = attributes[:'name']
105
+ end
106
+
107
+ if attributes.has_key?(:'pending_cancel')
108
+ self.pending_cancel = attributes[:'pending_cancel']
109
+ end
110
+
111
+ if attributes.has_key?(:'credit_cost')
112
+ self.credit_cost = attributes[:'credit_cost']
113
+ end
114
+
115
+ if attributes.has_key?(:'total_recipients')
116
+ self.total_recipients = attributes[:'total_recipients']
117
+ end
118
+
119
+ if attributes.has_key?(:'send_at')
120
+ self.send_at = attributes[:'send_at']
121
+ end
122
+
123
+ if attributes.has_key?(:'created_at')
124
+ self.created_at = attributes[:'created_at']
125
+ end
126
+
127
+ if attributes.has_key?(:'updated_at')
128
+ self.updated_at = attributes[:'updated_at']
129
+ end
130
+
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properies with the reasons
135
+ def list_invalid_properties
136
+ invalid_properties = Array.new
137
+ return invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ return true
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ id == o.id &&
152
+ accessaccount_id == o.accessaccount_id &&
153
+ name == o.name &&
154
+ pending_cancel == o.pending_cancel &&
155
+ credit_cost == o.credit_cost &&
156
+ total_recipients == o.total_recipients &&
157
+ send_at == o.send_at &&
158
+ created_at == o.created_at &&
159
+ updated_at == o.updated_at
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Fixnum] Hash code
170
+ def hash
171
+ [id, accessaccount_id, name, pending_cancel, credit_cost, total_recipients, send_at, created_at, updated_at].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /^Array<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ temp_model = DialMyCalls.const_get(type).new
232
+ temp_model.build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ next if value.nil?
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map{ |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -0,0 +1,230 @@
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 Shortcode
29
+ # Unique identifier for this shortcode.
30
+ attr_accessor :id
31
+
32
+ # The shortcode.
33
+ attr_accessor :shortcode
34
+
35
+ # When the keyword was created.
36
+ attr_accessor :created_at
37
+
38
+ # When the keyword was last updated.
39
+ attr_accessor :updated_at
40
+
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'id' => :'id',
46
+ :'shortcode' => :'shortcode',
47
+ :'created_at' => :'created_at',
48
+ :'updated_at' => :'updated_at'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'id' => :'String',
56
+ :'shortcode' => :'String',
57
+ :'created_at' => :'String',
58
+ :'updated_at' => :'String'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
69
+
70
+ if attributes.has_key?(:'id')
71
+ self.id = attributes[:'id']
72
+ end
73
+
74
+ if attributes.has_key?(:'shortcode')
75
+ self.shortcode = attributes[:'shortcode']
76
+ end
77
+
78
+ if attributes.has_key?(:'created_at')
79
+ self.created_at = attributes[:'created_at']
80
+ end
81
+
82
+ if attributes.has_key?(:'updated_at')
83
+ self.updated_at = attributes[:'updated_at']
84
+ end
85
+
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properies with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ return invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ id == o.id &&
107
+ shortcode == o.shortcode &&
108
+ created_at == o.created_at &&
109
+ updated_at == o.updated_at
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [id, shortcode, created_at, updated_at].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /^Array<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :BOOLEAN
161
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ temp_model = DialMyCalls.const_get(type).new
182
+ temp_model.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ next if value.nil?
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map{ |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end