bandwidth-sdk 19.1.0 → 19.1.1

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.
@@ -0,0 +1,15 @@
1
+ # Bandwidth::AttestationLevelEnum
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'bandwidth-sdk'
12
+
13
+ instance = Bandwidth::AttestationLevelEnum.new()
14
+ ```
15
+
data/docs/CreateCall.md CHANGED
@@ -9,6 +9,8 @@
9
9
  | **privacy** | **Boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] |
10
10
  | **display_name** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] |
11
11
  | **uui** | **String** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] |
12
+ | **requested_attestation_level** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href='/docs/voice/stir-shaken/hosted-signing-service'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. | [optional] |
13
+ | **identity** | **String** | A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. | [optional] |
12
14
  | **application_id** | **String** | The id of the application associated with the `from` number. | |
13
15
  | **answer_url** | **String** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | |
14
16
  | **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
@@ -37,6 +39,8 @@ instance = Bandwidth::CreateCall.new(
37
39
  privacy: false,
38
40
  display_name: John Doe,
39
41
  uui: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64,
42
+ requested_attestation_level: null,
43
+ identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken",
40
44
  application_id: 1234-qwer-5679-tyui,
41
45
  answer_url: https://www.myCallbackServer.example/webhooks/answer,
42
46
  answer_method: null,
@@ -25,6 +25,8 @@
25
25
  | **fallback_username** | **String** | Basic auth username. | [optional] |
26
26
  | **fallback_password** | **String** | Basic auth password. | [optional] |
27
27
  | **priority** | **Integer** | The priority of this call over other calls from your account. | [optional] |
28
+ | **requested_attestation_level** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. | [optional] |
29
+ | **identity** | **String** | The `identity` value provided in the Create Call request, if any. | [optional] |
28
30
 
29
31
  ## Example
30
32
 
@@ -52,7 +54,9 @@ instance = Bandwidth::CreateCallResponse.new(
52
54
  password: mySecretPassword1!,
53
55
  fallback_username: mySecretUsername,
54
56
  fallback_password: mySecretPassword1!,
55
- priority: 5
57
+ priority: 5,
58
+ requested_attestation_level: null,
59
+ identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"
56
60
  )
57
61
  ```
58
62
 
data/docs/LookupResult.md CHANGED
@@ -32,8 +32,8 @@ instance = Bandwidth::LookupResult.new(
32
32
  deactivation_date: 2025-06-20 18:35,
33
33
  deactivation_event: null,
34
34
  latest_message_delivery_status: null,
35
- initial_message_delivery_status_date: Thu Jun 19 20:00:00 EDT 2025,
36
- latest_message_delivery_status_date: Fri Jun 20 20:00:00 EDT 2025,
35
+ initial_message_delivery_status_date: Fri Jun 20 00:00:00 UTC 2025,
36
+ latest_message_delivery_status_date: Sat Jun 21 00:00:00 UTC 2025,
37
37
  rcs_enabled: true
38
38
  )
39
39
  ```
@@ -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.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class AttestationLevelEnum
18
+ A = 'A'.freeze
19
+ B = 'B'.freeze
20
+ C = 'C'.freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [A, B, C].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 AttestationLevelEnum.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #AttestationLevelEnum"
39
+ end
40
+ end
41
+ end
@@ -30,6 +30,12 @@ module Bandwidth
30
30
  # A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.
31
31
  attr_accessor :uui
32
32
 
33
+ # The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href='/docs/voice/stir-shaken/hosted-signing-service'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`.
34
+ attr_accessor :requested_attestation_level
35
+
36
+ # A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`.
37
+ attr_accessor :identity
38
+
33
39
  # The id of the application associated with the `from` number.
34
40
  attr_accessor :application_id
35
41
 
@@ -104,6 +110,8 @@ module Bandwidth
104
110
  :'privacy' => :'privacy',
105
111
  :'display_name' => :'displayName',
106
112
  :'uui' => :'uui',
