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
@@ -38,9 +38,6 @@ module Freeclimb
38
38
  # When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored.
39
39
  attr_accessor :notification_url
40
40
 
41
- # RequestId for this request, starting with prefix *RQ* followed by 40 hexadecimal characters. FreeClimb logs generated while processing this request 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>).
42
- attr_accessor :request_id
43
-
44
41
  # String that uniquely identifies this account resource.
45
42
  attr_accessor :account_id
46
43
 
@@ -55,7 +52,6 @@ module Freeclimb
55
52
  :'to' => :'to',
56
53
  :'text' => :'text',
57
54
  :'notification_url' => :'notificationUrl',
58
- :'request_id' => :'requestId',
59
55
  :'account_id' => :'accountId'
60
56
  }
61
57
  end
@@ -71,7 +67,6 @@ module Freeclimb
71
67
  :'to' => :'String',
72
68
  :'text' => :'String',
73
69
  :'notification_url' => :'String',
74
- :'request_id' => :'String',
75
70
  :'account_id' => :'String'
76
71
  }
77
72
  end
@@ -137,10 +132,6 @@ module Freeclimb
137
132
  self.notification_url = attributes[:'notification_url']
138
133
  end
139
134
 
140
- if attributes.key?(:'request_id')
141
- self.request_id = attributes[:'request_id']
142
- end
143
-
144
135
  if attributes.key?(:'account_id')
145
136
  self.account_id = attributes[:'account_id']
146
137
  end
@@ -187,7 +178,6 @@ module Freeclimb
187
178
  to == o.to &&
188
179
  text == o.text &&
189
180
  notification_url == o.notification_url &&
190
- request_id == o.request_id &&
191
181
  account_id == o.account_id
192
182
  end
193
183
 
@@ -200,7 +190,7 @@ module Freeclimb
200
190
  # Calculates hash code according to all attributes.
201
191
  # @return [Integer] Hash code
202
192
  def hash
203
- [uri, date_created, date_updated, revision, from, to, text, notification_url, request_id, account_id].hash
193
+ [uri, date_created, date_updated, revision, from, to, text, notification_url, account_id].hash
204
194
  end
205
195
 
206
196
  # Builds the object from hash
@@ -26,9 +26,6 @@ module Freeclimb
26
26
  # When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored.
27
27
  attr_accessor :notification_url
28
28
 
29
- # RequestId for this request, starting with prefix *RQ* followed by 40 hexadecimal characters. FreeClimb logs generated while processing this request 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>).
30
- attr_accessor :request_id
31
-
32
29
  # String that uniquely identifies this account resource.
33
30
  attr_accessor :account_id
34
31
 
@@ -39,7 +36,6 @@ module Freeclimb
39
36
  :'to' => :'to',
40
37
  :'text' => :'text',
41
38
  :'notification_url' => :'notificationUrl',
42
- :'request_id' => :'requestId',
43
39
  :'account_id' => :'accountId'
44
40
  }
45
41
  end
@@ -51,7 +47,6 @@ module Freeclimb
51
47
  :'to' => :'String',
52
48
  :'text' => :'String',
53
49
  :'notification_url' => :'String',
54
- :'request_id' => :'String',
55
50
  :'account_id' => :'String'
56
51
  }
57
52
  end
@@ -93,10 +88,6 @@ module Freeclimb
93
88
  self.notification_url = attributes[:'notification_url']
94
89
  end
95
90
 
96
- if attributes.key?(:'request_id')
97
- self.request_id = attributes[:'request_id']
98
- end
99
-
100
91
  if attributes.key?(:'account_id')
101
92
  self.account_id = attributes[:'account_id']
102
93
  end
@@ -139,7 +130,6 @@ module Freeclimb
139
130
  to == o.to &&
140
131
  text == o.text &&
141
132
  notification_url == o.notification_url &&
142
- request_id == o.request_id &&
143
133
  account_id == o.account_id
144
134
  end
145
135
 
@@ -152,7 +142,7 @@ module Freeclimb
152
142
  # Calculates hash code according to all attributes.
153
143
  # @return [Integer] Hash code
154
144
  def hash
155
- [from, to, text, notification_url, request_id, account_id].hash
145
+ [from, to, text, notification_url, account_id].hash
156
146
  end
157
147
 
158
148
  # Builds the object from hash
@@ -32,7 +32,7 @@ module Freeclimb
32
32
  # String that uniquely identifies this message resource
33
33
  attr_accessor :message_id
34
34
 
35
- # Indicates the state of the message through the message lifecycle including: new, queued, rejected, sending, sent, failed, received
35
+ # Indicates the state of the message through the message lifecycle including: new, queued, rejected, sending, sent, failed, received, undelivered, expired, deleted, and unknown
36
36
  attr_accessor :status
37
37
 
38
38
  # Phone number in E.164 format that sent the message.
