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,301 @@
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 AccountResultAllOf
17
+ # String that uniquely identifies this account resource.
18
+ attr_accessor :account_id
19
+
20
+ # The authorization token assigned to this account. This token must be kept a secret by the customer.
21
+ attr_accessor :auth_token
22
+
23
+ # A description for this account.
24
+ attr_accessor :_alias
25
+
26
+ # A string that identifies a category or group to which the account belongs.
27
+ attr_accessor :label
28
+
29
+ # The type of this account. It is one of: trial or full.
30
+ attr_accessor :type
31
+
32
+ # The status of this account. It is one of: active, suspended, or closed.
33
+ attr_accessor :status
34
+
35
+ # The list of subresources for this account.
36
+ attr_accessor :subresource_uris
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'account_id' => :'accountId',
64
+ :'auth_token' => :'authToken',
65
+ :'_alias' => :'alias',
66
+ :'label' => :'label',
67
+ :'type' => :'type',
68
+ :'status' => :'status',
69
+ :'subresource_uris' => :'subresourceUris'
70
+ }
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'account_id' => :'String',
77
+ :'auth_token' => :'String',
78
+ :'_alias' => :'String',
79
+ :'label' => :'String',
80
+ :'type' => :'String',
81
+ :'status' => :'String',
82
+ :'subresource_uris' => :'Object'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AccountResultAllOf` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AccountResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'account_id')
108
+ self.account_id = attributes[:'account_id']
109
+ end
110
+
111
+ if attributes.key?(:'auth_token')
112
+ self.auth_token = attributes[:'auth_token']
113
+ end
114
+
115
+ if attributes.key?(:'_alias')
116
+ self._alias = attributes[:'_alias']
117
+ end
118
+
119
+ if attributes.key?(:'label')
120
+ self.label = attributes[:'label']
121
+ end
122
+
123
+ if attributes.key?(:'type')
124
+ self.type = attributes[:'type']
125
+ end
126
+
127
+ if attributes.key?(:'status')
128
+ self.status = attributes[:'status']
129
+ end
130
+
131
+ if attributes.key?(:'subresource_uris')
132
+ self.subresource_uris = attributes[:'subresource_uris']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ status_validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
147
+ return false unless status_validator.valid?(@status)
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] status Object to be assigned
153
+ def status=(status)
154
+ validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
155
+ unless validator.valid?(status)
156
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
157
+ end
158
+ @status = status
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ account_id == o.account_id &&
167
+ auth_token == o.auth_token &&
168
+ _alias == o._alias &&
169
+ label == o.label &&
170
+ type == o.type &&
171
+ status == o.status &&
172
+ subresource_uris == o.subresource_uris
173
+ end
174
+
175
+ # @see the `==` method
176
+ # @param [Object] Object to be compared
177
+ def eql?(o)
178
+ self == o
179
+ end
180
+
181
+ # Calculates hash code according to all attributes.
182
+ # @return [Integer] Hash code
183
+ def hash
184
+ [account_id, auth_token, _alias, label, type, status, subresource_uris].hash
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def self.build_from_hash(attributes)
191
+ new.build_from_hash(attributes)
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ self.class.openapi_types.each_pair do |key, type|
200
+ if type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
204
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
205
+ end
206
+ elsif !attributes[self.class.attribute_map[key]].nil?
207
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
208
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
209
+ end
210
+
211
+ self
212
+ end
213
+
214
+ # Deserializes the data based on type
215
+ # @param string type Data type
216
+ # @param string value Value to be deserialized
217
+ # @return [Object] Deserialized data
218
+ def _deserialize(type, value)
219
+ case type.to_sym
220
+ when :DateTime
221
+ DateTime.parse(value)
222
+ when :Date
223
+ Date.parse(value)
224
+ when :String
225
+ value.to_s
226
+ when :Integer
227
+ value.to_i
228
+ when :Float
229
+ value.to_f
230
+ when :Boolean
231
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
232
+ true
233
+ else
234
+ false
235
+ end
236
+ when :Object
237
+ # generic object (usually a Hash), return directly
238
+ value
239
+ when /\AArray<(?<inner_type>.+)>\z/
240
+ inner_type = Regexp.last_match[:inner_type]
241
+ value.map { |v| _deserialize(inner_type, v) }
242
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
243
+ k_type = Regexp.last_match[:k_type]
244
+ v_type = Regexp.last_match[:v_type]
245
+ {}.tap do |hash|
246
+ value.each do |k, v|
247
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
248
+ end
249
+ end
250
+ else # model
251
+ Freeclimb.const_get(type).build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ if value.nil?
274
+ is_nullable = self.class.openapi_nullable.include?(attr)
275
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
276
+ end
277
+
278
+ hash[param] = _to_hash(value)
279
+ end
280
+ hash
281
+ end
282
+
283
+ # Outputs non-array value in the form of hash
284
+ # For object, use to_hash. Otherwise, just return the value
285
+ # @param [Object] value Any valid value
286
+ # @return [Hash] Returns the value in the form of hash
287
+ def _to_hash(value)
288
+ if value.is_a?(Array)
289
+ value.compact.map { |v| _to_hash(v) }
290
+ elsif value.is_a?(Hash)
291
+ {}.tap do |hash|
292
+ value.each { |k, v| hash[k] = _to_hash(v) }
293
+ end
294
+ elsif value.respond_to? :to_hash
295
+ value.to_hash
296
+ else
297
+ value
298
+ end
299
+ end
300
+ end
301
+ end
@@ -0,0 +1,286 @@
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 ApplicationList
17
+ # Total amount of requested resource.
18
+ attr_accessor :total
19
+
20
+ # Resource index at start of current page
21
+ attr_accessor :start
22
+
23
+ # Resource index at end of current page
24
+ attr_accessor :_end
25
+
26
+ # Current page
27
+ attr_accessor :page
28
+
29
+ # Total number of pages
30
+ attr_accessor :num_pages
31
+
32
+ # Number of items per page
33
+ attr_accessor :page_size
34
+
35
+ # Uri to retrieve the next page of items
36
+ attr_accessor :next_page_uri
37
+
38
+ attr_accessor :applications
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'total' => :'total',
44
+ :'start' => :'start',
45
+ :'_end' => :'end',
46
+ :'page' => :'page',
47
+ :'num_pages' => :'numPages',
48
+ :'page_size' => :'pageSize',
49
+ :'next_page_uri' => :'nextPageUri',
50
+ :'applications' => :'applications'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'total' => :'Integer',
58
+ :'start' => :'Integer',
59
+ :'_end' => :'Integer',
60
+ :'page' => :'Integer',
61
+ :'num_pages' => :'Integer',
62
+ :'page_size' => :'Integer',
63
+ :'next_page_uri' => :'String',
64
+ :'applications' => :'Array<ApplicationResult>'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # List of class defined in allOf (OpenAPI v3)
75
+ def self.openapi_all_of
76
+ [
77
+ :'ApplicationListAllOf',
78
+ :'PaginationModel'
79
+ ]
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ApplicationList` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ApplicationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'total')
98
+ self.total = attributes[:'total']
99
+ end
100
+
101
+ if attributes.key?(:'start')
102
+ self.start = attributes[:'start']
103
+ end
104
+
105
+ if attributes.key?(:'_end')
106
+ self._end = attributes[:'_end']
107
+ end
108
+
109
+ if attributes.key?(:'page')
110
+ self.page = attributes[:'page']
111
+ end
112
+
113
+ if attributes.key?(:'num_pages')
114
+ self.num_pages = attributes[:'num_pages']
115
+ end
116
+
117
+ if attributes.key?(:'page_size')
118
+ self.page_size = attributes[:'page_size']
119
+ end
120
+
121
+ if attributes.key?(:'next_page_uri')
122
+ self.next_page_uri = attributes[:'next_page_uri']
123
+ end
124
+
125
+ if attributes.key?(:'applications')
126
+ if (value = attributes[:'applications']).is_a?(Array)
127
+ self.applications = value
128
+ end
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ total == o.total &&
151
+ start == o.start &&
152
+ _end == o._end &&
153
+ page == o.page &&
154
+ num_pages == o.num_pages &&
155
+ page_size == o.page_size &&
156
+ next_page_uri == o.next_page_uri &&
157
+ applications == o.applications
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [total, start, _end, page, num_pages, page_size, next_page_uri, applications].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ new.build_from_hash(attributes)
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
189
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
190
+ end
191
+ elsif !attributes[self.class.attribute_map[key]].nil?
192
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
194
+ end
195
+
196
+ self
197
+ end
198
+
199
+ # Deserializes the data based on type
200
+ # @param string type Data type
201
+ # @param string value Value to be deserialized
202
+ # @return [Object] Deserialized data
203
+ def _deserialize(type, value)
204
+ case type.to_sym
205
+ when :DateTime
206
+ DateTime.parse(value)
207
+ when :Date
208
+ Date.parse(value)
209
+ when :String
210
+ value.to_s
211
+ when :Integer
212
+ value.to_i
213
+ when :Float
214
+ value.to_f
215
+ when :Boolean
216
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
+ true
218
+ else
219
+ false
220
+ end
221
+ when :Object
222
+ # generic object (usually a Hash), return directly
223
+ value
224
+ when /\AArray<(?<inner_type>.+)>\z/
225
+ inner_type = Regexp.last_match[:inner_type]
226
+ value.map { |v| _deserialize(inner_type, v) }
227
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
+ k_type = Regexp.last_match[:k_type]
229
+ v_type = Regexp.last_match[:v_type]
230
+ {}.tap do |hash|
231
+ value.each do |k, v|
232
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
+ end
234
+ end
235
+ else # model
236
+ Freeclimb.const_get(type).build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ if value.nil?
259
+ is_nullable = self.class.openapi_nullable.include?(attr)
260
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
261
+ end
262
+
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+ end
286
+ end