freeclimb 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +10 -0
  3. data/Gemfile.lock +82 -0
  4. data/README.md +238 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountRequest.md +21 -0
  7. data/docs/AccountResult.md +37 -0
  8. data/docs/AccountResultAllOf.md +29 -0
  9. data/docs/ApplicationList.md +31 -0
  10. data/docs/ApplicationListAllOf.md +17 -0
  11. data/docs/ApplicationRequest.md +31 -0
  12. data/docs/ApplicationResult.md +41 -0
  13. data/docs/ApplicationResultAllOf.md +33 -0
  14. data/docs/AvailableNumber.md +27 -0
  15. data/docs/AvailableNumberList.md +31 -0
  16. data/docs/AvailableNumberListAllOf.md +17 -0
  17. data/docs/BuyIncomingNumberRequest.md +23 -0
  18. data/docs/CallList.md +31 -0
  19. data/docs/CallListAllOf.md +17 -0
  20. data/docs/CallResult.md +53 -0
  21. data/docs/CallResultAllOf.md +45 -0
  22. data/docs/ConferenceList.md +31 -0
  23. data/docs/ConferenceListAllOf.md +17 -0
  24. data/docs/ConferenceParticipantList.md +31 -0
  25. data/docs/ConferenceParticipantListAllOf.md +17 -0
  26. data/docs/ConferenceParticipantResult.md +35 -0
  27. data/docs/ConferenceParticipantResultAllOf.md +27 -0
  28. data/docs/ConferenceResult.md +43 -0
  29. data/docs/ConferenceResultAllOf.md +35 -0
  30. data/docs/CreateConferenceRequest.md +27 -0
  31. data/docs/DefaultApi.md +2504 -0
  32. data/docs/DequeueMemberRequest.md +17 -0
  33. data/docs/FilterLogsRequest.md +19 -0
  34. data/docs/IncomingNumberList.md +31 -0
  35. data/docs/IncomingNumberListAllOf.md +17 -0
  36. data/docs/IncomingNumberRequest.md +21 -0
  37. data/docs/IncomingNumberResult.md +41 -0
  38. data/docs/IncomingNumberResultAllOf.md +33 -0
  39. data/docs/LogList.md +31 -0
  40. data/docs/LogListAllOf.md +17 -0
  41. data/docs/LogResult.md +29 -0
  42. data/docs/MakeCallRequest.md +33 -0
  43. data/docs/MessageRequest.md +35 -0
  44. data/docs/MessageRequestAllOf.md +27 -0
  45. data/docs/MessageResult.md +39 -0
  46. data/docs/MessageResultAllOf.md +31 -0
  47. data/docs/MessagesList.md +31 -0
  48. data/docs/MessagesListAllOf.md +17 -0
  49. data/docs/MutableResourceModel.md +23 -0
  50. data/docs/PaginationModel.md +29 -0
  51. data/docs/Percl.md +697 -0
  52. data/docs/QueueList.md +31 -0
  53. data/docs/QueueListAllOf.md +17 -0
  54. data/docs/QueueMember.md +25 -0
  55. data/docs/QueueMemberList.md +31 -0
  56. data/docs/QueueMemberListAllOf.md +17 -0
  57. data/docs/QueueRequest.md +21 -0
  58. data/docs/QueueResult.md +37 -0
  59. data/docs/QueueResultAllOf.md +29 -0
  60. data/docs/RecordingList.md +31 -0
  61. data/docs/RecordingListAllOf.md +17 -0
  62. data/docs/RecordingResult.md +33 -0
  63. data/docs/RecordingResultAllOf.md +25 -0
  64. data/docs/UpdateCallRequest.md +19 -0
  65. data/docs/UpdateConferenceParticipantRequest.md +21 -0
  66. data/docs/UpdateConferenceRequest.md +23 -0
  67. data/freeclimb.gemspec +39 -0
  68. data/git_push.sh +58 -0
  69. data/lib/freeclimb.rb +99 -0
  70. data/lib/freeclimb/api/default_api.rb +2845 -0
  71. data/lib/freeclimb/api_client.rb +386 -0
  72. data/lib/freeclimb/api_error.rb +57 -0
  73. data/lib/freeclimb/configuration.rb +248 -0
  74. data/lib/freeclimb/models/account_request.rb +227 -0
  75. data/lib/freeclimb/models/account_result.rb +349 -0
  76. data/lib/freeclimb/models/account_result_all_of.rb +301 -0
  77. data/lib/freeclimb/models/application_list.rb +286 -0
  78. data/lib/freeclimb/models/application_list_all_of.rb +208 -0
  79. data/lib/freeclimb/models/application_request.rb +277 -0
  80. data/lib/freeclimb/models/application_result.rb +335 -0
  81. data/lib/freeclimb/models/application_result_all_of.rb +287 -0
  82. data/lib/freeclimb/models/available_number.rb +257 -0
  83. data/lib/freeclimb/models/available_number_list.rb +286 -0
  84. data/lib/freeclimb/models/available_number_list_all_of.rb +208 -0
  85. data/lib/freeclimb/models/buy_incoming_number_request.rb +242 -0
  86. data/lib/freeclimb/models/call_list.rb +286 -0
  87. data/lib/freeclimb/models/call_list_all_of.rb +208 -0
  88. data/lib/freeclimb/models/call_result.rb +429 -0
  89. data/lib/freeclimb/models/call_result_all_of.rb +381 -0
  90. data/lib/freeclimb/models/conference_list.rb +286 -0
  91. data/lib/freeclimb/models/conference_list_all_of.rb +208 -0
  92. data/lib/freeclimb/models/conference_participant_list.rb +286 -0
  93. data/lib/freeclimb/models/conference_participant_list_all_of.rb +208 -0
  94. data/lib/freeclimb/models/conference_participant_result.rb +305 -0
  95. data/lib/freeclimb/models/conference_participant_result_all_of.rb +257 -0
  96. data/lib/freeclimb/models/conference_result.rb +391 -0
  97. data/lib/freeclimb/models/conference_result_all_of.rb +343 -0
  98. data/lib/freeclimb/models/create_conference_request.rb +293 -0
  99. data/lib/freeclimb/models/dequeue_member_request.rb +207 -0
  100. data/lib/freeclimb/models/filter_logs_request.rb +222 -0
  101. data/lib/freeclimb/models/incoming_number_list.rb +286 -0
  102. data/lib/freeclimb/models/incoming_number_list_all_of.rb +208 -0
  103. data/lib/freeclimb/models/incoming_number_request.rb +227 -0
  104. data/lib/freeclimb/models/incoming_number_result.rb +335 -0
  105. data/lib/freeclimb/models/incoming_number_result_all_of.rb +287 -0
  106. data/lib/freeclimb/models/log_list.rb +286 -0
  107. data/lib/freeclimb/models/log_list_all_of.rb +208 -0
  108. data/lib/freeclimb/models/log_result.rb +301 -0
  109. data/lib/freeclimb/models/make_call_request.rb +302 -0
  110. data/lib/freeclimb/models/message_request.rb +320 -0
  111. data/lib/freeclimb/models/message_request_all_of.rb +272 -0
  112. data/lib/freeclimb/models/message_result.rb +359 -0
  113. data/lib/freeclimb/models/message_result_all_of.rb +311 -0
  114. data/lib/freeclimb/models/messages_list.rb +287 -0
  115. data/lib/freeclimb/models/messages_list_all_of.rb +209 -0
  116. data/lib/freeclimb/models/mutable_resource_model.rb +237 -0
  117. data/lib/freeclimb/models/pagination_model.rb +267 -0
  118. data/lib/freeclimb/models/queue_list.rb +286 -0
  119. data/lib/freeclimb/models/queue_list_all_of.rb +208 -0
  120. data/lib/freeclimb/models/queue_member.rb +247 -0
  121. data/lib/freeclimb/models/queue_member_list.rb +286 -0
  122. data/lib/freeclimb/models/queue_member_list_all_of.rb +208 -0
  123. data/lib/freeclimb/models/queue_request.rb +227 -0
  124. data/lib/freeclimb/models/queue_result.rb +315 -0
  125. data/lib/freeclimb/models/queue_result_all_of.rb +267 -0
  126. data/lib/freeclimb/models/recording_list.rb +286 -0
  127. data/lib/freeclimb/models/recording_list_all_of.rb +208 -0
  128. data/lib/freeclimb/models/recording_result.rb +295 -0
  129. data/lib/freeclimb/models/recording_result_all_of.rb +247 -0
  130. data/lib/freeclimb/models/update_call_request.rb +256 -0
  131. data/lib/freeclimb/models/update_conference_participant_request.rb +227 -0
  132. data/lib/freeclimb/models/update_conference_request.rb +273 -0
  133. data/lib/freeclimb/version.rb +15 -0
  134. data/lib/percl/calls.rb +43 -0
  135. data/lib/percl/conference_participants.rb +40 -0
  136. data/lib/percl/conferences.rb +21 -0
  137. data/lib/percl/ivr.rb +63 -0
  138. data/lib/percl/jsonable.rb +23 -0
  139. data/lib/percl/percl.rb +29 -0
  140. data/lib/percl/queue_members.rb +15 -0
  141. data/lib/percl/recordings.rb +15 -0
  142. data/lib/percl/sms.rb +11 -0
  143. data/spec/api/default_api_spec.rb +1151 -0
  144. data/spec/api/web_mocks.rb +473 -0
  145. data/spec/api_client_spec.rb +226 -0
  146. data/spec/configuration_spec.rb +34 -0
  147. data/spec/models/account_request_spec.rb +33 -0
  148. data/spec/models/account_result_spec.rb +33 -0
  149. data/spec/models/application_list_spec.rb +33 -0
  150. data/spec/models/application_request_spec.rb +33 -0
  151. data/spec/models/application_result_spec.rb +33 -0
  152. data/spec/models/available_number_list_spec.rb +34 -0
  153. data/spec/models/available_number_spec.rb +33 -0
  154. data/spec/models/buy_incoming_number_request_spec.rb +33 -0
  155. data/spec/models/call_list_spec.rb +34 -0
  156. data/spec/models/call_result_spec.rb +34 -0
  157. data/spec/models/conference_list_spec.rb +33 -0
  158. data/spec/models/conference_participant_list_spec.rb +33 -0
  159. data/spec/models/conference_participant_result_spec.rb +33 -0
  160. data/spec/models/conference_result_spec.rb +34 -0
  161. data/spec/models/create_conference_request_spec.rb +34 -0
  162. data/spec/models/dequeue_member_request_spec.rb +34 -0
  163. data/spec/models/filter_logs_request_spec.rb +33 -0
  164. data/spec/models/incoming_number_list_spec.rb +34 -0
  165. data/spec/models/incoming_number_request_spec.rb +33 -0
  166. data/spec/models/incoming_number_result_spec.rb +34 -0
  167. data/spec/models/log_list_spec.rb +33 -0
  168. data/spec/models/log_result_spec.rb +33 -0
  169. data/spec/models/make_call_request_spec.rb +33 -0
  170. data/spec/models/message_request_spec.rb +34 -0
  171. data/spec/models/message_result_spec.rb +33 -0
  172. data/spec/models/messages_list_spec.rb +33 -0
  173. data/spec/models/mutable_resource_model_spec.rb +34 -0
  174. data/spec/models/pagination_model_spec.rb +33 -0
  175. data/spec/models/queue_list_spec.rb +34 -0
  176. data/spec/models/queue_member_list_spec.rb +33 -0
  177. data/spec/models/queue_member_spec.rb +34 -0
  178. data/spec/models/queue_request_spec.rb +34 -0
  179. data/spec/models/queue_result_spec.rb +33 -0
  180. data/spec/models/recording_list_spec.rb +33 -0
  181. data/spec/models/recording_result_spec.rb +33 -0
  182. data/spec/models/update_call_request_spec.rb +33 -0
  183. data/spec/models/update_conference_participant_request_spec.rb +33 -0
  184. data/spec/models/update_conference_request_spec.rb +33 -0
  185. data/spec/percl/calls_spec.rb +111 -0
  186. data/spec/percl/conference_participant_spec.rb +96 -0
  187. data/spec/percl/conference_spec.rb +46 -0
  188. data/spec/percl/ivr_spec.rb +155 -0
  189. data/spec/percl/jsonable_spec.rb +28 -0
  190. data/spec/percl/percl_spec.rb +31 -0
  191. data/spec/percl/queue_members_spec.rb +35 -0
  192. data/spec/percl/recordings_spec.rb +32 -0
  193. data/spec/percl/sms_spec.rb +29 -0
  194. data/spec/spec_helper.rb +114 -0
  195. metadata +355 -0