113
+ :'requested_attestation_level' => :'requestedAttestationLevel',
114
+ :'identity' => :'identity',
107
115
  :'application_id' => :'applicationId',
108
116
  :'answer_url' => :'answerUrl',
109
117
  :'answer_method' => :'answerMethod',
@@ -141,6 +149,8 @@ module Bandwidth
141
149
  :'privacy' => :'Boolean',
142
150
  :'display_name' => :'String',
143
151
  :'uui' => :'String',
152
+ :'requested_attestation_level' => :'AttestationLevelEnum',
153
+ :'identity' => :'String',
144
154
  :'application_id' => :'String',
145
155
  :'answer_url' => :'String',
146
156
  :'answer_method' => :'CallbackMethodEnum',
@@ -166,6 +176,8 @@ module Bandwidth
166
176
  :'privacy',
167
177
  :'display_name',
168
178
  :'uui',
179
+ :'requested_attestation_level',
180
+ :'identity',
169
181
  :'answer_method',
170
182
  :'username',
171
183
  :'password',
@@ -222,6 +234,14 @@ module Bandwidth
222
234
  self.uui = attributes[:'uui']
223
235
  end
224
236
 
237
+ if attributes.key?(:'requested_attestation_level')
238
+ self.requested_attestation_level = attributes[:'requested_attestation_level']
239
+ end
240
+
241
+ if attributes.key?(:'identity')
242
+ self.identity = attributes[:'identity']
243
+ end
244
+
225
245
  if attributes.key?(:'application_id')
226
246
  self.application_id = attributes[:'application_id']
227
247
  else
@@ -320,6 +340,19 @@ module Bandwidth
320
340
  invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 256.')
321
341
  end
322
342
 
343
+ if !@identity.nil? && @identity.to_s.length > 2000
344
+ invalid_properties.push('invalid value for "identity", the character length must be smaller than or equal to 2000.')
345
+ end
346
+
347
+ if !@identity.nil? && @identity.to_s.length < 1
348
+ invalid_properties.push('invalid value for "identity", the character length must be greater than or equal to 1.')
349
+ end
350
+
351
+ pattern = Regexp.new(/^ *[A-Za-z0-9\-_.+\/=;:<>"][A-Za-z0-9\-_.+\/=;:<>" ]*$/)
352
+ if !@identity.nil? && @identity !~ pattern
353
+ invalid_properties.push("invalid value for \"identity\", must conform to the pattern #{pattern}.")
354
+ end
355
+
323
356
  if @application_id.nil?
324
357
  invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
325
358
  end
@@ -394,6 +427,9 @@ module Bandwidth
394
427
  return false if @to.nil?
395
428
  return false if @from.nil?
396
429
  return false if !@display_name.nil? && @display_name.to_s.length > 256
430
+ return false if !@identity.nil? && @identity.to_s.length > 2000
431
+ return false if !@identity.nil? && @identity.to_s.length < 1
432
+ return false if !@identity.nil? && @identity !~ Regexp.new(/^ *[A-Za-z0-9\-_.+\/=;:<>"][A-Za-z0-9\-_.+\/=;:<>" ]*$/)
397
433
  return false if @application_id.nil?
398
434
  return false if @answer_url.nil?
399
435
  return false if @answer_url.to_s.length > 2048
@@ -443,6 +479,25 @@ module Bandwidth
443
479
  @display_name = display_name
444
480
  end
445
481
 
482
+ # Custom attribute writer method with validation
483
+ # @param [Object] identity Value to be assigned
484
+ def identity=(identity)
485
+ if !identity.nil? && identity.to_s.length > 2000
486
+ fail ArgumentError, 'invalid value for "identity", the character length must be smaller than or equal to 2000.'
487
+ end
488
+
489
+ if !identity.nil? && identity.to_s.length < 1
490
+ fail ArgumentError, 'invalid value for "identity", the character length must be greater than or equal to 1.'
491
+ end
492
+
493
+ pattern = Regexp.new(/^ *[A-Za-z0-9\-_.+\/=;:<>"][A-Za-z0-9\-_.+\/=;:<>" ]*$/)
494
+ if !identity.nil? && identity !~ pattern
495
+ fail ArgumentError, "invalid value for \"identity\", must conform to the pattern #{pattern}."
496
+ end
497
+
498
+ @identity = identity
499
+ end
500
+
446
501
  # Custom attribute writer method with validation
