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
@@ -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
@@ -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
@@ -0,0 +1,317 @@
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 OutDialAllOf
17
+ # URL to which FreeClimb sends an HTTP POST request.
18
+ attr_accessor :action_url
19
+
20
+ # URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.
21
+ attr_accessor :call_connect_url
22
+
23
+ # 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.
24
+ attr_accessor :calling_number
25
+
26
+ # E.164 representation of the phone number to Call.
27
+ attr_accessor :destination
28
+
29
+ # 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.
30
+ attr_accessor :if_machine
31
+
32
+ # 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.
33
+ attr_accessor :if_machine_url
34
+
35
+ # DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension.
36
+ attr_accessor :send_digits
37
+
38
+ # 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.
39
+ attr_accessor :status_callback_url
40
+
41
+ # 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`.
42
+ attr_accessor :timeout
43
+
44
+ # Parameter `privacyMode` will not log the `text` as required by PCI compliance.
45
+ attr_accessor :privacy_mode
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'action_url' => :'actionUrl',
51
+ :'call_connect_url' => :'callConnectUrl',
52
+ :'calling_number' => :'callingNumber',
53
+ :'destination' => :'destination',
54
+ :'if_machine' => :'ifMachine',
55
+ :'if_machine_url' => :'ifMachineUrl',
56
+ :'send_digits' => :'sendDigits',
57
+ :'status_callback_url' => :'statusCallbackUrl',
58
+ :'timeout' => :'timeout',
59
+ :'privacy_mode' => :'privacyMode'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'action_url' => :'String',
67
+ :'call_connect_url' => :'String',
68
+ :'calling_number' => :'Float',
69
+ :'destination' => :'Float',
70
+ :'if_machine' => :'String',
71
+ :'if_machine_url' => :'String',
72
+ :'send_digits' => :'String',
73
+ :'status_callback_url' => :'String',
74
+ :'timeout' => :'Integer',
75
+ :'privacy_mode' => :'Boolean'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialAllOf` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'action_url')
101
+ self.action_url = attributes[:'action_url']
102
+ end
103
+
104
+ if attributes.key?(:'call_connect_url')
105
+ self.call_connect_url = attributes[:'call_connect_url']
106
+ end
107
+
108
+ if attributes.key?(:'calling_number')
109
+ self.calling_number = attributes[:'calling_number']
110
+ end
111
+
112
+ if attributes.key?(:'destination')
113
+ self.destination = attributes[:'destination']
114
+ end
115
+
116
+ if attributes.key?(:'if_machine')
117
+ self.if_machine = attributes[:'if_machine']
118
+ end
119
+
120
+ if attributes.key?(:'if_machine_url')
121
+ self.if_machine_url = attributes[:'if_machine_url']
122
+ end
123
+
124
+ if attributes.key?(:'send_digits')
125
+ self.send_digits = attributes[:'send_digits']
126
+ end
127
+
128
+ if attributes.key?(:'status_callback_url')
129
+ self.status_callback_url = attributes[:'status_callback_url']
130
+ end
131
+
132
+ if attributes.key?(:'timeout')
133
+ self.timeout = attributes[:'timeout']
134
+ end
135
+
136
+ if attributes.key?(:'privacy_mode')
137
+ self.privacy_mode = attributes[:'privacy_mode']
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ invalid_properties = Array.new
145
+ if @action_url.nil?
146
+ invalid_properties.push('invalid value for "action_url", action_url cannot be nil.')
147
+ end
148
+
149
+ if @call_connect_url.nil?
150
+ invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.')
151
+ end
152
+
153
+ if @calling_number.nil?
154
+ invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.')
155
+ end
156
+
157
+ if @destination.nil?
158
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ return false if @action_url.nil?
168
+ return false if @call_connect_url.nil?
169
+ return false if @calling_number.nil?
170
+ return false if @destination.nil?
171
+ true
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ action_url == o.action_url &&
180
+ call_connect_url == o.call_connect_url &&
181
+ calling_number == o.calling_number &&
182
+ destination == o.destination &&
183
+ if_machine == o.if_machine &&
184
+ if_machine_url == o.if_machine_url &&
185
+ send_digits == o.send_digits &&
186
+ status_callback_url == o.status_callback_url &&
187
+ timeout == o.timeout &&
188
+ privacy_mode == o.privacy_mode
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout, privacy_mode].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ self.class.openapi_types.each_pair do |key, type|
216
+ if type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
220
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
+ end
222
+ elsif !attributes[self.class.attribute_map[key]].nil?
223
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
225
+ end
226
+
227
+ self
228
+ end
229
+
230
+ # Deserializes the data based on type
231
+ # @param string type Data type
232
+ # @param string value Value to be deserialized
233
+ # @return [Object] Deserialized data
234
+ def _deserialize(type, value)
235
+ case type.to_sym
236
+ when :DateTime
237
+ DateTime.parse(value)
238
+ when :Date
239
+ Date.parse(value)
240
+ when :String
241
+ value.to_s
242
+ when :Integer
243
+ value.to_i
244
+ when :Float
245
+ value.to_f
246
+ when :Boolean
247
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
+ true
249
+ else
250
+ false
251
+ end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
255
+ when /\AArray<(?<inner_type>.+)>\z/
256
+ inner_type = Regexp.last_match[:inner_type]
257
+ value.map { |v| _deserialize(inner_type, v) }
258
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
+ k_type = Regexp.last_match[:k_type]
260
+ v_type = Regexp.last_match[:v_type]
261
+ {}.tap do |hash|
262
+ value.each do |k, v|
263
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
+ end
265
+ end
266
+ else # model
267
+ Freeclimb.const_get(type).build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+ end
317
+ end