freeclimb 1.0.1 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +80 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +67 -42
  5. data/docs/AccountRequest.md +3 -5
  6. data/docs/AccountResult.md +12 -12
  7. data/docs/AccountResultAllOf.md +8 -8
  8. data/docs/AddToConference.md +35 -0
  9. data/docs/AddToConferenceAllOf.md +35 -0
  10. data/docs/ApplicationList.md +9 -9
  11. data/docs/ApplicationListAllOf.md +2 -2
  12. data/docs/ApplicationRequest.md +8 -10
  13. data/docs/ApplicationResult.md +14 -14
  14. data/docs/ApplicationResultAllOf.md +10 -10
  15. data/docs/AvailableNumber.md +7 -7
  16. data/docs/AvailableNumberList.md +9 -9
  17. data/docs/AvailableNumberListAllOf.md +2 -2
  18. data/docs/BuyIncomingNumberRequest.md +4 -6
  19. data/docs/CallList.md +9 -9
  20. data/docs/CallListAllOf.md +2 -2
  21. data/docs/CallResult.md +20 -20
  22. data/docs/CallResultAllOf.md +16 -16
  23. data/docs/ConferenceList.md +9 -9
  24. data/docs/ConferenceListAllOf.md +2 -2
  25. data/docs/ConferenceParticipantList.md +9 -9
  26. data/docs/ConferenceParticipantListAllOf.md +2 -2
  27. data/docs/ConferenceParticipantResult.md +11 -11
  28. data/docs/ConferenceParticipantResultAllOf.md +7 -7
  29. data/docs/ConferenceResult.md +15 -15
  30. data/docs/ConferenceResultAllOf.md +11 -11
  31. data/docs/CreateConference.md +27 -0
  32. data/docs/CreateConferenceAllOf.md +27 -0
  33. data/docs/CreateConferenceRequest.md +6 -8
  34. data/docs/DefaultApi.md +22 -38
  35. data/docs/Dequeue.md +16 -0
  36. data/docs/Enqueue.md +23 -0
  37. data/docs/EnqueueAllOf.md +23 -0
  38. data/docs/FilterLogsRequest.md +2 -4
  39. data/docs/GetDigits.md +33 -0
  40. data/docs/GetDigitsAllOf.md +33 -0
  41. data/docs/GetSpeech.md +41 -0
  42. data/docs/GetSpeechAllOf.md +41 -0
  43. data/docs/IncomingNumberList.md +9 -9
  44. data/docs/IncomingNumberListAllOf.md +2 -2
  45. data/docs/IncomingNumberRequest.md +3 -5
  46. data/docs/IncomingNumberResult.md +14 -14
  47. data/docs/IncomingNumberResultAllOf.md +10 -10
  48. data/docs/LogList.md +9 -9
  49. data/docs/LogListAllOf.md +2 -2
  50. data/docs/LogResult.md +8 -8
  51. data/docs/MakeCallRequest.md +11 -11
  52. data/docs/MessageRequest.md +10 -12
  53. data/docs/MessageRequestAllOf.md +6 -8
  54. data/docs/MessageResult.md +14 -14
  55. data/docs/MessageResultAllOf.md +10 -10
  56. data/docs/MessagesList.md +9 -9
  57. data/docs/MessagesListAllOf.md +2 -2
  58. data/docs/MutableResourceModel.md +5 -5
  59. data/docs/OutDial.md +35 -0
  60. data/docs/OutDialAllOf.md +35 -0
  61. data/docs/PaginationModel.md +8 -8
  62. data/docs/Pause.md +17 -0
  63. data/docs/PauseAllOf.md +17 -0
  64. data/docs/PerclCommand.md +17 -0
  65. data/docs/PerclScript.md +17 -0
  66. data/docs/Play.md +23 -0
  67. data/docs/PlayAllOf.md +23 -0
  68. data/docs/PlayEarlyMedia.md +17 -0
  69. data/docs/PlayEarlyMediaAllOf.md +17 -0
  70. data/docs/QueueList.md +9 -9
  71. data/docs/QueueListAllOf.md +2 -2
  72. data/docs/QueueMember.md +6 -6
  73. data/docs/QueueMemberList.md +9 -9
  74. data/docs/QueueMemberListAllOf.md +2 -2
  75. data/docs/QueueRequest.md +3 -5
  76. data/docs/QueueResult.md +12 -12
  77. data/docs/QueueResultAllOf.md +8 -8
  78. data/docs/RecordUtterance.md +27 -0
  79. data/docs/RecordUtteranceAllOf.md +27 -0
  80. data/docs/RecordingList.md +9 -9
  81. data/docs/RecordingListAllOf.md +2 -2
  82. data/docs/RecordingResult.md +10 -10
  83. data/docs/RecordingResultAllOf.md +6 -6
  84. data/docs/Redirect.md +17 -0
  85. data/docs/RedirectAllOf.md +17 -0
  86. data/docs/RemoveFromConference.md +17 -0
  87. data/docs/RemoveFromConferenceAllOf.md +17 -0
  88. data/docs/Say.md +25 -0
  89. data/docs/SayAllOf.md +25 -0
  90. data/docs/SendDigits.md +21 -0
  91. data/docs/SendDigitsAllOf.md +21 -0
  92. data/docs/SetListen.md +19 -0
  93. data/docs/SetListenAllOf.md +19 -0
  94. data/docs/SetTalk.md +19 -0
  95. data/docs/SetTalkAllOf.md +19 -0
  96. data/docs/Sms.md +23 -0
  97. data/docs/SmsAllOf.md +23 -0
  98. data/docs/StartRecordCall.md +16 -0
  99. data/docs/TerminateConference.md +17 -0
  100. data/docs/TerminateConferenceAllOf.md +17 -0
  101. data/docs/UpdateCallRequest.md +2 -4
  102. data/docs/UpdateConferenceParticipantRequest.md +3 -5
  103. data/docs/UpdateConferenceRequest.md +4 -6
  104. data/freeclimb-2.1.0.gem +0 -0
  105. data/lib/freeclimb.rb +69 -2
  106. data/lib/freeclimb/api/default_api.rb +42 -34
  107. data/lib/freeclimb/api_client.rb +1 -1
  108. data/lib/freeclimb/models/account_request.rb +4 -14
  109. data/lib/freeclimb/models/add_to_conference.rb +320 -0
  110. data/lib/freeclimb/models/add_to_conference_all_of.rb +307 -0
  111. data/lib/freeclimb/models/application_request.rb +4 -14
  112. data/lib/freeclimb/models/buy_incoming_number_request.rb +4 -14
  113. data/lib/freeclimb/models/create_conference.rb +275 -0
  114. data/lib/freeclimb/models/create_conference_all_of.rb +262 -0
  115. data/lib/freeclimb/models/create_conference_request.rb +4 -14
  116. data/lib/freeclimb/models/dequeue.rb +209 -0
  117. data/lib/freeclimb/models/enqueue.rb +265 -0
  118. data/lib/freeclimb/models/enqueue_all_of.rb +252 -0
  119. data/lib/freeclimb/models/filter_logs_request.rb +4 -14
  120. data/lib/freeclimb/models/get_digits.rb +307 -0
  121. data/lib/freeclimb/models/get_digits_all_of.rb +294 -0
  122. data/lib/freeclimb/models/get_speech.rb +352 -0
  123. data/lib/freeclimb/models/get_speech_all_of.rb +339 -0
  124. data/lib/freeclimb/models/incoming_number_request.rb +4 -14
  125. data/lib/freeclimb/models/make_call_request.rb +14 -14
  126. data/lib/freeclimb/models/message_request.rb +1 -11
  127. data/lib/freeclimb/models/message_request_all_of.rb +1 -11
  128. data/lib/freeclimb/models/message_result.rb +3 -3
  129. data/lib/freeclimb/models/message_result_all_of.rb +3 -3
  130. data/lib/freeclimb/models/out_dial.rb +330 -0
  131. data/lib/freeclimb/models/out_dial_all_of.rb +317 -0
  132. data/lib/freeclimb/models/pause.rb +225 -0
  133. data/lib/freeclimb/models/{dequeue_member_request.rb → pause_all_of.rb} +16 -11
  134. data/lib/freeclimb/models/percl_command.rb +211 -0
  135. data/lib/freeclimb/models/percl_script.rb +210 -0
  136. data/lib/freeclimb/models/play.rb +255 -0
  137. data/lib/freeclimb/models/play_all_of.rb +242 -0
  138. data/lib/freeclimb/models/play_early_media.rb +225 -0
  139. data/lib/freeclimb/models/play_early_media_all_of.rb +212 -0
  140. data/lib/freeclimb/models/queue_request.rb +4 -14
  141. data/lib/freeclimb/models/record_utterance.rb +275 -0
  142. data/lib/freeclimb/models/record_utterance_all_of.rb +262 -0
  143. data/lib/freeclimb/models/redirect.rb +220 -0
  144. data/lib/freeclimb/models/redirect_all_of.rb +207 -0
  145. data/lib/freeclimb/models/remove_from_conference.rb +225 -0
  146. data/lib/freeclimb/models/remove_from_conference_all_of.rb +212 -0
  147. data/lib/freeclimb/models/say.rb +265 -0
  148. data/lib/freeclimb/models/say_all_of.rb +252 -0
  149. data/lib/freeclimb/models/send_digits.rb +245 -0
  150. data/lib/freeclimb/models/send_digits_all_of.rb +232 -0
  151. data/lib/freeclimb/models/set_listen.rb +235 -0
  152. data/lib/freeclimb/models/set_listen_all_of.rb +222 -0
  153. data/lib/freeclimb/models/set_talk.rb +235 -0
  154. data/lib/freeclimb/models/set_talk_all_of.rb +222 -0
  155. data/lib/freeclimb/models/sms.rb +265 -0
  156. data/lib/freeclimb/models/sms_all_of.rb +252 -0
  157. data/lib/freeclimb/models/start_record_call.rb +209 -0
  158. data/lib/freeclimb/models/terminate_conference.rb +225 -0
  159. data/lib/freeclimb/models/terminate_conference_all_of.rb +212 -0
  160. data/lib/freeclimb/models/update_call_request.rb +4 -14
  161. data/lib/freeclimb/models/update_conference_participant_request.rb +4 -14
  162. data/lib/freeclimb/models/update_conference_request.rb +4 -14
  163. data/lib/freeclimb/version.rb +1 -1
  164. data/spec/api/default_api_spec.rb +9 -24
  165. data/spec/models/add_to_conference_spec.rb +95 -0
  166. data/spec/models/create_conference_spec.rb +71 -0
  167. data/spec/models/{dequeue_member_request_spec.rb → dequeue_spec.rb} +8 -7
  168. data/spec/models/enqueue_spec.rb +59 -0
  169. data/spec/models/get_digits_spec.rb +83 -0
  170. data/spec/models/get_speech_spec.rb +113 -0
  171. data/spec/models/out_dial_spec.rb +89 -0
  172. data/spec/models/pause_spec.rb +41 -0
  173. data/spec/models/percl_command_spec.rb +41 -0
  174. data/spec/models/percl_script_spec.rb +41 -0
  175. data/spec/models/play_early_media_spec.rb +41 -0
  176. data/spec/models/play_spec.rb +53 -0
  177. data/spec/models/record_utterance_spec.rb +71 -0
  178. data/spec/models/redirect_spec.rb +41 -0
  179. data/spec/models/remove_from_conference_spec.rb +41 -0
  180. data/spec/models/say_spec.rb +65 -0
  181. data/spec/models/send_digits_spec.rb +47 -0
  182. data/spec/models/set_listen_spec.rb +47 -0
  183. data/spec/models/set_talk_spec.rb +47 -0
  184. data/spec/models/sms_spec.rb +59 -0
  185. data/spec/models/start_record_call_spec.rb +35 -0
  186. data/spec/models/terminate_conference_spec.rb +41 -0
  187. metadata +128 -34
  188. data/docs/DequeueMemberRequest.md +0 -17
  189. data/docs/Percl.md +0 -697
  190. data/lib/percl/calls.rb +0 -43
  191. data/lib/percl/conference_participants.rb +0 -40
  192. data/lib/percl/conferences.rb +0 -21
  193. data/lib/percl/ivr.rb +0 -63
  194. data/lib/percl/jsonable.rb +0 -23
  195. data/lib/percl/percl.rb +0 -29
  196. data/lib/percl/queue_members.rb +0 -15
  197. data/lib/percl/recordings.rb +0 -15
  198. data/lib/percl/sms.rb +0 -11
  199. data/spec/percl/calls_spec.rb +0 -111
  200. data/spec/percl/conference_participant_spec.rb +0 -96
  201. data/spec/percl/conference_spec.rb +0 -46
  202. data/spec/percl/ivr_spec.rb +0 -155
  203. data/spec/percl/jsonable_spec.rb +0 -28
  204. data/spec/percl/percl_spec.rb +0 -31
  205. data/spec/percl/queue_members_spec.rb +0 -35
  206. data/spec/percl/recordings_spec.rb +0 -32
  207. data/spec/percl/sms_spec.rb +0 -29