447
502
  # @param [Object] application_id Value to be assigned
448
503
  def application_id=(application_id)
@@ -589,6 +644,8 @@ module Bandwidth
589
644
  privacy == o.privacy &&
590
645
  display_name == o.display_name &&
591
646
  uui == o.uui &&
647
+ requested_attestation_level == o.requested_attestation_level &&
648
+ identity == o.identity &&
592
649
  application_id == o.application_id &&
593
650
  answer_url == o.answer_url &&
594
651
  answer_method == o.answer_method &&
@@ -616,7 +673,7 @@ module Bandwidth
616
673
  # Calculates hash code according to all attributes.
617
674
  # @return [Integer] Hash code
618
675
  def hash
619
- [to, from, privacy, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
676
+ [to, from, privacy, display_name, uui, requested_attestation_level, identity, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
620
677
  end
621
678
 
622
679
  # Builds the object from hash
@@ -75,6 +75,12 @@ module Bandwidth
75
75
  # The priority of this call over other calls from your account.
76
76
  attr_accessor :priority
77
77
 
78
+ # The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with.
79
+ attr_accessor :requested_attestation_level
80
+
81
+ # The `identity` value provided in the Create Call request, if any.
82
+ attr_accessor :identity
83
+
78
84
  class EnumAttributeValidator
79
85
  attr_reader :datatype
80
86
  attr_reader :allowable_values
@@ -120,7 +126,9 @@ module Bandwidth
120
126
  :'password' => :'password',
121
127
  :'fallback_username' => :'fallbackUsername',
122
128
  :'fallback_password' => :'fallbackPassword',
123
- :'priority' => :'priority'
129
+ :'priority' => :'priority',
130
+ :'requested_attestation_level' => :'requestedAttestationLevel',
131
+ :'identity' => :'identity'
124
132
  }
125
133
  end
126
134
 
@@ -157,7 +165,9 @@ module Bandwidth
157
165
  :'password' => :'String',
158
166
  :'fallback_username' => :'String',
159
167
  :'fallback_password' => :'String',
160
- :'priority' => :'Integer'
168
+ :'priority' => :'Integer',
169
+ :'requested_attestation_level' => :'AttestationLevelEnum',
170
+ :'identity' => :'String'
161
171
  }
162
172
  end
163
173
 
@@ -175,7 +185,9 @@ module Bandwidth
175
185
  :'password',
176
186
  :'fallback_username',
177
187
  :'fallback_password',
178
- :'priority'
188
+ :'priority',
189
+ :'requested_attestation_level',
190
+ :'identity'
179
191
  ])
180
192
  end
181
193
 
@@ -298,6 +310,14 @@ module Bandwidth
298
310
  if attributes.key?(:'priority')
299
311
  self.priority = attributes[:'priority']
300
312
  end
313
+
314
+ if attributes.key?(:'requested_attestation_level')
315
+ self.requested_attestation_level = attributes[:'requested_attestation_level']
316
+ end
317
+
318
+ if attributes.key?(:'identity')
319
+ self.identity = attributes[:'identity']
320
+ end
301
321
  end
302
322
 
303
323
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -505,7 +525,9 @@ module Bandwidth
505
525
  password == o.password &&
506
526
  fallback_username == o.fallback_username &&
507
527
  fallback_password == o.fallback_password &&
508
- priority == o.priority
528
+ priority == o.priority &&
529
+ requested_attestation_level == o.requested_attestation_level &&
530
+ identity == o.identity
509
531
  end
510
532
 
511
533
  # @see the `==` method
@@ -517,7 +539,7 @@ module Bandwidth
517
539
  # Calculates hash code according to all attributes.
