freeclimb 1.0.0 → 2.0.2

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