bandwidth-sdk 16.2.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +18 -18
- data/README.md +20 -7
- data/bandwidth.yml +555 -279
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +197 -90
- data/coverage/index.html +2433 -1267
- data/docs/AsyncLookupRequest.md +18 -0
- data/docs/CallState.md +2 -2
- data/docs/{LookupRequest.md → CompletedLookupStatusEnum.md} +2 -5
- data/docs/CreateAsyncBulkLookupResponse.md +22 -0
- data/docs/{CreateLookupResponse.md → CreateAsyncBulkLookupResponseData.md} +4 -4
- data/docs/CreateSyncLookupResponse.md +22 -0
- data/docs/CreateSyncLookupResponseData.md +22 -0
- data/docs/DeactivationEventEnum.md +15 -0
- data/docs/GetAsyncBulkLookupResponse.md +22 -0
- data/docs/GetAsyncBulkLookupResponseData.md +22 -0
- data/docs/InProgressLookupStatusEnum.md +15 -0
- data/docs/LatestMessageDeliveryStatusEnum.md +15 -0
- data/docs/{LookupStatusEnum.md → LineTypeEnum.md} +2 -2
- data/docs/LinkSchema.md +22 -0
- data/docs/LookupErrorResponse.md +22 -0
- data/docs/LookupErrorSchema.md +24 -0
- data/docs/LookupErrorSchemaMeta.md +22 -0
- data/docs/LookupResult.md +22 -18
- data/docs/PhoneNumberLookupApi.md +111 -38
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +1 -1
- data/docs/StirShaken.md +2 -2
- data/docs/SyncLookupRequest.md +18 -0
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +117 -43
- data/lib/bandwidth-sdk/configuration.rb +10 -4
- data/lib/bandwidth-sdk/models/async_lookup_request.rb +232 -0
- data/lib/bandwidth-sdk/models/call_state.rb +1 -1
- data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +41 -0
- data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +235 -0
- data/lib/bandwidth-sdk/models/{create_lookup_response.rb → create_async_bulk_lookup_response_data.rb} +5 -5
- data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +234 -0
- data/lib/bandwidth-sdk/models/{lookup_status.rb → create_sync_lookup_response_data.rb} +15 -27
- data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +39 -0
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +234 -0
- data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +257 -0
- data/lib/bandwidth-sdk/models/{lookup_status_enum.rb → in_progress_lookup_status_enum.rb} +3 -3
- data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +41 -0
- data/lib/bandwidth-sdk/models/line_type_enum.rb +42 -0
- data/lib/bandwidth-sdk/models/{lookup_request.rb → link_schema.rb} +31 -20
- data/lib/bandwidth-sdk/models/lookup_error_response.rb +235 -0
- data/lib/bandwidth-sdk/models/lookup_error_schema.rb +242 -0
- data/lib/bandwidth-sdk/models/{tn_lookup_request_error.rb → lookup_error_schema_meta.rb} +29 -8
- data/lib/bandwidth-sdk/models/lookup_result.rb +102 -63
- data/lib/bandwidth-sdk/models/stir_shaken.rb +1 -1
- data/lib/bandwidth-sdk/models/sync_lookup_request.rb +232 -0
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +17 -5
- data/spec/smoke/multi_channel_api_spec.rb +1 -1
- data/spec/smoke/phone_number_lookup_api_spec.rb +65 -70
- data/spec/unit/api/phone_number_lookup_api_spec.rb +71 -56
- metadata +80 -56
- data/docs/LookupStatus.md +0 -24
- data/docs/TnLookupRequestError.md +0 -18
data/docs/RbmActionBase.md
CHANGED
data/docs/StirShaken.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **verstat** | **String** | (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-
|
|
7
|
+
| **verstat** | **String** | (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Validation-Passed and TN-Validation-Failed. | [optional] |
|
|
8
8
|
| **attestation_indicator** | **String** | (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). | [optional] |
|
|
9
9
|
| **originating_id** | **String** | (optional) A unique origination identifier. | [optional] |
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
require 'bandwidth-sdk'
|
|
15
15
|
|
|
16
16
|
instance = Bandwidth::StirShaken.new(
|
|
17
|
-
verstat: Tn-
|
|
17
|
+
verstat: Tn-Validation-Passed,
|
|
18
18
|
attestation_indicator: A,
|
|
19
19
|
originating_id: 99759086-1335-11ed-9bcf-5f7d464e91af
|
|
20
20
|
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Bandwidth::SyncLookupRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **phone_numbers** | **Array<String>** | Telephone numbers in E.164 format. | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'bandwidth-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Bandwidth::SyncLookupRequest.new(
|
|
15
|
+
phone_numbers: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -19,37 +19,37 @@ module Bandwidth
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# Create Lookup
|
|
23
|
-
#
|
|
24
|
-
# @param account_id [String]
|
|
25
|
-
# @param
|
|
22
|
+
# Create Asynchronous Bulk Number Lookup
|
|
23
|
+
# Creates an asynchronous bulk phone number lookup request. Maximum of 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) endpoint to check the status of the request and view the results.
|
|
24
|
+
# @param account_id [String]
|
|
25
|
+
# @param async_lookup_request [AsyncLookupRequest] Asynchronous bulk phone number lookup request.
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
|
-
# @return [
|
|
28
|
-
def
|
|
29
|
-
data, _status_code, _headers =
|
|
27
|
+
# @return [CreateAsyncBulkLookupResponse]
|
|
28
|
+
def create_async_bulk_lookup(account_id, async_lookup_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_async_bulk_lookup_with_http_info(account_id, async_lookup_request, opts)
|
|
30
30
|
data
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# Create Lookup
|
|
34
|
-
#
|
|
35
|
-
# @param account_id [String]
|
|
36
|
-
# @param
|
|
33
|
+
# Create Asynchronous Bulk Number Lookup
|
|
34
|
+
# Creates an asynchronous bulk phone number lookup request. Maximum of 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) endpoint to check the status of the request and view the results.
|
|
35
|
+
# @param account_id [String]
|
|
36
|
+
# @param async_lookup_request [AsyncLookupRequest] Asynchronous bulk phone number lookup request.
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
|
-
# @return [Array<(
|
|
39
|
-
def
|
|
38
|
+
# @return [Array<(CreateAsyncBulkLookupResponse, Integer, Hash)>] CreateAsyncBulkLookupResponse data, response status code and response headers
|
|
39
|
+
def create_async_bulk_lookup_with_http_info(account_id, async_lookup_request, opts = {})
|
|
40
40
|
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.create_async_bulk_lookup ...'
|
|
42
42
|
end
|
|
43
43
|
# verify the required parameter 'account_id' is set
|
|
44
44
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
45
|
-
fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.create_async_bulk_lookup"
|
|
46
46
|
end
|
|
47
|
-
# verify the required parameter '
|
|
48
|
-
if @api_client.config.client_side_validation &&
|
|
49
|
-
fail ArgumentError, "Missing the required parameter '
|
|
47
|
+
# verify the required parameter 'async_lookup_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && async_lookup_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'async_lookup_request' when calling PhoneNumberLookupApi.create_async_bulk_lookup"
|
|
50
50
|
end
|
|
51
51
|
# resource path
|
|
52
|
-
local_var_path = '/accounts/{accountId}/
|
|
52
|
+
local_var_path = '/accounts/{accountId}/phoneNumberLookup/bulk'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
53
53
|
|
|
54
54
|
# query parameters
|
|
55
55
|
query_params = opts[:query_params] || {}
|
|
@@ -68,16 +68,16 @@ module Bandwidth
|
|
|
68
68
|
form_params = opts[:form_params] || {}
|
|
69
69
|
|
|
70
70
|
# http body (model)
|
|
71
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(async_lookup_request)
|
|
72
72
|
|
|
73
73
|
# return_type
|
|
74
|
-
return_type = opts[:debug_return_type] || '
|
|
74
|
+
return_type = opts[:debug_return_type] || 'CreateAsyncBulkLookupResponse'
|
|
75
75
|
|
|
76
76
|
# auth_names
|
|
77
77
|
auth_names = opts[:debug_auth_names] || ['Basic']
|
|
78
78
|
|
|
79
79
|
new_options = opts.merge(
|
|
80
|
-
:operation => :"PhoneNumberLookupApi.
|
|
80
|
+
:operation => :"PhoneNumberLookupApi.create_async_bulk_lookup",
|
|
81
81
|
:header_params => header_params,
|
|
82
82
|
:query_params => query_params,
|
|
83
83
|
:form_params => form_params,
|
|
@@ -88,42 +88,116 @@ module Bandwidth
|
|
|
88
88
|
|
|
89
89
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
90
|
if @api_client.config.debugging
|
|
91
|
-
@api_client.config.logger.debug "API called: PhoneNumberLookupApi#
|
|
91
|
+
@api_client.config.logger.debug "API called: PhoneNumberLookupApi#create_async_bulk_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
92
|
end
|
|
93
93
|
return data, status_code, headers
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
# @param account_id [String]
|
|
99
|
-
# @param
|
|
96
|
+
# Create Synchronous Number Lookup
|
|
97
|
+
# Creates a synchronous phone number lookup request. Maximum of 100 telephone numbers per request.
|
|
98
|
+
# @param account_id [String]
|
|
99
|
+
# @param sync_lookup_request [SyncLookupRequest] Synchronous phone number lookup request.
|
|
100
100
|
# @param [Hash] opts the optional parameters
|
|
101
|
-
# @return [
|
|
102
|
-
def
|
|
103
|
-
data, _status_code, _headers =
|
|
101
|
+
# @return [CreateSyncLookupResponse]
|
|
102
|
+
def create_sync_lookup(account_id, sync_lookup_request, opts = {})
|
|
103
|
+
data, _status_code, _headers = create_sync_lookup_with_http_info(account_id, sync_lookup_request, opts)
|
|
104
104
|
data
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
# @param account_id [String]
|
|
110
|
-
# @param
|
|
107
|
+
# Create Synchronous Number Lookup
|
|
108
|
+
# Creates a synchronous phone number lookup request. Maximum of 100 telephone numbers per request.
|
|
109
|
+
# @param account_id [String]
|
|
110
|
+
# @param sync_lookup_request [SyncLookupRequest] Synchronous phone number lookup request.
|
|
111
111
|
# @param [Hash] opts the optional parameters
|
|
112
|
-
# @return [Array<(
|
|
113
|
-
def
|
|
112
|
+
# @return [Array<(CreateSyncLookupResponse, Integer, Hash)>] CreateSyncLookupResponse data, response status code and response headers
|
|
113
|
+
def create_sync_lookup_with_http_info(account_id, sync_lookup_request, opts = {})
|
|
114
114
|
if @api_client.config.debugging
|
|
115
|
-
@api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.create_sync_lookup ...'
|
|
116
116
|
end
|
|
117
117
|
# verify the required parameter 'account_id' is set
|
|
118
118
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
119
|
-
fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.create_sync_lookup"
|
|
120
|
+
end
|
|
121
|
+
# verify the required parameter 'sync_lookup_request' is set
|
|
122
|
+
if @api_client.config.client_side_validation && sync_lookup_request.nil?
|
|
123
|
+
fail ArgumentError, "Missing the required parameter 'sync_lookup_request' when calling PhoneNumberLookupApi.create_sync_lookup"
|
|
124
|
+
end
|
|
125
|
+
# resource path
|
|
126
|
+
local_var_path = '/accounts/{accountId}/phoneNumberLookup'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
127
|
+
|
|
128
|
+
# query parameters
|
|
129
|
+
query_params = opts[:query_params] || {}
|
|
130
|
+
|
|
131
|
+
# header parameters
|
|
132
|
+
header_params = opts[:header_params] || {}
|
|
133
|
+
# HTTP header 'Accept' (if needed)
|
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
135
|
+
# HTTP header 'Content-Type'
|
|
136
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
137
|
+
if !content_type.nil?
|
|
138
|
+
header_params['Content-Type'] = content_type
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(sync_lookup_request)
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'CreateSyncLookupResponse'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['Basic']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"PhoneNumberLookupApi.create_sync_lookup",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: PhoneNumberLookupApi#create_sync_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Get Asynchronous Bulk Number Lookup
|
|
171
|
+
# Get an existing [Asynchronous Bulk Number Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use this endpoint to check the status of the request and view the results.
|
|
172
|
+
# @param account_id [String]
|
|
173
|
+
# @param request_id [String]
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @return [GetAsyncBulkLookupResponse]
|
|
176
|
+
def get_async_bulk_lookup(account_id, request_id, opts = {})
|
|
177
|
+
data, _status_code, _headers = get_async_bulk_lookup_with_http_info(account_id, request_id, opts)
|
|
178
|
+
data
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Get Asynchronous Bulk Number Lookup
|
|
182
|
+
# Get an existing [Asynchronous Bulk Number Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use this endpoint to check the status of the request and view the results.
|
|
183
|
+
# @param account_id [String]
|
|
184
|
+
# @param request_id [String]
|
|
185
|
+
# @param [Hash] opts the optional parameters
|
|
186
|
+
# @return [Array<(GetAsyncBulkLookupResponse, Integer, Hash)>] GetAsyncBulkLookupResponse data, response status code and response headers
|
|
187
|
+
def get_async_bulk_lookup_with_http_info(account_id, request_id, opts = {})
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
@api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.get_async_bulk_lookup ...'
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'account_id' is set
|
|
192
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.get_async_bulk_lookup"
|
|
120
194
|
end
|
|
121
195
|
# verify the required parameter 'request_id' is set
|
|
122
196
|
if @api_client.config.client_side_validation && request_id.nil?
|
|
123
|
-
fail ArgumentError, "Missing the required parameter 'request_id' when calling PhoneNumberLookupApi.
|
|
197
|
+
fail ArgumentError, "Missing the required parameter 'request_id' when calling PhoneNumberLookupApi.get_async_bulk_lookup"
|
|
124
198
|
end
|
|
125
199
|
# resource path
|
|
126
|
-
local_var_path = '/accounts/{accountId}/
|
|
200
|
+
local_var_path = '/accounts/{accountId}/phoneNumberLookup/bulk/{requestId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'requestId' + '}', CGI.escape(request_id.to_s))
|
|
127
201
|
|
|
128
202
|
# query parameters
|
|
129
203
|
query_params = opts[:query_params] || {}
|
|
@@ -140,13 +214,13 @@ module Bandwidth
|
|
|
140
214
|
post_body = opts[:debug_body]
|
|
141
215
|
|
|
142
216
|
# return_type
|
|
143
|
-
return_type = opts[:debug_return_type] || '
|
|
217
|
+
return_type = opts[:debug_return_type] || 'GetAsyncBulkLookupResponse'
|
|
144
218
|
|
|
145
219
|
# auth_names
|
|
146
220
|
auth_names = opts[:debug_auth_names] || ['Basic']
|
|
147
221
|
|
|
148
222
|
new_options = opts.merge(
|
|
149
|
-
:operation => :"PhoneNumberLookupApi.
|
|
223
|
+
:operation => :"PhoneNumberLookupApi.get_async_bulk_lookup",
|
|
150
224
|
:header_params => header_params,
|
|
151
225
|
:query_params => query_params,
|
|
152
226
|
:form_params => form_params,
|
|
@@ -157,7 +231,7 @@ module Bandwidth
|
|
|
157
231
|
|
|
158
232
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
159
233
|
if @api_client.config.debugging
|
|
160
|
-
@api_client.config.logger.debug "API called: PhoneNumberLookupApi#
|
|
234
|
+
@api_client.config.logger.debug "API called: PhoneNumberLookupApi#get_async_bulk_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
161
235
|
end
|
|
162
236
|
return data, status_code, headers
|
|
163
237
|
end
|
|
@@ -414,15 +414,21 @@ module Bandwidth
|
|
|
414
414
|
description: "Production",
|
|
415
415
|
}
|
|
416
416
|
],
|
|
417
|
-
"PhoneNumberLookupApi.
|
|
417
|
+
"PhoneNumberLookupApi.create_async_bulk_lookup": [
|
|
418
418
|
{
|
|
419
|
-
url: "https://
|
|
419
|
+
url: "https://api.bandwidth.com/v2",
|
|
420
420
|
description: "Production",
|
|
421
421
|
}
|
|
422
422
|
],
|
|
423
|
-
"PhoneNumberLookupApi.
|
|
423
|
+
"PhoneNumberLookupApi.create_sync_lookup": [
|
|
424
424
|
{
|
|
425
|
-
url: "https://
|
|
425
|
+
url: "https://api.bandwidth.com/v2",
|
|
426
|
+
description: "Production",
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"PhoneNumberLookupApi.get_async_bulk_lookup": [
|
|
430
|
+
{
|
|
431
|
+
url: "https://api.bandwidth.com/v2",
|
|
426
432
|
description: "Production",
|
|
427
433
|
}
|
|
428
434
|
],
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Bandwidth
|
|
3
|
+
|
|
4
|
+
#Bandwidth's Communication APIs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: letstalk@bandwidth.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Bandwidth
|
|
17
|
+
class AsyncLookupRequest
|
|
18
|
+
# Telephone numbers in E.164 format.
|
|
19
|
+
attr_accessor :phone_numbers
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'phone_numbers' => :'phoneNumbers'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'phone_numbers' => :'Array<String>'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::AsyncLookupRequest` initialize method'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AsyncLookupRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'phone_numbers')
|
|
62
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
|
63
|
+
self.phone_numbers = value
|
|
64
|
+
end
|
|
65
|
+
else
|
|
66
|
+
self.phone_numbers = nil
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
71
|
+
# @return Array for valid properties with the reasons
|
|
72
|
+
def list_invalid_properties
|
|
73
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
74
|
+
invalid_properties = Array.new
|
|
75
|
+
if @phone_numbers.nil?
|
|
76
|
+
invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.')
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
invalid_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Check to see if the all the properties in the model are valid
|
|
83
|
+
# @return true if the model is valid
|
|
84
|
+
def valid?
|
|
85
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
86
|
+
return false if @phone_numbers.nil?
|
|
87
|
+
true
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Custom attribute writer method with validation
|
|
91
|
+
# @param [Object] phone_numbers Value to be assigned
|
|
92
|
+
def phone_numbers=(phone_numbers)
|
|
93
|
+
if phone_numbers.nil?
|
|
94
|
+
fail ArgumentError, 'phone_numbers cannot be nil'
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
@phone_numbers = phone_numbers
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Checks equality by comparing each attribute.
|
|
101
|
+
# @param [Object] Object to be compared
|
|
102
|
+
def ==(o)
|
|
103
|
+
return true if self.equal?(o)
|
|
104
|
+
self.class == o.class &&
|
|
105
|
+
phone_numbers == o.phone_numbers
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# @see the `==` method
|
|
109
|
+
# @param [Object] Object to be compared
|
|
110
|
+
def eql?(o)
|
|
111
|
+
self == o
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Calculates hash code according to all attributes.
|
|
115
|
+
# @return [Integer] Hash code
|
|
116
|
+
def hash
|
|
117
|
+
[phone_numbers].hash
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Builds the object from hash
|
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
122
|
+
# @return [Object] Returns the model itself
|
|
123
|
+
def self.build_from_hash(attributes)
|
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
|
125
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
126
|
+
transformed_hash = {}
|
|
127
|
+
openapi_types.each_pair do |key, type|
|
|
128
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
129
|
+
transformed_hash["#{key}"] = nil
|
|
130
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
131
|
+
# check to ensure the input is an array given that the attribute
|
|
132
|
+
# is documented as an array but the input is not
|
|
133
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
134
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
135
|
+
end
|
|
136
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
137
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
new(transformed_hash)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Deserializes the data based on type
|
|
144
|
+
# @param string type Data type
|
|
145
|
+
# @param string value Value to be deserialized
|
|
146
|
+
# @return [Object] Deserialized data
|
|
147
|
+
def self._deserialize(type, value)
|
|
148
|
+
case type.to_sym
|
|
149
|
+
when :Time
|
|
150
|
+
Time.parse(value)
|
|
151
|
+
when :Date
|
|
152
|
+
Date.parse(value)
|
|
153
|
+
when :String
|
|
154
|
+
value.to_s
|
|
155
|
+
when :Integer
|
|
156
|
+
value.to_i
|
|
157
|
+
when :Float
|
|
158
|
+
value.to_f
|
|
159
|
+
when :Boolean
|
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
+
true
|
|
162
|
+
else
|
|
163
|
+
false
|
|
164
|
+
end
|
|
165
|
+
when :Object
|
|
166
|
+
# generic object (usually a Hash), return directly
|
|
167
|
+
value
|
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
|
174
|
+
{}.tap do |hash|
|
|
175
|
+
value.each do |k, v|
|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
else # model
|
|
180
|
+
# models (e.g. Pet) or oneOf
|
|
181
|
+
klass = Bandwidth.const_get(type)
|
|
182
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the string representation of the object
|
|
187
|
+
# @return [String] String presentation of the object
|
|
188
|
+
def to_s
|
|
189
|
+
to_hash.to_s
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_body
|
|
195
|
+
to_hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Outputs non-array value in the form of hash
|
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
216
|
+
# @param [Object] value Any valid value
|
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
|
218
|
+
def _to_hash(value)
|
|
219
|
+
if value.is_a?(Array)
|
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
|
221
|
+
elsif value.is_a?(Hash)
|
|
222
|
+
{}.tap do |hash|
|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
224
|
+
end
|
|
225
|
+
elsif value.respond_to? :to_hash
|
|
226
|
+
value.to_hash
|
|
227
|
+
else
|
|
228
|
+
value
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
@@ -38,7 +38,7 @@ module Bandwidth
|
|
|
38
38
|
# The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values.
|
|
39
39
|
attr_accessor :state
|
|
40
40
|
|
|
41
|
-
# For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-
|
|
41
|
+
# For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Validation-Passed` or `TN-Validation-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken).
|
|
42
42
|
attr_accessor :stir_shaken
|
|
43
43
|
|
|
44
44
|
# The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Bandwidth
|
|
3
|
+
|
|
4
|
+
#Bandwidth's Communication APIs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: letstalk@bandwidth.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Bandwidth
|
|
17
|
+
class CompletedLookupStatusEnum
|
|
18
|
+
COMPLETE = 'COMPLETE'.freeze
|
|
19
|
+
PARTIAL_COMPLETE = 'PARTIAL_COMPLETE'.freeze
|
|
20
|
+
FAILED = 'FAILED'.freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [COMPLETE, PARTIAL_COMPLETE, FAILED].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the enum from string
|
|
34
|
+
# @param [String] The enum value in the form of the string
|
|
35
|
+
# @return [String] The enum value
|
|
36
|
+
def build_from_hash(value)
|
|
37
|
+
return value if CompletedLookupStatusEnum.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #CompletedLookupStatusEnum"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|