518
540
  # @return [Integer] Hash code
519
541
  def hash
520
- [application_id, account_id, call_id, to, from, enqueued_time, call_url, call_timeout, callback_timeout, tag, answer_method, answer_url, answer_fallback_method, answer_fallback_url, disconnect_method, disconnect_url, username, password, fallback_username, fallback_password, priority].hash
542
+ [application_id, account_id, call_id, to, from, enqueued_time, call_url, call_timeout, callback_timeout, tag, answer_method, answer_url, answer_fallback_method, answer_fallback_url, disconnect_method, disconnect_url, username, password, fallback_username, fallback_password, priority, requested_attestation_level, identity].hash
521
543
  end
522
544
 
523
545
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.24.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '19.1.0'
14
+ VERSION = '19.1.1'
15
15
  end
data/lib/bandwidth-sdk.rb CHANGED
@@ -23,6 +23,7 @@ require 'bandwidth-sdk/models/additional_denial_reason'
23
23
  require 'bandwidth-sdk/models/address'
24
24
  require 'bandwidth-sdk/models/answer_callback'
25
25
  require 'bandwidth-sdk/models/async_lookup_request'
26
+ require 'bandwidth-sdk/models/attestation_level_enum'
26
27
  require 'bandwidth-sdk/models/blocked_webhook'
27
28
  require 'bandwidth-sdk/models/bridge_complete_callback'
28
29
  require 'bandwidth-sdk/models/bridge_target_complete_callback'
@@ -60,6 +60,8 @@ describe 'CallsApi' do
60
60
  machine_detection: amd_config,
61
61
  priority: 5,
62
62
  tag: 'tag_example',
63
+ requested_attestation_level: Bandwidth::AttestationLevelEnum::B,
64
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"',
63
65
  )
64
66
 
65
67
  data, status_code = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
@@ -0,0 +1,40 @@
1
+ # Unit tests for Bandwidth::AttestationLevelEnum
2
+ describe Bandwidth::AttestationLevelEnum do
3
+ describe 'constants' do
4
+ it 'defines A' do
5
+ expect(Bandwidth::AttestationLevelEnum::A).to eq('A')
6
+ end
7
+
8
+ it 'defines B' do
9
+ expect(Bandwidth::AttestationLevelEnum::B).to eq('B')
10
+ end
11
+
12
+ it 'defines C' do
13
+ expect(Bandwidth::AttestationLevelEnum::C).to eq('C')
14
+ end
15
+ end
16
+
17
+ describe '.all_vars' do
18
+ it 'returns every valid enum value' do
19
+ expect(Bandwidth::AttestationLevelEnum.all_vars).to eq([
20
+ 'A',
21
+ 'B',
22
+ 'C'
23
+ ])
24
+ end
25
+ end
26
+
27
+ describe '.build_from_hash' do
28
+ it 'returns the value when it matches a valid enum value' do
29
+ expect(Bandwidth::AttestationLevelEnum.build_from_hash('A')).to eq('A')
30
+ expect(Bandwidth::AttestationLevelEnum.build_from_hash('B')).to eq('B')
31
+ expect(Bandwidth::AttestationLevelEnum.build_from_hash('C')).to eq('C')
32
+ end
33
+
34
+ it 'raises an error for an invalid enum value' do
35
+ expect {
36
+ Bandwidth::AttestationLevelEnum.build_from_hash('invalid')
37
+ }.to raise_error(RuntimeError)
38
+ end
39
+ end
40
+ end
@@ -30,7 +30,9 @@ describe Bandwidth::CreateCallResponse do
30
30
  password: 'pass',
31
31
  fallback_username: 'fallback_user',
32
32
  fallback_password: 'fallback_pass',
33
- priority: 5
33
+ priority: 5,
34
+ requested_attestation_level: Bandwidth::AttestationLevelEnum::B,
35
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"'
34
36
  }) }
35
37
 
36
38
  describe '#initialize' do
