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,252 @@
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 SayAllOf
17
+ # The message to be played to the caller using TTS. The size of the string is limited to 4 KB (or 4,096 bytes). An empty string will cause the command to be skipped.
18
+ attr_accessor :text
19
+
20
+ # Language and (by implication) the locale to use. This implies the accent and pronunciations to be usde for the TTS. The complete list of valid values for the language attribute is shown below.
21
+ attr_accessor :language
22
+
23
+ # Number of times the text is said. Specifying '0' causes the `Say` action to loop until the Call is hung up.
24
+ attr_accessor :loop
25
+
26
+ # D of the Conference the speech should be rendered to. If this is not specified, the speech is by default rendered to the Caller associated with the call leg that corresponds to the current PerCL execution context. The call leg associated with this command must be in the specified Conference or the command will return an error.
27
+ attr_accessor :conference_id
28
+
29
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
30
+ attr_accessor :privacy_mode
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'text' => :'text',
36
+ :'language' => :'language',
37
+ :'loop' => :'loop',
38
+ :'conference_id' => :'conferenceId',
39
+ :'privacy_mode' => :'privacyMode'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'text' => :'String',
47
+ :'language' => :'String',
48
+ :'loop' => :'Integer',
49
+ :'conference_id' => :'String',
50
+ :'privacy_mode' => :'Boolean'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SayAllOf` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SayAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'text')
76
+ self.text = attributes[:'text']
77
+ end
78
+
79
+ if attributes.key?(:'language')
80
+ self.language = attributes[:'language']
81
+ end
82
+
83
+ if attributes.key?(:'loop')
84
+ self.loop = attributes[:'loop']
85
+ end
86
+
87
+ if attributes.key?(:'conference_id')
88
+ self.conference_id = attributes[:'conference_id']
89
+ end
90
+
91
+ if attributes.key?(:'privacy_mode')
92
+ self.privacy_mode = attributes[:'privacy_mode']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ if @text.nil?
101
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @text.nil?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ text == o.text &&
120
+ language == o.language &&
121
+ loop == o.loop &&
122
+ conference_id == o.conference_id &&
123
+ privacy_mode == o.privacy_mode
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [text, language, loop, conference_id, privacy_mode].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ new.build_from_hash(attributes)
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :DateTime
172
+ DateTime.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ Freeclimb.const_get(type).build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+ end
252
+ end
@@ -0,0 +1,245 @@
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 `SendDigits` command plays DTMF tones on a live Call. This is useful for navigating through IVR menus or dialing extensions.
17
+ class SendDigits < PerclCommand
18
+ # 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.
19
+ attr_accessor :digits
20
+
21
+ # Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint.
22
+ attr_accessor :pause_ms
23
+
24
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
25
+ attr_accessor :privacy_mode
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'digits' => :'digits',
31
+ :'pause_ms' => :'pauseMs',
32
+ :'privacy_mode' => :'privacyMode'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'digits' => :'String',
40
+ :'pause_ms' => :'Integer',
41
+ :'privacy_mode' => :'Boolean'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # List of class defined in allOf (OpenAPI v3)
52
+ def self.openapi_all_of
53
+ [
54
+ :'PerclCommand',
55
+ :'SendDigitsAllOf'
56
+ ]
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SendDigits` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SendDigits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ # call parent's initialize
75
+ super(attributes)
76
+
77
+ if attributes.key?(:'digits')
78
+ self.digits = attributes[:'digits']
79
+ end
80
+
81
+ if attributes.key?(:'pause_ms')
82
+ self.pause_ms = attributes[:'pause_ms']
83
+ end
84
+
85
+ if attributes.key?(:'privacy_mode')
86
+ self.privacy_mode = attributes[:'privacy_mode']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = super
94
+ if @digits.nil?
95
+ invalid_properties.push('invalid value for "digits", digits cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return false if @digits.nil?
105
+ true && super
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ digits == o.digits &&
114
+ pause_ms == o.pause_ms &&
115
+ privacy_mode == o.privacy_mode && super(o)
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [digits, pause_ms, privacy_mode].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ super(attributes)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ Freeclimb.const_get(type).build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = super
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ if value.nil?
218
+ is_nullable = self.class.openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+ end
245
+ end