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,287 @@
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 IncomingNumberResultAllOf
17
+ # String that uniquely identifies this phone number resource.
18
+ attr_accessor :phone_number_id
19
+
20
+ # ID of the account that owns this phone number.
21
+ attr_accessor :account_id
22
+
23
+ # ID of the Application that FreeClimb should contact if a Call or SMS arrives for this phone number or a Call from this number is placed. An incoming phone number is not useful until associated with an applicationId.
24
+ attr_accessor :application_id
25
+
26
+ # Phone number in E.164 format.
27
+ attr_accessor :phone_number
28
+
29
+ # Description for this phone number. Typically the conventionally-formatted version of the phone number.
30
+ attr_accessor :_alias
31
+
32
+ # State or province of this phone number.
33
+ attr_accessor :region
34
+
35
+ # Country of this phone number.
36
+ attr_accessor :country
37
+
38
+ # Indicates whether the phone number can handle Calls. Typically set to true for all numbers.
39
+ attr_accessor :voice_enabled
40
+
41
+ # Indication of whether the phone number can handle sending and receiving SMS messages. Typically set to true for all numbers.
42
+ attr_accessor :sms_enabled
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'phone_number_id' => :'phoneNumberId',
48
+ :'account_id' => :'accountId',
49
+ :'application_id' => :'applicationId',
50
+ :'phone_number' => :'phoneNumber',
51
+ :'_alias' => :'alias',
52
+ :'region' => :'region',
53
+ :'country' => :'country',
54
+ :'voice_enabled' => :'voiceEnabled',
55
+ :'sms_enabled' => :'smsEnabled'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'phone_number_id' => :'String',
63
+ :'account_id' => :'String',
64
+ :'application_id' => :'String',
65
+ :'phone_number' => :'String',
66
+ :'_alias' => :'String',
67
+ :'region' => :'String',
68
+ :'country' => :'String',
69
+ :'voice_enabled' => :'Boolean',
70
+ :'sms_enabled' => :'Boolean'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::IncomingNumberResultAllOf` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::IncomingNumberResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'phone_number_id')
96
+ self.phone_number_id = attributes[:'phone_number_id']
97
+ end
98
+
99
+ if attributes.key?(:'account_id')
100
+ self.account_id = attributes[:'account_id']
101
+ end
102
+
103
+ if attributes.key?(:'application_id')
104
+ self.application_id = attributes[:'application_id']
105
+ end
106
+
107
+ if attributes.key?(:'phone_number')
108
+ self.phone_number = attributes[:'phone_number']
109
+ end
110
+
111
+ if attributes.key?(:'_alias')
112
+ self._alias = attributes[:'_alias']
113
+ end
114
+
115
+ if attributes.key?(:'region')
116
+ self.region = attributes[:'region']
117
+ end
118
+
119
+ if attributes.key?(:'country')
120
+ self.country = attributes[:'country']
121
+ end
122
+
123
+ if attributes.key?(:'voice_enabled')
124
+ self.voice_enabled = attributes[:'voice_enabled']
125
+ end
126
+
127
+ if attributes.key?(:'sms_enabled')
128
+ self.sms_enabled = attributes[:'sms_enabled']
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
+ phone_number_id == o.phone_number_id &&
151
+ account_id == o.account_id &&
152
+ application_id == o.application_id &&
153
+ phone_number == o.phone_number &&
154
+ _alias == o._alias &&
155
+ region == o.region &&
156
+ country == o.country &&
157
+ voice_enabled == o.voice_enabled &&
158
+ sms_enabled == o.sms_enabled
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [phone_number_id, account_id, application_id, phone_number, _alias, region, country, voice_enabled, sms_enabled].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.openapi_types.each_pair do |key, type|
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :DateTime
207
+ DateTime.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ Freeclimb.const_get(type).build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+ end
287
+ 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 LogList
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 :logs
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
+ :'logs' => :'logs'
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
+ :'logs' => :'Array<LogResult>'
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
+ :'LogListAllOf',
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::LogList` 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::LogList`. 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?(:'logs')
126
+ if (value = attributes[:'logs']).is_a?(Array)
127
+ self.logs = 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
+ logs == o.logs
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, logs].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