@@ -67,7 +69,9 @@ describe Bandwidth::CreateCallResponse do
67
69
  :'password',
68
70
  :'fallback_username',
69
71
  :'fallback_password',
70
- :'priority'
72
+ :'priority',
73
+ :'requested_attestation_level',
74
+ :'identity'
71
75
  ]))
72
76
  end
73
77
  end
@@ -95,7 +99,9 @@ describe Bandwidth::CreateCallResponse do
95
99
  password: 'pass',
96
100
  fallbackUsername: 'fallback_user',
97
101
  fallbackPassword: 'fallback_pass',
98
- priority: 5
102
+ priority: 5,
103
+ requestedAttestationLevel: 'B',
104
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"'
99
105
  })
100
106
  expect(create_call_response_from_hash).to be_instance_of(Bandwidth::CreateCallResponse)
101
107
  expect(create_call_response_from_hash.application_id).to eq('04e88489-df02-4e34-a0ee-27a91849555f')
@@ -119,12 +125,14 @@ describe Bandwidth::CreateCallResponse do
119
125
  expect(create_call_response_from_hash.fallback_username).to eq('fallback_user')
120
126
  expect(create_call_response_from_hash.fallback_password).to eq('fallback_pass')
121
127
  expect(create_call_response_from_hash.priority).to eq(5)
128
+ expect(create_call_response_from_hash.requested_attestation_level).to eq(Bandwidth::AttestationLevelEnum::B)
129
+ expect(create_call_response_from_hash.identity).to eq('eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"')
122
130
  end
123
131
  end
124
132
 
125
133
  describe '#to_s' do
126
134
  it 'returns a string representation of the object' do
