bandwidth-sdk 11.0.0 → 11.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,9 +12,9 @@
12
12
  | Ubuntu 20.04 | 2.7, 3.0, 3.1, 3.2 |
13
13
  | Ubuntu 22.04 | 2.7, 3.0, 3.1, 3.2 |
14
14
 
15
- {{moduleName}} - the Ruby gem for the {{appName}}
15
+ {{moduleName}} - the Ruby gem for the {{appName}} SDK
16
16
 
17
- # Generated with the command:
17
+ ### Generated with the command:
18
18
  `openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./`
19
19
 
20
20
  {{#appDescriptionWithNewLines}}
@@ -35,6 +35,12 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
35
35
 
36
36
  ## Installation
37
37
 
38
+ ### Install from RubyGems
39
+
40
+ ```shell
41
+ gem install {{{gemName}}}
42
+ ```
43
+
38
44
  ### Build a gem
39
45
 
40
46
  To build the Ruby code into a gem:
data/docs/CallsApi.md CHANGED
@@ -6,6 +6,7 @@ All URIs are relative to *http://localhost*
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**create_call**](CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call |
8
8
  | [**get_call_state**](CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information |
9
+ | [**list_calls**](CallsApi.md#list_calls) | **GET** /accounts/{accountId}/calls | Get Calls |
9
10
  | [**update_call**](CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call |
10
11
  | [**update_call_bxml**](CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML |
11
12
 
@@ -154,6 +155,92 @@ end
154
155
  - **Accept**: application/json
155
156
 
156
157
 
158
+ ## list_calls
159
+
160
+ > <Array<CallState>> list_calls(account_id, opts)
161
+
162
+ Get Calls
163
+
164
+ Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
165
+
166
+ ### Examples
167
+
168
+ ```ruby
169
+ require 'time'
170
+ require 'bandwidth-sdk'
171
+ # setup authorization
172
+ Bandwidth.configure do |config|
173
+ # Configure HTTP basic authorization: Basic
174
+ config.username = 'YOUR USERNAME'
175
+ config.password = 'YOUR PASSWORD'
176
+ end
177
+
178
+ api_instance = Bandwidth::CallsApi.new
179
+ account_id = '9900000' # String | Your Bandwidth Account ID.
180
+ opts = {
181
+ to: '%2b19195551234', # String | Filter results by the `to` field.
182
+ from: '%2b19195554321', # String | Filter results by the `from` field.
183
+ min_start_time: '2022-06-21T19:13:21Z', # String | Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format).
184
+ max_start_time: '2022-06-21T19:13:21Z', # String | Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format).
185
+ disconnect_cause: 'hangup', # String | Filter results to calls with specified call Disconnect Cause.
186
+ page_size: 500, # Integer | Specifies the max number of calls that will be returned.
187
+ page_token: 'page_token_example' # String | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
188
+ }
189
+
190
+ begin
191
+ # Get Calls
192
+ result = api_instance.list_calls(account_id, opts)
193
+ p result
194
+ rescue Bandwidth::ApiError => e
195
+ puts "Error when calling CallsApi->list_calls: #{e}"
196
+ end
197
+ ```
198
+
199
+ #### Using the list_calls_with_http_info variant
200
+
201
+ This returns an Array which contains the response data, status code and headers.
202
+
203
+ > <Array(<Array<CallState>>, Integer, Hash)> list_calls_with_http_info(account_id, opts)
204
+
205
+ ```ruby
206
+ begin
207
+ # Get Calls
208
+ data, status_code, headers = api_instance.list_calls_with_http_info(account_id, opts)
209
+ p status_code # => 2xx
210
+ p headers # => { ... }
211
+ p data # => <Array<CallState>>
212
+ rescue Bandwidth::ApiError => e
213
+ puts "Error when calling CallsApi->list_calls_with_http_info: #{e}"
214
+ end
215
+ ```
216
+
217
+ ### Parameters
218
+
219
+ | Name | Type | Description | Notes |
220
+ | ---- | ---- | ----------- | ----- |
221
+ | **account_id** | **String** | Your Bandwidth Account ID. | |
222
+ | **to** | **String** | Filter results by the &#x60;to&#x60; field. | [optional] |
223
+ | **from** | **String** | Filter results by the &#x60;from&#x60; field. | [optional] |
224
+ | **min_start_time** | **String** | Filter results to calls which have a &#x60;startTime&#x60; after or including &#x60;minStartTime&#x60; (in ISO8601 format). | [optional] |
225
+ | **max_start_time** | **String** | Filter results to calls which have a &#x60;startTime&#x60; before or including &#x60;maxStartTime&#x60; (in ISO8601 format). | [optional] |
226
+ | **disconnect_cause** | **String** | Filter results to calls with specified call Disconnect Cause. | [optional] |
227
+ | **page_size** | **Integer** | Specifies the max number of calls that will be returned. | [optional][default to 1000] |
228
+ | **page_token** | **String** | Not intended for explicit use. To use pagination, follow the links in the &#x60;Link&#x60; header of the response, as indicated in the endpoint description. | [optional] |
229
+
230
+ ### Return type
231
+
232
+ [**Array&lt;CallState&gt;**](CallState.md)
233
+
234
+ ### Authorization
235
+
236
+ [Basic](../README.md#Basic)
237
+
238
+ ### HTTP request headers
239
+
240
+ - **Content-Type**: Not defined
241
+ - **Accept**: application/json
242
+
243
+
157
244
  ## update_call
158
245
 
159
246
  > update_call(account_id, call_id, update_call)
@@ -162,6 +162,98 @@ module Bandwidth
162
162
  return data, status_code, headers
163
163
  end
164
164
 
165
+ # Get Calls
166
+ # Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
167
+ # @param account_id [String] Your Bandwidth Account ID.
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [String] :to Filter results by the &#x60;to&#x60; field.
170
+ # @option opts [String] :from Filter results by the &#x60;from&#x60; field.
171
+ # @option opts [String] :min_start_time Filter results to calls which have a &#x60;startTime&#x60; after or including &#x60;minStartTime&#x60; (in ISO8601 format).
172
+ # @option opts [String] :max_start_time Filter results to calls which have a &#x60;startTime&#x60; before or including &#x60;maxStartTime&#x60; (in ISO8601 format).
173
+ # @option opts [String] :disconnect_cause Filter results to calls with specified call Disconnect Cause.
174
+ # @option opts [Integer] :page_size Specifies the max number of calls that will be returned. (default to 1000)
175
+ # @option opts [String] :page_token Not intended for explicit use. To use pagination, follow the links in the &#x60;Link&#x60; header of the response, as indicated in the endpoint description.
176
+ # @return [Array<CallState>]
177
+ def list_calls(account_id, opts = {})
178
+ data, _status_code, _headers = list_calls_with_http_info(account_id, opts)
179
+ data
180
+ end
181
+
182
+ # Get Calls
183
+ # Returns a max of 10000 calls, sorted by &#x60;createdTime&#x60; from oldest to newest. **NOTE:** If the number of calls in the account is bigger than &#x60;pageSize&#x60;, a &#x60;Link&#x60; header (with format &#x60;&lt;{url}&gt;; rel&#x3D;\&quot;next\&quot;&#x60;) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
184
+ # @param account_id [String] Your Bandwidth Account ID.
185
+ # @param [Hash] opts the optional parameters
186
+ # @option opts [String] :to Filter results by the &#x60;to&#x60; field.
187
+ # @option opts [String] :from Filter results by the &#x60;from&#x60; field.
188
+ # @option opts [String] :min_start_time Filter results to calls which have a &#x60;startTime&#x60; after or including &#x60;minStartTime&#x60; (in ISO8601 format).
189
+ # @option opts [String] :max_start_time Filter results to calls which have a &#x60;startTime&#x60; before or including &#x60;maxStartTime&#x60; (in ISO8601 format).
190
+ # @option opts [String] :disconnect_cause Filter results to calls with specified call Disconnect Cause.
191
+ # @option opts [Integer] :page_size Specifies the max number of calls that will be returned. (default to 1000)
192
+ # @option opts [String] :page_token Not intended for explicit use. To use pagination, follow the links in the &#x60;Link&#x60; header of the response, as indicated in the endpoint description.
193
+ # @return [Array<(Array<CallState>, Integer, Hash)>] Array<CallState> data, response status code and response headers
194
+ def list_calls_with_http_info(account_id, opts = {})
195
+ if @api_client.config.debugging
196
+ @api_client.config.logger.debug 'Calling API: CallsApi.list_calls ...'
197
+ end
198
+ # verify the required parameter 'account_id' is set
199
+ if @api_client.config.client_side_validation && account_id.nil?
200
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.list_calls"
201
+ end
202
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
203
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CallsApi.list_calls, must be smaller than or equal to 10000.'
204
+ end
205
+
206
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
207
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CallsApi.list_calls, must be greater than or equal to 1.'
208
+ end
209
+
210
+ # resource path
211
+ local_var_path = '/accounts/{accountId}/calls'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
212
+
213
+ # query parameters
214
+ query_params = opts[:query_params] || {}
215
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
216
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
217
+ query_params[:'minStartTime'] = opts[:'min_start_time'] if !opts[:'min_start_time'].nil?
218
+ query_params[:'maxStartTime'] = opts[:'max_start_time'] if !opts[:'max_start_time'].nil?
219
+ query_params[:'disconnectCause'] = opts[:'disconnect_cause'] if !opts[:'disconnect_cause'].nil?
220
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
221
+ query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?
222
+
223
+ # header parameters
224
+ header_params = opts[:header_params] || {}
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
227
+
228
+ # form parameters
229
+ form_params = opts[:form_params] || {}
230
+
231
+ # http body (model)
232
+ post_body = opts[:debug_body]
233
+
234
+ # return_type
235
+ return_type = opts[:debug_return_type] || 'Array<CallState>'
236
+
237
+ # auth_names
238
+ auth_names = opts[:debug_auth_names] || ['Basic']
239
+
240
+ new_options = opts.merge(
241
+ :operation => :"CallsApi.list_calls",
242
+ :header_params => header_params,
243
+ :query_params => query_params,
244
+ :form_params => form_params,
245
+ :body => post_body,
246
+ :auth_names => auth_names,
247
+ :return_type => return_type
248
+ )
249
+
250
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug "API called: CallsApi#list_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
253
+ end
254
+ return data, status_code, headers
255
+ end
256
+
165
257
  # Update Call
166
258
  # Interrupts and redirects a call to a different URL that should return a BXML document.
167
259
  # @param account_id [String] Your Bandwidth Account ID.
@@ -272,6 +272,12 @@ module Bandwidth
272
272
  description: "Production",
273
273
  }
274
274
  ],
275
+ "CallsApi.list_calls": [
276
+ {
277
+ url: "https://voice.bandwidth.com/api/v2",
278
+ description: "Production",
279
+ }
280
+ ],
275
281
  "CallsApi.update_call": [
276
282
  {
277
283
  url: "https://voice.bandwidth.com/api/v2",
@@ -21,7 +21,7 @@ module Bandwidth
21
21
  max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
22
22
  inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
23
23
  first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested <SpeakSentence> or <PlayAudio> verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
24
- repeat_count: 'repeat_count', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeat_count * number of verbs must not be greater than 20.
24
+ repeat_count: 'repeatCount', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeatCount * number of verbs must not be greater than 20.
25
25
  }
26
26
  end
27
27
 
@@ -11,5 +11,5 @@ OpenAPI Generator version: 7.0.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '11.0.0'
14
+ VERSION = '11.1.1'
15
15
  end
@@ -29,6 +29,8 @@ describe 'CallsApi' do
29
29
  let(:create_call_headers_stub) { { 'content-type' => 'application/json' } }
30
30
  let(:create_call_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"enqueuedTime\":\"#{enqueued_time}\",\"callUrl\":\"#{call_url}\",\"callTimeout\":#{call_timeout},\"callbackTimeout\":#{callback_timeout},\"tag\":\"#{tag}\",\"answerMethod\":\"#{answer_method}\",\"answerUrl\":\"#{answer_url}\",\"answerFallbackUrl\":\"#{answer_fallback_url}\",\"answerFallbackMethod\":\"#{answer_fallback_method}\",\"disconnectMethod\":\"#{disconnect_method}\",\"disconnectUrl\":\"#{disconnect_url}\",\"priority\":#{priority}}" }
31
31
  let(:create_call_bad_request_stub) { '{"type":"validation","description":"Invalid to: must be a valid SIP URI or an E164 TN"}' }
32
+ let(:get_calls_headers_stub) { { 'content-type' => 'application/json' } }
33
+ let(:get_calls_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}]" }
32
34
  let(:get_call_state_headers_stub) { { 'content-type' => 'application/json' } }
33
35
  let(:get_call_state_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"enqueuedTime\":\"#{enqueued_time}\",\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}" }
34
36
  let(:get_call_state_not_found_stub) { '{"type":"validation","description":"Call does-not-exist was not found."}' }
@@ -119,6 +121,35 @@ describe 'CallsApi' do
119
121
  end
120
122
  end
121
123
 
124
+ # Get Calls
125
+ describe '#list_calls' do
126
+ it 'gets a list of calls' do
127
+ stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
128
+ to_return(status: 200, headers: get_calls_headers_stub, body: get_calls_body_stub)
129
+
130
+ data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
131
+
132
+ expect(status_code).to eq(200)
133
+ expect(headers).to eq(get_calls_headers_stub)
134
+ expect(data).to be_instance_of(Array)
135
+ expect(data[0]).to be_instance_of(Bandwidth::CallState)
136
+ expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
137
+ expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
138
+ expect(data[0].call_id).to eq(call_id)
139
+ expect(data[0].to).to eq(USER_NUMBER)
140
+ expect(data[0].from).to eq(BW_NUMBER)
141
+ expect(data[0].direction).to eq(direction)
142
+ expect(data[0].stir_shaken).to eq(stir_shaken)
143
+ expect(data[0].state).to eq(state)
144
+ expect(data[0].start_time).to eq(Time.parse(start_time))
145
+ expect(data[0].end_time).to eq(Time.parse(end_time))
146
+ expect(data[0].disconnect_cause).to eq(disconnect_cause)
147
+ expect(data[0].error_message).to eq(error_message)
148
+ expect(data[0].error_id).to eq(error_id)
149
+ expect(data[0].last_update).to eq(Time.parse(last_update))
150
+ end
151
+ end
152
+
122
153
  # Get Call State Information
123
154
  describe '#get_call_state' do
124
155
  it 'gets the call state' do
@@ -81,27 +81,34 @@ describe 'CallsApi Integration Tests' do
81
81
  end
82
82
  end
83
83
 
84
+ # Get Calls
85
+ describe '#list_calls' do
86
+ it 'gets a list of calls' do
87
+ data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
88
+
89
+ expect(status_code).to eq(200)
90
+ expect(data).to be_instance_of(Array)
91
+ expect(data[0]).to be_instance_of(Bandwidth::CallState)
92
+ expect(data[0].application_id.length).to eq(36)
93
+ expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
94
+ end
95
+ end
96
+
84
97
  # Get Call State Information
85
98
  describe 'get_call_state' do
86
99
  it 'gets the call state' do
87
- begin
88
- sleep(SLEEP_TIME_S)
89
- data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
90
-
91
- expect(status_code).to eq(200)
92
- expect(data).to be_instance_of(Bandwidth::CallState)
93
- expect(data.call_id).to eq($call_info_id)
94
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
95
- expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
96
- expect(data.start_time).to be_instance_of(Time).or be_nil
97
- expect(data.last_update).to be_instance_of(Time)
98
- expect(data.state).to be_instance_of(String)
99
- expect(data.direction).to eq(direction)
100
- rescue Bandwidth::ApiError => e
101
- if e.code != 404
102
- raise e
103
- end
104
- end
100
+ sleep(40) # wait 40s for voice API to update call status
101
+ data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
102
+
103
+ expect(status_code).to eq(200)
104
+ expect(data).to be_instance_of(Bandwidth::CallState)
105
+ expect(data.call_id).to eq($call_info_id)
106
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
107
+ expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
108
+ expect(data.start_time).to be_instance_of(Time).or be_nil
109
+ expect(data.last_update).to be_instance_of(Time)
110
+ expect(data.state).to be_instance_of(String)
111
+ expect(data.direction).to eq(direction)
105
112
  end
106
113
  end
107
114
 
@@ -5,7 +5,7 @@ describe 'Bandwidth::Bxml::Forward' do
5
5
  to: '+19195551234',
6
6
  from: '+19195554321',
7
7
  call_timeout: 5,
8
- diversion_treatment: 'propogate',
8
+ diversion_treatment: 'propagate',
9
9
  diversion_reason: 'user-busy',
10
10
  uui: '93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt'
11
11
  }
@@ -31,7 +31,7 @@ describe 'Bandwidth::Bxml::Forward' do
31
31
  end
32
32
 
33
33
  it 'tests the to_bxml method of the Forward instance' do
34
- expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
34
+ expected = "\n<Forward to=\"+19195551234\" from=\"+19195554321\" callTimeout=\"5\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\"/>\n"
35
35
  expect(instance.to_bxml).to eq(expected)
36
36
  end
37
37
 
@@ -51,13 +51,13 @@ describe 'Bandwidth::Bxml::Gather' do
51
51
  end
52
52
 
53
53
  it 'tests the to_bxml method of the Gather instance' do
54
- expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeat_count=\"5\"/>\n"
54
+ expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\"/>\n"
55
55
  expect(instance.to_bxml).to eq(expected)
56
56
  end
57
57
 
58
58
  it 'tests the set_attributes method of the Gather instance' do
59
59
  instance.set_attributes(new_attributes)
60
- expected = "\n<Gather gatherUrl=\"https://new.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://new.com\" gatherFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"10\" maxDigits=\"10\" interDigitTimeout=\"10\" firstDigitTimeout=\"10\" repeat_count=\"10\"/>\n"
60
+ expected = "\n<Gather gatherUrl=\"https://new.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://new.com\" gatherFallbackMethod=\"GET\" username=\"new_username\" password=\"new_password\" fallbackUsername=\"new_fallback_username\" fallbackPassword=\"new_fallback_password\" tag=\"new_tag\" terminatingDigits=\"10\" maxDigits=\"10\" interDigitTimeout=\"10\" firstDigitTimeout=\"10\" repeatCount=\"10\"/>\n"
61
61
  expect(instance.to_bxml).to eq(expected)
62
62
  end
63
63
  end
@@ -69,16 +69,16 @@ describe 'Bandwidth::Bxml::Gather' do
69
69
  end
70
70
 
71
71
  it 'tests the to_bxml method of the nested Gather instance' do
72
- expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeat_count=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
72
+ expected = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
73
73
  expect(instance_nested.to_bxml).to eq(expected)
74
74
  end
75
75
 
76
76
  it 'tests the add_verb method of the nested Gather instance' do
77
- expected_single = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeat_count=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n</Gather>\n"
77
+ expected_single = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n</Gather>\n"
78
78
  instance_nested.add_audio_verb(speak_sentence)
79
79
  expect(instance_nested.to_bxml).to eq(expected_single)
80
80
 
81
- expected_multiple = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeat_count=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
81
+ expected_multiple = "\n<Gather gatherUrl=\"https://initial.com\" gatherMethod=\"POST\" gatherFallbackUrl=\"https://initial.com\" gatherFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" terminatingDigits=\"5\" maxDigits=\"5\" interDigitTimeout=\"5\" firstDigitTimeout=\"5\" repeatCount=\"5\">\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <SpeakSentence><lang xml:lang=\"es-MX\">Hola</lang>ruby speak sentence <emphasis>SSML test</emphasis></SpeakSentence>\n <PlayAudio>https://audio.url/audio1.wav</PlayAudio>\n</Gather>\n"
82
82
  instance_nested.add_audio_verb([speak_sentence, play_audio])
83
83
  expect(instance_nested.to_bxml).to eq(expected_multiple)
84
84
  end
@@ -13,7 +13,7 @@ describe 'Bandwidth::Bxml::Transfer' do
13
13
  fallback_username: 'initial_fallback_username',
14
14
  fallback_password: 'initial_fallback_password',
15
15
  tag: 'initial_tag',
16
- diversion_treatment: 'propogate',
16
+ diversion_treatment: 'propagate',
17
17
  diversion_reason: 'user-busy'
18
18
  }
19
19
  }
@@ -49,7 +49,7 @@ describe 'Bandwidth::Bxml::Transfer' do
49
49
  end
50
50
 
51
51
  it 'tests the to_bxml method of the Transfer instance' do
52
- expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\"/>\n"
52
+ expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\"/>\n"
53
53
  expect(instance.to_bxml).to eq(expected)
54
54
  end
55
55
 
@@ -67,16 +67,16 @@ describe 'Bandwidth::Bxml::Transfer' do
67
67
  end
68
68
 
69
69
  it 'tests the to_bxml method of the nested Transfer instance' do
70
- expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
70
+ expected = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
71
71
  expect(instance_nested.to_bxml).to eq(expected)
72
72
  end
73
73
 
74
74
  it 'tests the add_verb method of the nested Transfer instance' do
75
- expected_single = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n</Transfer>\n"
75
+ expected_single = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n</Transfer>\n"
76
76
  instance_nested.add_transfer_recipient(sip_uri)
77
77
  expect(instance_nested.to_bxml).to eq(expected_single)
78
78
 
79
- expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propogate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
79
+ expected_multiple = "\n<Transfer transferCallerId=\"+19195551234\" callTimeout=\"5\" transferCompleteUrl=\"https://initial.com\" transferCompleteMethod=\"POST\" transferCompleteFallbackUrl=\"https://initial.com\" transferCompleteFallbackMethod=\"POST\" username=\"initial_username\" password=\"initial_password\" fallbackUsername=\"initial_fallback_username\" fallbackPassword=\"initial_fallback_password\" tag=\"initial_tag\" diversionTreatment=\"propagate\" diversionReason=\"user-busy\">\n <PhoneNumber>+19195551234</PhoneNumber>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <SipUri>sip:1-999-123-4567@voip-provider.example.net</SipUri>\n <PhoneNumber>+19195551234</PhoneNumber>\n</Transfer>\n"
80
80
  instance_nested.add_transfer_recipient([sip_uri, phone_number])
81
81
  expect(instance_nested.to_bxml).to eq(expected_multiple)
82
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0
4
+ version: 11.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-26 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -460,62 +460,62 @@ signing_key:
460
460
  specification_version: 4
461
461
  summary: Bandwidth Ruby SDK
462
462
  test_files:
463
- - spec/api/phone_number_lookup_api_spec.rb
464
463
  - spec/api/recordings_api_spec.rb
465
- - spec/api/media_api_spec.rb
466
- - spec/api/conferences_api_spec.rb
464
+ - spec/api/phone_number_lookup_api_spec.rb
467
465
  - spec/api/messages_api_spec.rb
468
466
  - spec/api/statistics_api_spec.rb
469
- - spec/api/mfa_api_spec.rb
470
467
  - spec/api/calls_api_spec.rb
468
+ - spec/api/media_api_spec.rb
469
+ - spec/api/mfa_api_spec.rb
470
+ - spec/api/conferences_api_spec.rb
471
471
  - spec/api_client_spec.rb
472
472
  - spec/api_error_spec.rb
473
473
  - spec/call_utils.rb
474
474
  - spec/configuration_spec.rb
475
475
  - spec/fixtures/ruby_cat.jpeg
476
- - spec/integration/phone_number_lookup_api_integration_spec.rb
477
- - spec/integration/statistics_api_integration_spec.rb
478
- - spec/integration/media_api_integration_spec.rb
479
- - spec/integration/recordings_api_integration_spec.rb
480
476
  - spec/integration/mfa_api_integration_spec.rb
481
- - spec/integration/calls_api_integration_spec.rb
477
+ - spec/integration/media_api_integration_spec.rb
482
478
  - spec/integration/messages_api_integration_spec.rb
479
+ - spec/integration/calls_api_integration_spec.rb
483
480
  - spec/integration/conferences_api_integration_spec.rb
484
- - spec/models/message_spec.rb
485
- - spec/models/call_state_spec.rb
486
- - spec/models/call_state_enum_spec.rb
487
- - spec/models/verify_code_request_spec.rb
481
+ - spec/integration/phone_number_lookup_api_integration_spec.rb
482
+ - spec/integration/recordings_api_integration_spec.rb
483
+ - spec/integration/statistics_api_integration_spec.rb
488
484
  - spec/models/deferred_result_spec.rb
489
- - spec/models/bxml/verbs/stop_gather_spec.rb
490
- - spec/models/bxml/verbs/hangup_spec.rb
485
+ - spec/models/verify_code_request_spec.rb
486
+ - spec/models/call_state_enum_spec.rb
487
+ - spec/models/call_state_spec.rb
488
+ - spec/models/message_spec.rb
489
+ - spec/models/bxml/response_spec.rb
491
490
  - spec/models/bxml/verbs/play_audio_spec.rb
492
- - spec/models/bxml/verbs/transfer_spec.rb
493
- - spec/models/bxml/verbs/ring_spec.rb
494
- - spec/models/bxml/verbs/custom_param_spec.rb
495
- - spec/models/bxml/verbs/pause_spec.rb
496
- - spec/models/bxml/verbs/send_dtmf_spec.rb
497
- - spec/models/bxml/verbs/start_recording_spec.rb
498
- - spec/models/bxml/verbs/stop_recording_spec.rb
499
491
  - spec/models/bxml/verbs/redirect_spec.rb
500
- - spec/models/bxml/verbs/phone_number_spec.rb
501
- - spec/models/bxml/verbs/resume_recording_spec.rb
502
- - spec/models/bxml/verbs/start_gather_spec.rb
492
+ - spec/models/bxml/verbs/forward_spec.rb
493
+ - spec/models/bxml/verbs/bridge_spec.rb
494
+ - spec/models/bxml/verbs/pause_recording_spec.rb
495
+ - spec/models/bxml/verbs/stop_gather_spec.rb
503
496
  - spec/models/bxml/verbs/conference_spec.rb
504
- - spec/models/bxml/verbs/stop_transcription_spec.rb
505
497
  - spec/models/bxml/verbs/sip_uri_spec.rb
506
- - spec/models/bxml/verbs/pause_recording_spec.rb
507
- - spec/models/bxml/verbs/stop_stream_spec.rb
508
- - spec/models/bxml/verbs/record_spec.rb
498
+ - spec/models/bxml/verbs/resume_recording_spec.rb
499
+ - spec/models/bxml/verbs/tag_spec.rb
500
+ - spec/models/bxml/verbs/speak_sentence_spec.rb
509
501
  - spec/models/bxml/verbs/start_stream_spec.rb
510
- - spec/models/bxml/verbs/stream_param_spec.rb
502
+ - spec/models/bxml/verbs/transfer_spec.rb
511
503
  - spec/models/bxml/verbs/start_transcription_spec.rb
512
- - spec/models/bxml/verbs/bridge_spec.rb
513
- - spec/models/bxml/verbs/tag_spec.rb
514
- - spec/models/bxml/verbs/forward_spec.rb
504
+ - spec/models/bxml/verbs/hangup_spec.rb
505
+ - spec/models/bxml/verbs/record_spec.rb
506
+ - spec/models/bxml/verbs/stop_stream_spec.rb
507
+ - spec/models/bxml/verbs/stop_transcription_spec.rb
508
+ - spec/models/bxml/verbs/send_dtmf_spec.rb
509
+ - spec/models/bxml/verbs/custom_param_spec.rb
515
510
  - spec/models/bxml/verbs/gather_spec.rb
516
- - spec/models/bxml/verbs/speak_sentence_spec.rb
511
+ - spec/models/bxml/verbs/ring_spec.rb
512
+ - spec/models/bxml/verbs/stop_recording_spec.rb
513
+ - spec/models/bxml/verbs/start_gather_spec.rb
514
+ - spec/models/bxml/verbs/stream_param_spec.rb
515
+ - spec/models/bxml/verbs/start_recording_spec.rb
516
+ - spec/models/bxml/verbs/phone_number_spec.rb
517
+ - spec/models/bxml/verbs/pause_spec.rb
518
+ - spec/models/bxml/nestable_verb_spec.rb
517
519
  - spec/models/bxml/bxml_spec.rb
518
- - spec/models/bxml/response_spec.rb
519
520
  - spec/models/bxml/verb_spec.rb
520
- - spec/models/bxml/nestable_verb_spec.rb
521
521
  - spec/spec_helper.rb