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,227 @@
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 UpdateConferenceParticipantRequest
17
+ # (Optional) Default is `true`. Setting to `false` mutes the Participant. FreeClimb returns an error and ignores any other value.
18
+ attr_accessor :talk
19
+
20
+ # (Optional) Default is `true`. Setting to `false` silences the Conference for this Participant. FreeClimb returns an error and ignores any other value.
21
+ attr_accessor :listen
22
+
23
+ # ID of this request starting with prefix *RQ* followed by 40 hexadecimal characters. FreeClimb logs generated while processing this request include this requestId. If this value is not provided, FreeClimb generates a requestId and returns it as a header in the response (e.g., X-Pulse-Request-Id: <requestId>).
24
+ attr_accessor :request_id
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'talk' => :'talk',
30
+ :'listen' => :'listen',
31
+ :'request_id' => :'requestId'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'talk' => :'Boolean',
39
+ :'listen' => :'Boolean',
40
+ :'request_id' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::UpdateConferenceParticipantRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::UpdateConferenceParticipantRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'talk')
66
+ self.talk = attributes[:'talk']
67
+ end
68
+
69
+ if attributes.key?(:'listen')
70
+ self.listen = attributes[:'listen']
71
+ end
72
+
73
+ if attributes.key?(:'request_id')
74
+ self.request_id = attributes[:'request_id']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ talk == o.talk &&
97
+ listen == o.listen &&
98
+ request_id == o.request_id
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [talk, listen, request_id].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ Freeclimb.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -0,0 +1,273 @@
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 UpdateConferenceRequest
17
+ # Description for this conference. Maximum 64 characters.
18
+ attr_accessor :_alias
19
+
20
+ # Controls when a beep is played. Valid values: `always`, `never`, `entryOnly`, `exitOnly`.
21
+ attr_accessor :play_beep
22
+
23
+ # New status of the conference. Valid values: `empty` or `terminated`. For more information, see **Status Parameter** below.**
24
+ attr_accessor :status
25
+
26
+ # ID for this request starting with prefix *RQ* followed by 40 hexadecimal characters. FreeClimb logs generated while processing this request will include this requestId. If it is not provided, FreeClimb will generate a requestId and return it as a header in the response (e.g. X-Pulse-Request-Id: <requestId>).
27
+ attr_accessor :request_id
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'_alias' => :'alias',
55
+ :'play_beep' => :'playBeep',
56
+ :'status' => :'status',
57
+ :'request_id' => :'requestId'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'_alias' => :'String',
65
+ :'play_beep' => :'String',
66
+ :'status' => :'String',
67
+ :'request_id' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::UpdateConferenceRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::UpdateConferenceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'_alias')
93
+ self._alias = attributes[:'_alias']
94
+ end
95
+
96
+ if attributes.key?(:'play_beep')
97
+ self.play_beep = attributes[:'play_beep']
98
+ else
99
+ self.play_beep = 'always'
100
+ end
101
+
102
+ if attributes.key?(:'status')
103
+ self.status = attributes[:'status']
104
+ end
105
+
106
+ if attributes.key?(:'request_id')
107
+ self.request_id = attributes[:'request_id']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ status_validator = EnumAttributeValidator.new('String', ["empty", "terminated"])
122
+ return false unless status_validator.valid?(@status)
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method checking allowed values (enum).
127
+ # @param [Object] status Object to be assigned
128
+ def status=(status)
129
+ validator = EnumAttributeValidator.new('String', ["empty", "terminated"])
130
+ unless validator.valid?(status)
131
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
132
+ end
133
+ @status = status
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ _alias == o._alias &&
142
+ play_beep == o.play_beep &&
143
+ status == o.status &&
144
+ request_id == o.request_id
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [_alias, play_beep, status, request_id].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.openapi_types.each_pair do |key, type|
172
+ if type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :DateTime
193
+ DateTime.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ Freeclimb.const_get(type).build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+ end
273
+ end