127
- expect(create_call_response_values.to_s).to eq({ :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :accountId => '9900000', :callId => 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :to => '+19195551234', :from => '+19195554321', :enqueuedTime => '2022-06-16T13:15:07.160Z', :callUrl => 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-1', :callTimeout => 30.0, :callbackTimeout => 15.0, :tag => 'custom tag', :answerMethod => 'POST', :answerUrl => 'https://example.com/answer', :answerFallbackMethod => 'POST', :answerFallbackUrl => 'https://example.com/answer-fallback', :disconnectMethod => 'POST', :disconnectUrl => 'https://example.com/disconnect', :username => 'user', :password => 'pass', :fallbackUsername => 'fallback_user', :fallbackPassword => 'fallback_pass', :priority => 5 }.to_s)
135
+ expect(create_call_response_values.to_s).to eq({ :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :accountId => '9900000', :callId => 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', :to => '+19195551234', :from => '+19195554321', :enqueuedTime => '2022-06-16T13:15:07.160Z', :callUrl => 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-1', :callTimeout => 30.0, :callbackTimeout => 15.0, :tag => 'custom tag', :answerMethod => 'POST', :answerUrl => 'https://example.com/answer', :answerFallbackMethod => 'POST', :answerFallbackUrl => 'https://example.com/answer-fallback', :disconnectMethod => 'POST', :disconnectUrl => 'https://example.com/disconnect', :username => 'user', :password => 'pass', :fallbackUsername => 'fallback_user', :fallbackPassword => 'fallback_pass', :priority => 5, :requestedAttestationLevel => 'B', :identity => 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"' }.to_s)
128
136
  end
129
137
  end
130
138
 
@@ -167,7 +175,9 @@ describe Bandwidth::CreateCallResponse do
167
175
  password: 'pass',
168
176
  fallbackUsername: 'fallback_user',
169
177
  fallbackPassword: 'fallback_pass',
170
- priority: 5
178
+ priority: 5,
179
+ requestedAttestationLevel: Bandwidth::AttestationLevelEnum::B,
180
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"'
171
181
  })
172
182
  end
173
183
  end
@@ -12,6 +12,8 @@ describe Bandwidth::CreateCall do
12
12
  privacy: false,
13
13
  display_name: 'Caller Name',
14
14
  uui: 'eyJ0eXAiOiJKV1Q;encoding=jwt',
15
+ requested_attestation_level: Bandwidth::AttestationLevelEnum::B,
16
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"',
15
17
  application_id: '04e88489-df02-4e34-a0ee-27a91849555f',
16
18
  answer_url: 'https://example.com/answer',
17
19
  answer_method: Bandwidth::CallbackMethodEnum::POST,
@@ -56,6 +58,8 @@ describe Bandwidth::CreateCall do
56
58
  :'privacy',
57
59
  :'display_name',
58
60
  :'uui',
61
+ :'requested_attestation_level',
62
+ :'identity',
59
63
  :'answer_method',
60
64
  :'username',
61
65
  :'password',
@@ -81,6 +85,8 @@ describe Bandwidth::CreateCall do
81
85
  privacy: false,
82
86
  displayName: 'Caller Name',
83
87
  uui: 'eyJ0eXAiOiJKV1Q;encoding=jwt',
88
+ requestedAttestationLevel: 'B',
89
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"',
84
90
  applicationId: '04e88489-df02-4e34-a0ee-27a91849555f',
85
91
  answerUrl: 'https://example.com/answer',
86
92
  answerMethod: 'POST',
@@ -103,6 +109,8 @@ describe Bandwidth::CreateCall do
103
109
  expect(create_call_from_hash.privacy).to eq(false)
104
110
  expect(create_call_from_hash.display_name).to eq('Caller Name')
105
111
  expect(create_call_from_hash.uui).to eq('eyJ0eXAiOiJKV1Q;encoding=jwt')
112
+ expect(create_call_from_hash.requested_attestation_level).to eq(Bandwidth::AttestationLevelEnum::B)
113
+ expect(create_call_from_hash.identity).to eq('eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"')
106
114
  expect(create_call_from_hash.application_id).to eq('04e88489-df02-4e34-a0ee-27a91849555f')
107
115
  expect(create_call_from_hash.answer_url).to eq('https://example.com/answer')
108
116
  expect(create_call_from_hash.answer_method).to eq(Bandwidth::CallbackMethodEnum::POST)
@@ -123,7 +131,7 @@ describe Bandwidth::CreateCall do
123
131
 
124
132
  describe '#to_s' do
125
133
  it 'returns a string representation of the object' do
126
- expect(create_call_values.to_s).to eq({ :to => '+19195551234', :from => '+19195554321', :privacy => false, :displayName => 'Caller Name', :uui => 'eyJ0eXAiOiJKV1Q;encoding=jwt', :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :answerUrl => 'https://example.com/answer', :answerMethod => 'POST', :username => 'user', :password => 'pass', :answerFallbackUrl => 'https://example.com/answer-fallback', :answerFallbackMethod => 'POST', :fallbackUsername => 'fallback_user', :fallbackPassword => 'fallback_pass', :disconnectUrl => 'https://example.com/disconnect', :disconnectMethod => 'POST', :callTimeout => 30, :callbackTimeout => 15, :machineDetection => {}, :priority => 5, :tag => 'custom tag' }.to_s)
134
+ expect(create_call_values.to_s).to eq({ :to => '+19195551234', :from => '+19195554321', :privacy => false, :displayName => 'Caller Name', :uui => 'eyJ0eXAiOiJKV1Q;encoding=jwt', :requestedAttestationLevel => 'B', :identity => 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"', :applicationId => '04e88489-df02-4e34-a0ee-27a91849555f', :answerUrl => 'https://example.com/answer', :answerMethod => 'POST', :username => 'user', :password => 'pass', :answerFallbackUrl => 'https://example.com/answer-fallback', :answerFallbackMethod => 'POST', :fallbackUsername => 'fallback_user', :fallbackPassword => 'fallback_pass', :disconnectUrl => 'https://example.com/disconnect', :disconnectMethod => 'POST', :callTimeout => 30, :callbackTimeout => 15, :machineDetection => {}, :priority => 5, :tag => 'custom tag' }.to_s)
127
135
  end
128
136
  end
129
137
 
@@ -148,6 +156,8 @@ describe Bandwidth::CreateCall do
148
156
  privacy: false,
149
157
  displayName: 'Caller Name',
150
158
  uui: 'eyJ0eXAiOiJKV1Q;encoding=jwt',
159
+ requestedAttestationLevel: Bandwidth::AttestationLevelEnum::B,
160
+ identity: 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"',
151
161
  applicationId: '04e88489-df02-4e34-a0ee-27a91849555f',
152
162
  answerUrl: 'https://example.com/answer',
153
163
  answerMethod: Bandwidth::CallbackMethodEnum::POST,
@@ -187,6 +197,20 @@ describe Bandwidth::CreateCall do
187
197
  }.to raise_error(ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 256.')
188
198
  end
189
199
 
200
+ it '#identity=' do
201
+ expect {
202
+ Bandwidth::CreateCall.new({ to: 'a', from: 'a', application_id: 'a', answer_url: 'a', identity: 'a' * 2001 })
203
+ }.to raise_error(ArgumentError, 'invalid value for "identity", the character length must be smaller than or equal to 2000.')
204
+
205
+ expect {
206
+ Bandwidth::CreateCall.new({ to: 'a', from: 'a', application_id: 'a', answer_url: 'a', identity: '' })
207
+ }.to raise_error(ArgumentError, 'invalid value for "identity", the character length must be greater than or equal to 1.')
208
+
209
+ expect {
210
+ Bandwidth::CreateCall.new({ to: 'a', from: 'a', application_id: 'a', answer_url: 'a', identity: 'invalid!' })
211
+ }.to raise_error(ArgumentError, /invalid value for "identity", must conform to the pattern/)
212
+ end
213
+
190
214
  it '#application_id=' do
191
215
  expect {
192
216
  Bandwidth::CreateCall.new({ to: 'a', from: 'a', application_id: nil, answer_url: 'a' })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.1.0
4
+ version: 19.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
@@ -157,6 +157,7 @@ files:
157
157
  - docs/Address.md
158
158
  - docs/AnswerCallback.md
159
159
  - docs/AsyncLookupRequest.md
160
+ - docs/AttestationLevelEnum.md
160
161
  - docs/BlockedWebhook.md
161
162
  - docs/BridgeCompleteCallback.md
162
163
  - docs/BridgeTargetCompleteCallback.md
@@ -392,6 +393,7 @@ files:
392
393
  - lib/bandwidth-sdk/models/address.rb
393
394
  - lib/bandwidth-sdk/models/answer_callback.rb
394
395
  - lib/bandwidth-sdk/models/async_lookup_request.rb
396
+ - lib/bandwidth-sdk/models/attestation_level_enum.rb
395
397
  - lib/bandwidth-sdk/models/blocked_webhook.rb
396
398
  - lib/bandwidth-sdk/models/bridge_complete_callback.rb
397
399
  - lib/bandwidth-sdk/models/bridge_target_complete_callback.rb
@@ -666,6 +668,7 @@ files:
666
668
  - spec/unit/models/address_spec.rb
667
669
  - spec/unit/models/answer_callback_spec.rb
668
670
  - spec/unit/models/async_lookup_request_spec.rb
671
+ - spec/unit/models/attestation_level_enum_spec.rb
669
672
  - spec/unit/models/blocked_webhook_spec.rb
670
673
  - spec/unit/models/bridge_complete_callback_spec.rb
671
674
  - spec/unit/models/bridge_target_complete_callback_spec.rb
@@ -957,6 +960,7 @@ test_files:
957
960
  - spec/unit/models/address_spec.rb
958
961
  - spec/unit/models/answer_callback_spec.rb
959
962
  - spec/unit/models/async_lookup_request_spec.rb
963
+ - spec/unit/models/attestation_level_enum_spec.rb
960
964
  - spec/unit/models/blocked_webhook_spec.rb
961
965
  - spec/unit/models/bridge_complete_callback_spec.rb
962
966
  - spec/unit/models/bridge_target_complete_callback_spec.rb