@@ -0,0 +1,429 @@
1
+ =begin
2
+ #FreeClimb API
3
+
4
+ #FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Freeclimb
16
+ class CallResult
17
+ # The URI for this resource, relative to /apiserver.
18
+ attr_accessor :uri
19
+
20
+ # The date that this resource was created (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT).
21
+ attr_accessor :date_created
22
+
23
+ # The date that this resource was last updated (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT).
24
+ attr_accessor :date_updated
25
+
26
+ # Revision count for the resource. This count is set to 1 on creation and is incremented every time it is updated.
27
+ attr_accessor :revision
28
+
29
+ # String that uniquely identifies this Call resource.
30
+ attr_accessor :call_id
31
+
32
+ # ID of the Call that created this leg (child Call).
33
+ attr_accessor :parent_call_id
34
+
35
+ # ID of the account that owns this Call.
36
+ attr_accessor :account_id
37
+
38
+ # Phone number that initiated this Call.
39
+ attr_accessor :from
40
+
41
+ # Phone number that received this Call.
42
+ attr_accessor :to
43
+
44
+ # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI).
45
+ attr_accessor :phone_number_id
46
+
47
+ # * `queued` – Call is ready and waiting in line before going out. * `ringing` – Call is currently ringing. * `inProgress` – Call was answered and is currently in progress. * `canceled` – Call was hung up while it was queued or ringing. * `completed` – Call was answered and has ended normally. * `busy` – Caller received a busy signal. * `failed` – Call could not be completed as dialed, most likely because the phone number was non-existent. * `noAnswer` – Call ended without being answered.
48
+ attr_accessor :status
49
+
50
+ # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
51
+ attr_accessor :start_time
52
+
53
+ # Time the Call was answered (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
54
+ attr_accessor :connect_time
55
+
56
+ # End time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call did not complete successfully.
57
+ attr_accessor :end_time
58
+
59
+ # Total length of the Call in seconds. Measures time between startTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
60
+ attr_accessor :duration
61
+
62
+ # Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
63
+ attr_accessor :connect_duration
64
+
65
+ # Direction of the Call. `inbound` for Calls into FreeClimb, `outboundAPI` for Calls initiated via the REST API, `outboundDial` for Calls initiated by the `OutDial` PerCL command.
66
+ attr_accessor :direction
67
+
68
+ # If this Call was initiated with answering machine detection, either `human` or `machine`. Empty otherwise.
69
+ attr_accessor :answered_by
70
+
71
+ # The list of subresources for this Call. These include things like logs and recordings associated with the Call.
72
+ attr_accessor :subresource_uris
73
+
74
+ class EnumAttributeValidator
75
+ attr_reader :datatype
76
+ attr_reader :allowable_values
77
+
78
+ def initialize(datatype, allowable_values)
79
+ @allowable_values = allowable_values.map do |value|
80
+ case datatype.to_s
81
+ when /Integer/i
82
+ value.to_i
83
+ when /Float/i
84
+ value.to_f
85
+ else
86
+ value
87
+ end
88
+ end
89
+ end
90
+
91
+ def valid?(value)
92
+ !value || allowable_values.include?(value)
93
+ end
94
+ end
95
+
96
+ # Attribute mapping from ruby-style variable name to JSON key.
97
+ def self.attribute_map
98
+ {
99
+ :'uri' => :'uri',
100
+ :'date_created' => :'dateCreated',
101
+ :'date_updated' => :'dateUpdated',
102
+ :'revision' => :'revision',
103
+ :'call_id' => :'callId',
104
+ :'parent_call_id' => :'parentCallId',
105
+ :'account_id' => :'accountId',
106
+ :'from' => :'from',
107
+ :'to' => :'to',
108
+ :'phone_number_id' => :'phoneNumberId',
109
+ :'status' => :'status',
110
+ :'start_time' => :'startTime',
111
+ :'connect_time' => :'connectTime',
112
+ :'end_time' => :'endTime',
113
+ :'duration' => :'duration',
114
+ :'connect_duration' => :'connectDuration',
115
+ :'direction' => :'direction',
116
+ :'answered_by' => :'answeredBy',
117
+ :'subresource_uris' => :'subresourceUris'
118
+ }
119
+ end
120
+
121
+ # Attribute type mapping.
122
+ def self.openapi_types
123
+ {
124
+ :'uri' => :'String',
125
+ :'date_created' => :'String',
126
+ :'date_updated' => :'String',
127
+ :'revision' => :'Integer',
128
+ :'call_id' => :'String',
129
+ :'parent_call_id' => :'String',
130
+ :'account_id' => :'String',
131
+ :'from' => :'String',
132
+ :'to' => :'String',
133
+ :'phone_number_id' => :'String',
134
+ :'status' => :'String',
135
+ :'start_time' => :'String',
136
+ :'connect_time' => :'String',
137
+ :'end_time' => :'String',
138
+ :'duration' => :'Integer',
139
+ :'connect_duration' => :'Integer',
140
+ :'direction' => :'String',
141
+ :'answered_by' => :'String',
142
+ :'subresource_uris' => :'Object'
143
+ }
144
+ end
145
+
146
+ # List of attributes with nullable: true
147
+ def self.openapi_nullable
148
+ Set.new([
149
+ ])
150
+ end
151
+
152
+ # List of class defined in allOf (OpenAPI v3)
153
+ def self.openapi_all_of
154
+ [
155
+ :'CallResultAllOf',
156
+ :'MutableResourceModel'
157
+ ]
158
+ end
159
+
160
+ # Initializes the object
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ def initialize(attributes = {})
163
+ if (!attributes.is_a?(Hash))
164
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallResult` initialize method"
165
+ end
166
+
167
+ # check to see if the attribute exists and convert string to symbol for hash key
168
+ attributes = attributes.each_with_object({}) { |(k, v), h|
169
+ if (!self.class.attribute_map.key?(k.to_sym))
170
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
171
+ end
172
+ h[k.to_sym] = v
173
+ }
174
+
175
+ if attributes.key?(:'uri')
176
+ self.uri = attributes[:'uri']
177
+ end
178
+
179
+ if attributes.key?(:'date_created')
180
+ self.date_created = attributes[:'date_created']
181
+ end
182
+
183
+ if attributes.key?(:'date_updated')
184
+ self.date_updated = attributes[:'date_updated']
185
+ end
186
+
187
+ if attributes.key?(:'revision')
188
+ self.revision = attributes[:'revision']
189
+ end
190
+
191
+ if attributes.key?(:'call_id')
192
+ self.call_id = attributes[:'call_id']
193
+ end
194
+
195
+ if attributes.key?(:'parent_call_id')
196
+ self.parent_call_id = attributes[:'parent_call_id']
197
+ end
198
+
199
+ if attributes.key?(:'account_id')
200
+ self.account_id = attributes[:'account_id']
201
+ end
202
+
203
+ if attributes.key?(:'from')
204
+ self.from = attributes[:'from']
205
+ end
206
+
207
+ if attributes.key?(:'to')
208
+ self.to = attributes[:'to']
209
+ end
210
+
211
+ if attributes.key?(:'phone_number_id')
212
+ self.phone_number_id = attributes[:'phone_number_id']
213
+ end
214
+
215
+ if attributes.key?(:'status')
216
+ self.status = attributes[:'status']
217
+ end
218
+
219
+ if attributes.key?(:'start_time')
220
+ self.start_time = attributes[:'start_time']
221
+ end
222
+
223
+ if attributes.key?(:'connect_time')
224
+ self.connect_time = attributes[:'connect_time']
225
+ end
226
+
227
+ if attributes.key?(:'end_time')
228
+ self.end_time = attributes[:'end_time']
229
+ end
230
+
231
+ if attributes.key?(:'duration')
232
+ self.duration = attributes[:'duration']
233
+ end
234
+
235
+ if attributes.key?(:'connect_duration')
236
+ self.connect_duration = attributes[:'connect_duration']
237
+ end
238
+
239
+ if attributes.key?(:'direction')
240
+ self.direction = attributes[:'direction']
241
+ end
242
+
243
+ if attributes.key?(:'answered_by')
244
+ self.answered_by = attributes[:'answered_by']
245
+ end
246
+
247
+ if attributes.key?(:'subresource_uris')
248
+ self.subresource_uris = attributes[:'subresource_uris']
249
+ end
250
+ end
251
+
252
+ # Show invalid properties with the reasons. Usually used together with valid?
253
+ # @return Array for valid properties with the reasons
254
+ def list_invalid_properties
255
+ invalid_properties = Array.new
256
+ invalid_properties
257
+ end
258
+
259
+ # Check to see if the all the properties in the model are valid
260
+ # @return true if the model is valid
261
+ def valid?
262
+ status_validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
263
+ return false unless status_validator.valid?(@status)
264
+ true
265
+ end
266
+
267
+ # Custom attribute writer method checking allowed values (enum).
268
+ # @param [Object] status Object to be assigned
269
+ def status=(status)
270
+ validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
271
+ unless validator.valid?(status)
272
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
273
+ end
274
+ @status = status
275
+ end
276
+
277
+ # Checks equality by comparing each attribute.
278
+ # @param [Object] Object to be compared
279
+ def ==(o)
280
+ return true if self.equal?(o)
281
+ self.class == o.class &&
282
+ uri == o.uri &&
283
+ date_created == o.date_created &&
284
+ date_updated == o.date_updated &&
285
+ revision == o.revision &&
286
+ call_id == o.call_id &&
287
+ parent_call_id == o.parent_call_id &&
288
+ account_id == o.account_id &&
289
+ from == o.from &&
290
+ to == o.to &&
291
+ phone_number_id == o.phone_number_id &&
292
+ status == o.status &&
293
+ start_time == o.start_time &&
294
+ connect_time == o.connect_time &&
295
+ end_time == o.end_time &&
296
+ duration == o.duration &&
297
+ connect_duration == o.connect_duration &&
298
+ direction == o.direction &&
299
+ answered_by == o.answered_by &&
300
+ subresource_uris == o.subresource_uris
301
+ end
302
+
303
+ # @see the `==` method
304
+ # @param [Object] Object to be compared
305
+ def eql?(o)
306
+ self == o
307
+ end
308
+
309
+ # Calculates hash code according to all attributes.
310
+ # @return [Integer] Hash code
311
+ def hash
312
+ [uri, date_created, date_updated, revision, call_id, parent_call_id, account_id, from, to, phone_number_id, status, start_time, connect_time, end_time, duration, connect_duration, direction, answered_by, subresource_uris].hash
313
+ end
314
+
315
+ # Builds the object from hash
316
+ # @param [Hash] attributes Model attributes in the form of hash
317
+ # @return [Object] Returns the model itself
318
+ def self.build_from_hash(attributes)
319
+ new.build_from_hash(attributes)
320
+ end
321
+
322
+ # Builds the object from hash
323
+ # @param [Hash] attributes Model attributes in the form of hash
324
+ # @return [Object] Returns the model itself
325
+ def build_from_hash(attributes)
326
+ return nil unless attributes.is_a?(Hash)
327
+ self.class.openapi_types.each_pair do |key, type|
328
+ if type =~ /\AArray<(.*)>/i
329
+ # check to ensure the input is an array given that the attribute
330
+ # is documented as an array but the input is not
331
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
332
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
333
+ end
334
+ elsif !attributes[self.class.attribute_map[key]].nil?
335
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
336
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
337
+ end
338
+
339
+ self
340
+ end
341
+
342
+ # Deserializes the data based on type
343
+ # @param string type Data type
344
+ # @param string value Value to be deserialized
345
+ # @return [Object] Deserialized data
346
+ def _deserialize(type, value)
347
+ case type.to_sym
348
+ when :DateTime
349
+ DateTime.parse(value)
350
+ when :Date
351
+ Date.parse(value)
352
+ when :String
353
+ value.to_s
354
+ when :Integer
355
+ value.to_i
356
+ when :Float
357
+ value.to_f
358
+ when :Boolean
359
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
360
+ true
361
+ else
362
+ false
363
+ end
364
+ when :Object
365
+ # generic object (usually a Hash), return directly
366
+ value
367
+ when /\AArray<(?<inner_type>.+)>\z/
368
+ inner_type = Regexp.last_match[:inner_type]
369
+ value.map { |v| _deserialize(inner_type, v) }
370
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
371
+ k_type = Regexp.last_match[:k_type]
372
+ v_type = Regexp.last_match[:v_type]
373
+ {}.tap do |hash|
374
+ value.each do |k, v|
375
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
376
+ end
377
+ end
378
+ else # model
379
+ Freeclimb.const_get(type).build_from_hash(value)
380
+ end
381
+ end
382
+
383
+ # Returns the string representation of the object
384
+ # @return [String] String presentation of the object
385
+ def to_s
386
+ to_hash.to_s
387
+ end
388
+
389
+ # to_body is an alias to to_hash (backward compatibility)
390
+ # @return [Hash] Returns the object in the form of hash
391
+ def to_body
392
+ to_hash
393
+ end
394
+
395
+ # Returns the object in the form of hash
396
+ # @return [Hash] Returns the object in the form of hash
397
+ def to_hash
398
+ hash = {}
399
+ self.class.attribute_map.each_pair do |attr, param|
400
+ value = self.send(attr)
401
+ if value.nil?
402
+ is_nullable = self.class.openapi_nullable.include?(attr)
403
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
404
+ end
405
+
406
+ hash[param] = _to_hash(value)
407
+ end
408
+ hash
409
+ end
410
+
411
+ # Outputs non-array value in the form of hash
412
+ # For object, use to_hash. Otherwise, just return the value
413
+ # @param [Object] value Any valid value
414
+ # @return [Hash] Returns the value in the form of hash
415
+ def _to_hash(value)
416
+ if value.is_a?(Array)
417
+ value.compact.map { |v| _to_hash(v) }
418
+ elsif value.is_a?(Hash)
419
+ {}.tap do |hash|
420
+ value.each { |k, v| hash[k] = _to_hash(v) }
421
+ end
422
+ elsif value.respond_to? :to_hash
423
+ value.to_hash
424
+ else
425
+ value
426
+ end
427
+ end
428
+ end
429
+ end
@@ -0,0 +1,381 @@
1
+ =begin
2
+ #FreeClimb API
3
+
4
+ #FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Freeclimb
16
+ class CallResultAllOf
17
+ # String that uniquely identifies this Call resource.
18
+ attr_accessor :call_id
19
+
20
+ # ID of the Call that created this leg (child Call).
21
+ attr_accessor :parent_call_id
22
+
23
+ # ID of the account that owns this Call.
24
+ attr_accessor :account_id
25
+
26
+ # Phone number that initiated this Call.
27
+ attr_accessor :from
28
+
29
+ # Phone number that received this Call.
30
+ attr_accessor :to
31
+
32
+ # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI).
33
+ attr_accessor :phone_number_id
34
+
35
+ # * `queued` &ndash; Call is ready and waiting in line before going out. * `ringing` &ndash; Call is currently ringing. * `inProgress` &ndash; Call was answered and is currently in progress. * `canceled` &ndash; Call was hung up while it was queued or ringing. * `completed` &ndash; Call was answered and has ended normally. * `busy` &ndash; Caller received a busy signal. * `failed` &ndash; Call could not be completed as dialed, most likely because the phone number was non-existent. * `noAnswer` &ndash; Call ended without being answered.
36
+ attr_accessor :status
37
+
38
+ # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
39
+ attr_accessor :start_time
40
+
41
+ # Time the Call was answered (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
42
+ attr_accessor :connect_time
43
+
44
+ # End time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call did not complete successfully.
45
+ attr_accessor :end_time
46
+
47
+ # Total length of the Call in seconds. Measures time between startTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
48
+ attr_accessor :duration
49
+
50
+ # Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
51
+ attr_accessor :connect_duration
52
+
53
+ # Direction of the Call. `inbound` for Calls into FreeClimb, `outboundAPI` for Calls initiated via the REST API, `outboundDial` for Calls initiated by the `OutDial` PerCL command.
54
+ attr_accessor :direction
55
+
56
+ # If this Call was initiated with answering machine detection, either `human` or `machine`. Empty otherwise.
57
+ attr_accessor :answered_by
58
+
59
+ # The list of subresources for this Call. These include things like logs and recordings associated with the Call.
60
+ attr_accessor :subresource_uris
61
+
62
+ class EnumAttributeValidator
63
+ attr_reader :datatype
64
+ attr_reader :allowable_values
65
+
66
+ def initialize(datatype, allowable_values)
67
+ @allowable_values = allowable_values.map do |value|
68
+ case datatype.to_s
69
+ when /Integer/i
70
+ value.to_i
71
+ when /Float/i
72
+ value.to_f
73
+ else
74
+ value
75
+ end
76
+ end
77
+ end
78
+
79
+ def valid?(value)
80
+ !value || allowable_values.include?(value)
81
+ end
82
+ end
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'call_id' => :'callId',
88
+ :'parent_call_id' => :'parentCallId',
89
+ :'account_id' => :'accountId',
90
+ :'from' => :'from',
91
+ :'to' => :'to',
92
+ :'phone_number_id' => :'phoneNumberId',
93
+ :'status' => :'status',
94
+ :'start_time' => :'startTime',
95
+ :'connect_time' => :'connectTime',
96
+ :'end_time' => :'endTime',
97
+ :'duration' => :'duration',
98
+ :'connect_duration' => :'connectDuration',
99
+ :'direction' => :'direction',
100
+ :'answered_by' => :'answeredBy',
101
+ :'subresource_uris' => :'subresourceUris'
102
+ }
103
+ end
104
+
105
+ # Attribute type mapping.
106
+ def self.openapi_types
107
+ {
108
+ :'call_id' => :'String',
109
+ :'parent_call_id' => :'String',
110
+ :'account_id' => :'String',
111
+ :'from' => :'String',
112
+ :'to' => :'String',
113
+ :'phone_number_id' => :'String',
114
+ :'status' => :'String',
115
+ :'start_time' => :'String',
116
+ :'connect_time' => :'String',
117
+ :'end_time' => :'String',
118
+ :'duration' => :'Integer',
119
+ :'connect_duration' => :'Integer',
120
+ :'direction' => :'String',
121
+ :'answered_by' => :'String',
122
+ :'subresource_uris' => :'Object'
123
+ }
124
+ end
125
+
126
+ # List of attributes with nullable: true
127
+ def self.openapi_nullable
128
+ Set.new([
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallResultAllOf` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'call_id')
148
+ self.call_id = attributes[:'call_id']
149
+ end
150
+
151
+ if attributes.key?(:'parent_call_id')
152
+ self.parent_call_id = attributes[:'parent_call_id']
153
+ end
154
+
155
+ if attributes.key?(:'account_id')
156
+ self.account_id = attributes[:'account_id']
157
+ end
158
+
159
+ if attributes.key?(:'from')
160
+ self.from = attributes[:'from']
161
+ end
162
+
163
+ if attributes.key?(:'to')
164
+ self.to = attributes[:'to']
165
+ end
166
+
167
+ if attributes.key?(:'phone_number_id')
168
+ self.phone_number_id = attributes[:'phone_number_id']
169
+ end
170
+
171
+ if attributes.key?(:'status')
172
+ self.status = attributes[:'status']
173
+ end
174
+
175
+ if attributes.key?(:'start_time')
176
+ self.start_time = attributes[:'start_time']
177
+ end
178
+
179
+ if attributes.key?(:'connect_time')
180
+ self.connect_time = attributes[:'connect_time']
181
+ end
182
+
183
+ if attributes.key?(:'end_time')
184
+ self.end_time = attributes[:'end_time']
185
+ end
186
+
187
+ if attributes.key?(:'duration')
188
+ self.duration = attributes[:'duration']
189
+ end
190
+
191
+ if attributes.key?(:'connect_duration')
192
+ self.connect_duration = attributes[:'connect_duration']
193
+ end
194
+
195
+ if attributes.key?(:'direction')
196
+ self.direction = attributes[:'direction']
197
+ end
198
+
199
+ if attributes.key?(:'answered_by')
200
+ self.answered_by = attributes[:'answered_by']
201
+ end
202
+
203
+ if attributes.key?(:'subresource_uris')
204
+ self.subresource_uris = attributes[:'subresource_uris']
205
+ end
206
+ end
207
+
208
+ # Show invalid properties with the reasons. Usually used together with valid?
209
+ # @return Array for valid properties with the reasons
210
+ def list_invalid_properties
211
+ invalid_properties = Array.new
212
+ invalid_properties
213
+ end
214
+
215
+ # Check to see if the all the properties in the model are valid
216
+ # @return true if the model is valid
217
+ def valid?
218
+ status_validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
219
+ return false unless status_validator.valid?(@status)
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] status Object to be assigned
225
+ def status=(status)
226
+ validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
227
+ unless validator.valid?(status)
228
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
229
+ end
230
+ @status = status
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ call_id == o.call_id &&
239
+ parent_call_id == o.parent_call_id &&
240
+ account_id == o.account_id &&
241
+ from == o.from &&
242
+ to == o.to &&
243
+ phone_number_id == o.phone_number_id &&
244
+ status == o.status &&
245
+ start_time == o.start_time &&
246
+ connect_time == o.connect_time &&
247
+ end_time == o.end_time &&
248
+ duration == o.duration &&
249
+ connect_duration == o.connect_duration &&
250
+ direction == o.direction &&
251
+ answered_by == o.answered_by &&
252
+ subresource_uris == o.subresource_uris
253
+ end
254
+
255
+ # @see the `==` method
256
+ # @param [Object] Object to be compared
257
+ def eql?(o)
258
+ self == o
259
+ end
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Integer] Hash code
263
+ def hash
264
+ [call_id, parent_call_id, account_id, from, to, phone_number_id, status, start_time, connect_time, end_time, duration, connect_duration, direction, answered_by, subresource_uris].hash
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def self.build_from_hash(attributes)
271
+ new.build_from_hash(attributes)
272
+ end
273
+
274
+ # Builds the object from hash
275
+ # @param [Hash] attributes Model attributes in the form of hash
276
+ # @return [Object] Returns the model itself
277
+ def build_from_hash(attributes)
278
+ return nil unless attributes.is_a?(Hash)
279
+ self.class.openapi_types.each_pair do |key, type|
280
+ if type =~ /\AArray<(.*)>/i
281
+ # check to ensure the input is an array given that the attribute
282
+ # is documented as an array but the input is not
283
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
284
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
285
+ end
286
+ elsif !attributes[self.class.attribute_map[key]].nil?
287
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
288
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
289
+ end
290
+
291
+ self
292
+ end
293
+
294
+ # Deserializes the data based on type
295
+ # @param string type Data type
296
+ # @param string value Value to be deserialized
297
+ # @return [Object] Deserialized data
298
+ def _deserialize(type, value)
299
+ case type.to_sym
300
+ when :DateTime
301
+ DateTime.parse(value)
302
+ when :Date
303
+ Date.parse(value)
304
+ when :String
305
+ value.to_s
306
+ when :Integer
307
+ value.to_i
308
+ when :Float
309
+ value.to_f
310
+ when :Boolean
311
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
312
+ true
313
+ else
314
+ false
315
+ end
316
+ when :Object
317
+ # generic object (usually a Hash), return directly
318
+ value
319
+ when /\AArray<(?<inner_type>.+)>\z/
320
+ inner_type = Regexp.last_match[:inner_type]
321
+ value.map { |v| _deserialize(inner_type, v) }
322
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
323
+ k_type = Regexp.last_match[:k_type]
324
+ v_type = Regexp.last_match[:v_type]
325
+ {}.tap do |hash|
326
+ value.each do |k, v|
327
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
328
+ end
329
+ end
330
+ else # model
331
+ Freeclimb.const_get(type).build_from_hash(value)
332
+ end
333
+ end
334
+
335
+ # Returns the string representation of the object
336
+ # @return [String] String presentation of the object
337
+ def to_s
338
+ to_hash.to_s
339
+ end
340
+
341
+ # to_body is an alias to to_hash (backward compatibility)
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_body
344
+ to_hash
345
+ end
346
+
347
+ # Returns the object in the form of hash
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_hash
350
+ hash = {}
351
+ self.class.attribute_map.each_pair do |attr, param|
352
+ value = self.send(attr)
353
+ if value.nil?
354
+ is_nullable = self.class.openapi_nullable.include?(attr)
355
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
356
+ end
357
+
358
+ hash[param] = _to_hash(value)
359
+ end
360
+ hash
361
+ end
362
+
363
+ # Outputs non-array value in the form of hash
364
+ # For object, use to_hash. Otherwise, just return the value
365
+ # @param [Object] value Any valid value
366
+ # @return [Hash] Returns the value in the form of hash
367
+ def _to_hash(value)
368
+ if value.is_a?(Array)
369
+ value.compact.map { |v| _to_hash(v) }
370
+ elsif value.is_a?(Hash)
371
+ {}.tap do |hash|
372
+ value.each { |k, v| hash[k] = _to_hash(v) }
373
+ end
374
+ elsif value.respond_to? :to_hash
375
+ value.to_hash
376
+ else
377
+ value
378
+ end
379
+ end
380
+ end
381
+ end