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,391 @@
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 ConferenceResult
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
+ # A string that uniquely identifies this Conference resource.
30
+ attr_accessor :conference_id
31
+
32
+ # ID of the account that created this Conference.
33
+ attr_accessor :account_id
34
+
35
+ # A description for this Conference.
36
+ attr_accessor :_alias
37
+
38
+ # Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always.
39
+ attr_accessor :play_beep
40
+
41
+ # Flag indicating whether recording is enabled for this Conference.
42
+ attr_accessor :record
43
+
44
+ # The status of the Conference. One of: creating, empty, populated, inProgress, or terminated.
45
+ attr_accessor :status
46
+
47
+ # URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state.
48
+ attr_accessor :wait_url
49
+
50
+ # URL invoked once the Conference is successfully created.
51
+ attr_accessor :action_url
52
+
53
+ # URL to inform that the Conference status has changed.
54
+ attr_accessor :status_callback_url
55
+
56
+ # The list of subresources for this Conference. This includes participants and/or recordings.
57
+ attr_accessor :subresource_uris
58
+
59
+ class EnumAttributeValidator
60
+ attr_reader :datatype
61
+ attr_reader :allowable_values
62
+
63
+ def initialize(datatype, allowable_values)
64
+ @allowable_values = allowable_values.map do |value|
65
+ case datatype.to_s
66
+ when /Integer/i
67
+ value.to_i
68
+ when /Float/i
69
+ value.to_f
70
+ else
71
+ value
72
+ end
73
+ end
74
+ end
75
+
76
+ def valid?(value)
77
+ !value || allowable_values.include?(value)
78
+ end
79
+ end
80
+
81
+ # Attribute mapping from ruby-style variable name to JSON key.
82
+ def self.attribute_map
83
+ {
84
+ :'uri' => :'uri',
85
+ :'date_created' => :'dateCreated',
86
+ :'date_updated' => :'dateUpdated',
87
+ :'revision' => :'revision',
88
+ :'conference_id' => :'conferenceId',
89
+ :'account_id' => :'accountId',
90
+ :'_alias' => :'alias',
91
+ :'play_beep' => :'playBeep',
92
+ :'record' => :'record',
93
+ :'status' => :'status',
94
+ :'wait_url' => :'waitUrl',
95
+ :'action_url' => :'actionUrl',
96
+ :'status_callback_url' => :'statusCallbackUrl',
97
+ :'subresource_uris' => :'subresourceUris'
98
+ }
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'uri' => :'String',
105
+ :'date_created' => :'String',
106
+ :'date_updated' => :'String',
107
+ :'revision' => :'Integer',
108
+ :'conference_id' => :'String',
109
+ :'account_id' => :'String',
110
+ :'_alias' => :'String',
111
+ :'play_beep' => :'String',
112
+ :'record' => :'Boolean',
113
+ :'status' => :'String',
114
+ :'wait_url' => :'String',
115
+ :'action_url' => :'String',
116
+ :'status_callback_url' => :'String',
117
+ :'subresource_uris' => :'Object'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ ])
125
+ end
126
+
127
+ # List of class defined in allOf (OpenAPI v3)
128
+ def self.openapi_all_of
129
+ [
130
+ :'ConferenceResultAllOf',
131
+ :'MutableResourceModel'
132
+ ]
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ if (!attributes.is_a?(Hash))
139
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceResult` initialize method"
140
+ end
141
+
142
+ # check to see if the attribute exists and convert string to symbol for hash key
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!self.class.attribute_map.key?(k.to_sym))
145
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'uri')
151
+ self.uri = attributes[:'uri']
152
+ end
153
+
154
+ if attributes.key?(:'date_created')
155
+ self.date_created = attributes[:'date_created']
156
+ end
157
+
158
+ if attributes.key?(:'date_updated')
159
+ self.date_updated = attributes[:'date_updated']
160
+ end
161
+
162
+ if attributes.key?(:'revision')
163
+ self.revision = attributes[:'revision']
164
+ end
165
+
166
+ if attributes.key?(:'conference_id')
167
+ self.conference_id = attributes[:'conference_id']
168
+ end
169
+
170
+ if attributes.key?(:'account_id')
171
+ self.account_id = attributes[:'account_id']
172
+ end
173
+
174
+ if attributes.key?(:'_alias')
175
+ self._alias = attributes[:'_alias']
176
+ end
177
+
178
+ if attributes.key?(:'play_beep')
179
+ self.play_beep = attributes[:'play_beep']
180
+ end
181
+
182
+ if attributes.key?(:'record')
183
+ self.record = attributes[:'record']
184
+ end
185
+
186
+ if attributes.key?(:'status')
187
+ self.status = attributes[:'status']
188
+ end
189
+
190
+ if attributes.key?(:'wait_url')
191
+ self.wait_url = attributes[:'wait_url']
192
+ end
193
+
194
+ if attributes.key?(:'action_url')
195
+ self.action_url = attributes[:'action_url']
196
+ end
197
+
198
+ if attributes.key?(:'status_callback_url')
199
+ self.status_callback_url = attributes[:'status_callback_url']
200
+ end
201
+
202
+ if attributes.key?(:'subresource_uris')
203
+ self.subresource_uris = attributes[:'subresource_uris']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ invalid_properties = Array.new
211
+ invalid_properties
212
+ end
213
+
214
+ # Check to see if the all the properties in the model are valid
215
+ # @return true if the model is valid
216
+ def valid?
217
+ play_beep_validator = EnumAttributeValidator.new('String', ["always", "never", "entryOnly", "exitOnly"])
218
+ return false unless play_beep_validator.valid?(@play_beep)
219
+ status_validator = EnumAttributeValidator.new('String', ["creating", "empty", "populated", "inProgress", "terminated"])
220
+ return false unless status_validator.valid?(@status)
221
+ true
222
+ end
223
+
224
+ # Custom attribute writer method checking allowed values (enum).
225
+ # @param [Object] play_beep Object to be assigned
226
+ def play_beep=(play_beep)
227
+ validator = EnumAttributeValidator.new('String', ["always", "never", "entryOnly", "exitOnly"])
228
+ unless validator.valid?(play_beep)
229
+ fail ArgumentError, "invalid value for \"play_beep\", must be one of #{validator.allowable_values}."
230
+ end
231
+ @play_beep = play_beep
232
+ end
233
+
234
+ # Custom attribute writer method checking allowed values (enum).
235
+ # @param [Object] status Object to be assigned
236
+ def status=(status)
237
+ validator = EnumAttributeValidator.new('String', ["creating", "empty", "populated", "inProgress", "terminated"])
238
+ unless validator.valid?(status)
239
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
240
+ end
241
+ @status = status
242
+ end
243
+
244
+ # Checks equality by comparing each attribute.
245
+ # @param [Object] Object to be compared
246
+ def ==(o)
247
+ return true if self.equal?(o)
248
+ self.class == o.class &&
249
+ uri == o.uri &&
250
+ date_created == o.date_created &&
251
+ date_updated == o.date_updated &&
252
+ revision == o.revision &&
253
+ conference_id == o.conference_id &&
254
+ account_id == o.account_id &&
255
+ _alias == o._alias &&
256
+ play_beep == o.play_beep &&
257
+ record == o.record &&
258
+ status == o.status &&
259
+ wait_url == o.wait_url &&
260
+ action_url == o.action_url &&
261
+ status_callback_url == o.status_callback_url &&
262
+ subresource_uris == o.subresource_uris
263
+ end
264
+
265
+ # @see the `==` method
266
+ # @param [Object] Object to be compared
267
+ def eql?(o)
268
+ self == o
269
+ end
270
+
271
+ # Calculates hash code according to all attributes.
272
+ # @return [Integer] Hash code
273
+ def hash
274
+ [uri, date_created, date_updated, revision, conference_id, account_id, _alias, play_beep, record, status, wait_url, action_url, status_callback_url, subresource_uris].hash
275
+ end
276
+
277
+ # Builds the object from hash
278
+ # @param [Hash] attributes Model attributes in the form of hash
279
+ # @return [Object] Returns the model itself
280
+ def self.build_from_hash(attributes)
281
+ new.build_from_hash(attributes)
282
+ end
283
+
284
+ # Builds the object from hash
285
+ # @param [Hash] attributes Model attributes in the form of hash
286
+ # @return [Object] Returns the model itself
287
+ def build_from_hash(attributes)
288
+ return nil unless attributes.is_a?(Hash)
289
+ self.class.openapi_types.each_pair do |key, type|
290
+ if type =~ /\AArray<(.*)>/i
291
+ # check to ensure the input is an array given that the attribute
292
+ # is documented as an array but the input is not
293
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
294
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
295
+ end
296
+ elsif !attributes[self.class.attribute_map[key]].nil?
297
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
298
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
299
+ end
300
+
301
+ self
302
+ end
303
+
304
+ # Deserializes the data based on type
305
+ # @param string type Data type
306
+ # @param string value Value to be deserialized
307
+ # @return [Object] Deserialized data
308
+ def _deserialize(type, value)
309
+ case type.to_sym
310
+ when :DateTime
311
+ DateTime.parse(value)
312
+ when :Date
313
+ Date.parse(value)
314
+ when :String
315
+ value.to_s
316
+ when :Integer
317
+ value.to_i
318
+ when :Float
319
+ value.to_f
320
+ when :Boolean
321
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
322
+ true
323
+ else
324
+ false
325
+ end
326
+ when :Object
327
+ # generic object (usually a Hash), return directly
328
+ value
329
+ when /\AArray<(?<inner_type>.+)>\z/
330
+ inner_type = Regexp.last_match[:inner_type]
331
+ value.map { |v| _deserialize(inner_type, v) }
332
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
333
+ k_type = Regexp.last_match[:k_type]
334
+ v_type = Regexp.last_match[:v_type]
335
+ {}.tap do |hash|
336
+ value.each do |k, v|
337
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
338
+ end
339
+ end
340
+ else # model
341
+ Freeclimb.const_get(type).build_from_hash(value)
342
+ end
343
+ end
344
+
345
+ # Returns the string representation of the object
346
+ # @return [String] String presentation of the object
347
+ def to_s
348
+ to_hash.to_s
349
+ end
350
+
351
+ # to_body is an alias to to_hash (backward compatibility)
352
+ # @return [Hash] Returns the object in the form of hash
353
+ def to_body
354
+ to_hash
355
+ end
356
+
357
+ # Returns the object in the form of hash
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_hash
360
+ hash = {}
361
+ self.class.attribute_map.each_pair do |attr, param|
362
+ value = self.send(attr)
363
+ if value.nil?
364
+ is_nullable = self.class.openapi_nullable.include?(attr)
365
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
366
+ end
367
+
368
+ hash[param] = _to_hash(value)
369
+ end
370
+ hash
371
+ end
372
+
373
+ # Outputs non-array value in the form of hash
374
+ # For object, use to_hash. Otherwise, just return the value
375
+ # @param [Object] value Any valid value
376
+ # @return [Hash] Returns the value in the form of hash
377
+ def _to_hash(value)
378
+ if value.is_a?(Array)
379
+ value.compact.map { |v| _to_hash(v) }
380
+ elsif value.is_a?(Hash)
381
+ {}.tap do |hash|
382
+ value.each { |k, v| hash[k] = _to_hash(v) }
383
+ end
384
+ elsif value.respond_to? :to_hash
385
+ value.to_hash
386
+ else
387
+ value
388
+ end
389
+ end
390
+ end
391
+ end
@@ -0,0 +1,343 @@
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 ConferenceResultAllOf
17
+ # A string that uniquely identifies this Conference resource.
18
+ attr_accessor :conference_id
19
+
20
+ # ID of the account that created this Conference.
21
+ attr_accessor :account_id
22
+
23
+ # A description for this Conference.
24
+ attr_accessor :_alias
25
+
26
+ # Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always.
27
+ attr_accessor :play_beep
28
+
29
+ # Flag indicating whether recording is enabled for this Conference.
30
+ attr_accessor :record
31
+
32
+ # The status of the Conference. One of: creating, empty, populated, inProgress, or terminated.
33
+ attr_accessor :status
34
+
35
+ # URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state.
36
+ attr_accessor :wait_url
37
+
38
+ # URL invoked once the Conference is successfully created.
39
+ attr_accessor :action_url
40
+
41
+ # URL to inform that the Conference status has changed.
42
+ attr_accessor :status_callback_url
43
+
44
+ # The list of subresources for this Conference. This includes participants and/or recordings.
45
+ attr_accessor :subresource_uris
46
+
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'conference_id' => :'conferenceId',
73
+ :'account_id' => :'accountId',
74
+ :'_alias' => :'alias',
75
+ :'play_beep' => :'playBeep',
76
+ :'record' => :'record',
77
+ :'status' => :'status',
78
+ :'wait_url' => :'waitUrl',
79
+ :'action_url' => :'actionUrl',
80
+ :'status_callback_url' => :'statusCallbackUrl',
81
+ :'subresource_uris' => :'subresourceUris'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'conference_id' => :'String',
89
+ :'account_id' => :'String',
90
+ :'_alias' => :'String',
91
+ :'play_beep' => :'String',
92
+ :'record' => :'Boolean',
93
+ :'status' => :'String',
94
+ :'wait_url' => :'String',
95
+ :'action_url' => :'String',
96
+ :'status_callback_url' => :'String',
97
+ :'subresource_uris' => :'Object'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceResultAllOf` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h|
116
+ if (!self.class.attribute_map.key?(k.to_sym))
117
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
+ end
119
+ h[k.to_sym] = v
120
+ }
121
+
122
+ if attributes.key?(:'conference_id')
123
+ self.conference_id = attributes[:'conference_id']
124
+ end
125
+
126
+ if attributes.key?(:'account_id')
127
+ self.account_id = attributes[:'account_id']
128
+ end
129
+
130
+ if attributes.key?(:'_alias')
131
+ self._alias = attributes[:'_alias']
132
+ end
133
+
134
+ if attributes.key?(:'play_beep')
135
+ self.play_beep = attributes[:'play_beep']
136
+ end
137
+
138
+ if attributes.key?(:'record')
139
+ self.record = attributes[:'record']
140
+ end
141
+
142
+ if attributes.key?(:'status')
143
+ self.status = attributes[:'status']
144
+ end
145
+
146
+ if attributes.key?(:'wait_url')
147
+ self.wait_url = attributes[:'wait_url']
148
+ end
149
+
150
+ if attributes.key?(:'action_url')
151
+ self.action_url = attributes[:'action_url']
152
+ end
153
+
154
+ if attributes.key?(:'status_callback_url')
155
+ self.status_callback_url = attributes[:'status_callback_url']
156
+ end
157
+
158
+ if attributes.key?(:'subresource_uris')
159
+ self.subresource_uris = attributes[:'subresource_uris']
160
+ end
161
+ end
162
+
163
+ # Show invalid properties with the reasons. Usually used together with valid?
164
+ # @return Array for valid properties with the reasons
165
+ def list_invalid_properties
166
+ invalid_properties = Array.new
167
+ invalid_properties
168
+ end
169
+
170
+ # Check to see if the all the properties in the model are valid
171
+ # @return true if the model is valid
172
+ def valid?
173
+ play_beep_validator = EnumAttributeValidator.new('String', ["always", "never", "entryOnly", "exitOnly"])
174
+ return false unless play_beep_validator.valid?(@play_beep)
175
+ status_validator = EnumAttributeValidator.new('String', ["creating", "empty", "populated", "inProgress", "terminated"])
176
+ return false unless status_validator.valid?(@status)
177
+ true
178
+ end
179
+
180
+ # Custom attribute writer method checking allowed values (enum).
181
+ # @param [Object] play_beep Object to be assigned
182
+ def play_beep=(play_beep)
183
+ validator = EnumAttributeValidator.new('String', ["always", "never", "entryOnly", "exitOnly"])
184
+ unless validator.valid?(play_beep)
185
+ fail ArgumentError, "invalid value for \"play_beep\", must be one of #{validator.allowable_values}."
186
+ end
187
+ @play_beep = play_beep
188
+ end
189
+
190
+ # Custom attribute writer method checking allowed values (enum).
191
+ # @param [Object] status Object to be assigned
192
+ def status=(status)
193
+ validator = EnumAttributeValidator.new('String', ["creating", "empty", "populated", "inProgress", "terminated"])
194
+ unless validator.valid?(status)
195
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
196
+ end
197
+ @status = status
198
+ end
199
+
200
+ # Checks equality by comparing each attribute.
201
+ # @param [Object] Object to be compared
202
+ def ==(o)
203
+ return true if self.equal?(o)
204
+ self.class == o.class &&
205
+ conference_id == o.conference_id &&
206
+ account_id == o.account_id &&
207
+ _alias == o._alias &&
208
+ play_beep == o.play_beep &&
209
+ record == o.record &&
210
+ status == o.status &&
211
+ wait_url == o.wait_url &&
212
+ action_url == o.action_url &&
213
+ status_callback_url == o.status_callback_url &&
214
+ subresource_uris == o.subresource_uris
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [conference_id, account_id, _alias, play_beep, record, status, wait_url, action_url, status_callback_url, subresource_uris].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ self.class.openapi_types.each_pair do |key, type|
242
+ if type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
246
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
250
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
251
+ end
252
+
253
+ self
254
+ end
255
+
256
+ # Deserializes the data based on type
257
+ # @param string type Data type
258
+ # @param string value Value to be deserialized
259
+ # @return [Object] Deserialized data
260
+ def _deserialize(type, value)
261
+ case type.to_sym
262
+ when :DateTime
263
+ DateTime.parse(value)
264
+ when :Date
265
+ Date.parse(value)
266
+ when :String
267
+ value.to_s
268
+ when :Integer
269
+ value.to_i
270
+ when :Float
271
+ value.to_f
272
+ when :Boolean
273
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
274
+ true
275
+ else
276
+ false
277
+ end
278
+ when :Object
279
+ # generic object (usually a Hash), return directly
280
+ value
281
+ when /\AArray<(?<inner_type>.+)>\z/
282
+ inner_type = Regexp.last_match[:inner_type]
283
+ value.map { |v| _deserialize(inner_type, v) }
284
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
285
+ k_type = Regexp.last_match[:k_type]
286
+ v_type = Regexp.last_match[:v_type]
287
+ {}.tap do |hash|
288
+ value.each do |k, v|
289
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
290
+ end
291
+ end
292
+ else # model
293
+ Freeclimb.const_get(type).build_from_hash(value)
294
+ end
295
+ end
296
+
297
+ # Returns the string representation of the object
298
+ # @return [String] String presentation of the object
299
+ def to_s
300
+ to_hash.to_s
301
+ end
302
+
303
+ # to_body is an alias to to_hash (backward compatibility)
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_body
306
+ to_hash
307
+ end
308
+
309
+ # Returns the object in the form of hash
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_hash
312
+ hash = {}
313
+ self.class.attribute_map.each_pair do |attr, param|
314
+ value = self.send(attr)
315
+ if value.nil?
316
+ is_nullable = self.class.openapi_nullable.include?(attr)
317
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
+ end
319
+
320
+ hash[param] = _to_hash(value)
321
+ end
322
+ hash
323
+ end
324
+
325
+ # Outputs non-array value in the form of hash
326
+ # For object, use to_hash. Otherwise, just return the value
327
+ # @param [Object] value Any valid value
328
+ # @return [Hash] Returns the value in the form of hash
329
+ def _to_hash(value)
330
+ if value.is_a?(Array)
331
+ value.compact.map { |v| _to_hash(v) }
332
+ elsif value.is_a?(Hash)
333
+ {}.tap do |hash|
334
+ value.each { |k, v| hash[k] = _to_hash(v) }
335
+ end
336
+ elsif value.respond_to? :to_hash
337
+ value.to_hash
338
+ else
339
+ value
340
+ end
341
+ end
342
+ end
343
+ end