@@ -0,0 +1,232 @@
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 SendDigitsAllOf
17
+ # String containing the digits to be played. The string cannot be empty and can include any digit, plus `#`, or `*`, and allows embedding specification for delay or pause between the output of individual digits.
18
+ attr_accessor :digits
19
+
20
+ # Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint.
21
+ attr_accessor :pause_ms
22
+
23
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
24
+ attr_accessor :privacy_mode
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'digits' => :'digits',
30
+ :'pause_ms' => :'pauseMs',
31
+ :'privacy_mode' => :'privacyMode'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'digits' => :'String',
39
+ :'pause_ms' => :'Integer',
40
+ :'privacy_mode' => :'Boolean'
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::SendDigitsAllOf` 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::SendDigitsAllOf`. 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?(:'digits')
66
+ self.digits = attributes[:'digits']
67
+ end
68
+
69
+ if attributes.key?(:'pause_ms')
70
+ self.pause_ms = attributes[:'pause_ms']
71
+ end
72
+
73
+ if attributes.key?(:'privacy_mode')
74
+ self.privacy_mode = attributes[:'privacy_mode']
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
+ if @digits.nil?
83
+ invalid_properties.push('invalid value for "digits", digits cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @digits.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ digits == o.digits &&
102
+ pause_ms == o.pause_ms &&
103
+ privacy_mode == o.privacy_mode
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [digits, pause_ms, privacy_mode].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ Freeclimb.const_get(type).build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+ end
232
+ end
@@ -0,0 +1,235 @@
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
+ # The `SetListen` command enables or disables the listen privilege for a Conference Participant provided both calls are in the same conference. The Participant can hear what the other participants are saying only if this privilege is enabled.
17
+ class SetListen < PerclCommand
18
+ # ID of the call leg that is to be assigned the listen privilege. The Call must be in a Conference or an error will be triggered.
19
+ attr_accessor :call_id
20
+
21
+ # Specifying `false` will silence the Conference for this Participant.
22
+ attr_accessor :listen
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'call_id' => :'callId',
28
+ :'listen' => :'listen'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'call_id' => :'String',
36
+ :'listen' => :'Boolean'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # List of class defined in allOf (OpenAPI v3)
47
+ def self.openapi_all_of
48
+ [
49
+ :'PerclCommand',
50
+ :'SetListenAllOf'
51
+ ]
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SetListen` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SetListen`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ # call parent's initialize
70
+ super(attributes)
71
+
72
+ if attributes.key?(:'call_id')
73
+ self.call_id = attributes[:'call_id']
74
+ end
75
+
76
+ if attributes.key?(:'listen')
77
+ self.listen = attributes[:'listen']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = super
85
+ if @call_id.nil?
86
+ invalid_properties.push('invalid value for "call_id", call_id cannot be nil.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @call_id.nil?
96
+ true && super
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ call_id == o.call_id &&
105
+ listen == o.listen && super(o)
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [call_id, listen].hash
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 self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ super(attributes)
133
+ self.class.openapi_types.each_pair do |key, type|
134
+ if type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ Freeclimb.const_get(type).build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = super
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+ end
235
+ end