@@ -196,7 +196,7 @@ module Freeclimb
196
196
  # Check to see if the all the properties in the model are valid
197
197
  # @return true if the model is valid
198
198
  def valid?
199
- status_validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered"])
199
+ status_validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered", "expired", "deleted", "unknown"])
200
200
  return false unless status_validator.valid?(@status)
201
201
  true
202
202
  end
@@ -204,7 +204,7 @@ module Freeclimb
204
204
  # Custom attribute writer method checking allowed values (enum).
205
205
  # @param [Object] status Object to be assigned
206
206
  def status=(status)
207
- validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered"])
207
+ validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered", "expired", "deleted", "unknown"])
208
208
  unless validator.valid?(status)
209
209
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
210
210
  end
@@ -20,7 +20,7 @@ module Freeclimb
20
20
  # String that uniquely identifies this message resource
21
21
  attr_accessor :message_id
22
22
 
23
- # Indicates the state of the message through the message lifecycle including: new, queued, rejected, sending, sent, failed, received
23
+ # Indicates the state of the message through the message lifecycle including: new, queued, rejected, sending, sent, failed, received, undelivered, expired, deleted, and unknown
24
24
  attr_accessor :status
25
25
 
26
26
  # Phone number in E.164 format that sent the message.
@@ -152,7 +152,7 @@ module Freeclimb
152
152
  # Check to see if the all the properties in the model are valid
153
153
  # @return true if the model is valid
154
154
  def valid?
155
- status_validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered"])
155
+ status_validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered", "expired", "deleted", "unknown"])
156
156
  return false unless status_validator.valid?(@status)
157
157
  true
158
158
  end
@@ -160,7 +160,7 @@ module Freeclimb
160
160
  # Custom attribute writer method checking allowed values (enum).
161
161
  # @param [Object] status Object to be assigned
162
162
  def status=(status)
163
- validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered"])
163
+ validator = EnumAttributeValidator.new('String', ["new", "queued", "rejected", "sending", "sent", "failed", "received", "undelivered", "expired", "deleted", "unknown"])
164
164
  unless validator.valid?(status)
165
165
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
166
166
  end
