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