@@ -0,0 +1,330 @@
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 OutDial command is used to call a phone number
17
+ class OutDial < PerclCommand
18
+ # URL to which FreeClimb sends an HTTP POST request.
19
+ attr_accessor :action_url
20
+
21
+ # URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.
22
+ attr_accessor :call_connect_url
23
+
24
+ # he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb.
25
+ attr_accessor :calling_number
26
+
27
+ # E.164 representation of the phone number to Call.
28
+ attr_accessor :destination
29
+
30
+ # Specifies how FreeClimb should handle this OutDial if an answering machine answers the Call. Valid values: `redirect` invokes the ifMachineUrl for instructions. `hangup` hangs up the Call. The ifMachineUrl will not be invoked.
31
+ attr_accessor :if_machine
32
+
33
+ # When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included.
34
+ attr_accessor :if_machine_url
35
+
36
+ # DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension.
37
+ attr_accessor :send_digits
38
+
39
+ # When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored.
40
+ attr_accessor :status_callback_url
41
+
42
+ # Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`.
43
+ attr_accessor :timeout
44
+
45
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
46
+ attr_accessor :privacy_mode
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'action_url' => :'actionUrl',
52
+ :'call_connect_url' => :'callConnectUrl',
53
+ :'calling_number' => :'callingNumber',
54
+ :'destination' => :'destination',
55
+ :'if_machine' => :'ifMachine',
56
+ :'if_machine_url' => :'ifMachineUrl',
57
+ :'send_digits' => :'sendDigits',
58
+ :'status_callback_url' => :'statusCallbackUrl',
59
+ :'timeout' => :'timeout',
60
+ :'privacy_mode' => :'privacyMode'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'action_url' => :'String',
68
+ :'call_connect_url' => :'String',
69
+ :'calling_number' => :'Float',
70
+ :'destination' => :'Float',
71
+ :'if_machine' => :'String',
72
+ :'if_machine_url' => :'String',
73
+ :'send_digits' => :'String',
74
+ :'status_callback_url' => :'String',
75
+ :'timeout' => :'Integer',
76
+ :'privacy_mode' => :'Boolean'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # List of class defined in allOf (OpenAPI v3)
87
+ def self.openapi_all_of
88
+ [
89
+ :'OutDialAllOf',
90
+ :'PerclCommand'
91
+ ]
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDial` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDial`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ # call parent's initialize
110
+ super(attributes)
111
+
112
+ if attributes.key?(:'action_url')
113
+ self.action_url = attributes[:'action_url']
114
+ end
115
+
116
+ if attributes.key?(:'call_connect_url')
117
+ self.call_connect_url = attributes[:'call_connect_url']
118
+ end
119
+
120
+ if attributes.key?(:'calling_number')
121
+ self.calling_number = attributes[:'calling_number']
122
+ end
123
+
124
+ if attributes.key?(:'destination')
125
+ self.destination = attributes[:'destination']
126
+ end
127
+
128
+ if attributes.key?(:'if_machine')
129
+ self.if_machine = attributes[:'if_machine']
130
+ end
131
+
132
+ if attributes.key?(:'if_machine_url')
133
+ self.if_machine_url = attributes[:'if_machine_url']
134
+ end
135
+
136
+ if attributes.key?(:'send_digits')
137
+ self.send_digits = attributes[:'send_digits']
138
+ end
139
+
140
+ if attributes.key?(:'status_callback_url')
141
+ self.status_callback_url = attributes[:'status_callback_url']
142
+ end
143
+
144
+ if attributes.key?(:'timeout')
145
+ self.timeout = attributes[:'timeout']
146
+ end
147
+
148
+ if attributes.key?(:'privacy_mode')
149
+ self.privacy_mode = attributes[:'privacy_mode']
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = super
157
+ if @action_url.nil?
158
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
159
+ end
160
+
161
+ if @call_connect_url.nil?
162
+ invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.')
163
+ end
164
+
165
+ if @calling_number.nil?
166
+ invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.')
167
+ end
168
+
169
+ if @destination.nil?
170
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
171
+ end
172
+
173
+ invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ return false if @action_url.nil?
180
+ return false if @call_connect_url.nil?
181
+ return false if @calling_number.nil?
182
+ return false if @destination.nil?
183
+ true && super
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ action_url == o.action_url &&
192
+ call_connect_url == o.call_connect_url &&
193
+ calling_number == o.calling_number &&
194
+ destination == o.destination &&
195
+ if_machine == o.if_machine &&
196
+ if_machine_url == o.if_machine_url &&
197
+ send_digits == o.send_digits &&
198
+ status_callback_url == o.status_callback_url &&
199
+ timeout == o.timeout &&
200
+ privacy_mode == o.privacy_mode && super(o)
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Integer] Hash code
211
+ def hash
212
+ [action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout, privacy_mode].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def self.build_from_hash(attributes)
219
+ new.build_from_hash(attributes)
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ super(attributes)
228
+ self.class.openapi_types.each_pair do |key, type|
229
+ if type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
233
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
234
+ end
235
+ elsif !attributes[self.class.attribute_map[key]].nil?
236
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
237
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
238
+ end
239
+
240
+ self
241
+ end
242
+
243
+ # Deserializes the data based on type
244
+ # @param string type Data type
245
+ # @param string value Value to be deserialized
246
+ # @return [Object] Deserialized data
247
+ def _deserialize(type, value)
248
+ case type.to_sym
249
+ when :DateTime
250
+ DateTime.parse(value)
251
+ when :Date
252
+ Date.parse(value)
253
+ when :String
254
+ value.to_s
255
+ when :Integer
256
+ value.to_i
257
+ when :Float
258
+ value.to_f
259
+ when :Boolean
260
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
261
+ true
262
+ else
263
+ false
264
+ end
265
+ when :Object
266
+ # generic object (usually a Hash), return directly
267
+ value
268
+ when /\AArray<(?<inner_type>.+)>\z/
269
+ inner_type = Regexp.last_match[:inner_type]
270
+ value.map { |v| _deserialize(inner_type, v) }
271
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
272
+ k_type = Regexp.last_match[:k_type]
273
+ v_type = Regexp.last_match[:v_type]
274
+ {}.tap do |hash|
275
+ value.each do |k, v|
276
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
277
+ end
278
+ end
279
+ else # model
280
+ Freeclimb.const_get(type).build_from_hash(value)
281
+ end
282
+ end
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # to_body is an alias to to_hash (backward compatibility)
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_body
293
+ to_hash
294
+ end
295
+
296
+ # Returns the object in the form of hash
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_hash
299
+ hash = super
300
+ self.class.attribute_map.each_pair do |attr, param|
301
+ value = self.send(attr)
302
+ if value.nil?
303
+ is_nullable = self.class.openapi_nullable.include?(attr)
304
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
305
+ end
306
+
307
+ hash[param] = _to_hash(value)
308
+ end
309
+ hash
310
+ end
311
+
312
+ # Outputs non-array value in the form of hash
313
+ # For object, use to_hash. Otherwise, just return the value
314
+ # @param [Object] value Any valid value
315
+ # @return [Hash] Returns the value in the form of hash
316
+ def _to_hash(value)
317
+ if value.is_a?(Array)
318
+ value.compact.map { |v| _to_hash(v) }
319
+ elsif value.is_a?(Hash)
320
+ {}.tap do |hash|
321
+ value.each { |k, v| hash[k] = _to_hash(v) }
322
+ end
323
+ elsif value.respond_to? :to_hash
324
+ value.to_hash
325
+ else
326
+ value
327
+ end
328
+ end
329
+ end
330
+ end