Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ docs/AdditionalDenialReason.md
docs/Address.md
docs/AnswerCallback.md
docs/AsyncLookupRequest.md
docs/AttestationLevelEnum.md
docs/BlockedWebhook.md
docs/BridgeCompleteCallback.md
docs/BridgeTargetCompleteCallback.md
Expand Down Expand Up @@ -237,6 +238,7 @@ models/additional-denial-reason.ts
models/address.ts
models/answer-callback.ts
models/async-lookup-request.ts
models/attestation-level-enum.ts
models/blocked-webhook.ts
models/bridge-complete-callback.ts
models/bridge-target-complete-callback.ts
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Class | Method | HTTP request | Description
- [Address](docs/Address.md)
- [AnswerCallback](docs/AnswerCallback.md)
- [AsyncLookupRequest](docs/AsyncLookupRequest.md)
- [AttestationLevelEnum](docs/AttestationLevelEnum.md)
- [BlockedWebhook](docs/BlockedWebhook.md)
- [BridgeCompleteCallback](docs/BridgeCompleteCallback.md)
- [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md)
Expand Down
70 changes: 70 additions & 0 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3241,6 +3241,16 @@ components:
- direction
- to
- from
attestationLevelEnum:
type: string
enum:
- A
- B
- C
description: >-
The STIR/SHAKEN attestation level Bandwidth signs the call with: `A`
(full), `B` (partial), or `C` (gateway).
example: B
callbackMethodEnum:
type: string
nullable: true
Expand Down Expand Up @@ -3419,6 +3429,52 @@ components:
entire value

cannot exceed 350 characters, including parameters and separators.
requestedAttestationLevel:
nullable: true
allOf:
- $ref: '#/components/schemas/attestationLevelEnum'
description: >-
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`.
identity:
nullable: true
type: string
minLength: 1
maxLength: 2000
pattern: ^ *[A-Za-z0-9\-_.+/=;:<>"][A-Za-z0-9\-_.+/=;:<>" ]*$
description: >-
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`.
example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"
applicationId:
type: string
description: The id of the application associated with the `from` number.
Expand Down Expand Up @@ -3688,6 +3744,20 @@ components:
type: integer
example: 5
description: The priority of this call over other calls from your account.
requestedAttestationLevel:
nullable: true
allOf:
- $ref: '#/components/schemas/attestationLevelEnum'
description: >-
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.
identity:
nullable: true
type: string
description: The `identity` value provided in the Create Call request, if any.
example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"
callState:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions docs/AttestationLevelEnum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AttestationLevelEnum

The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway).

## Enum

* `A` (value: `'A'`)

* `B` (value: `'B'`)

* `C` (value: `'C'`)

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
4 changes: 4 additions & 0 deletions docs/CreateCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Name | Type | Description | Notes
**privacy** | **boolean** | Hide the calling number. The &#x60;displayName&#x60; field can be used to customize the displayed name. | [optional] [default to undefined]
**displayName** | **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 &#x60;privacy&#x60; is true, only the following values are valid: &#x60;Restricted&#x60;, &#x60;Anonymous&#x60;, &#x60;Private&#x60;, or &#x60;Unavailable&#x60;. | [optional] [default to undefined]
**uui** | **string** | A comma-separated list of \&#39;User-To-User\&#39; headers to be sent in the INVITE when calling a SIP URI. Each value must end with an \&#39;encoding\&#39; parameter as described in &lt;a href&#x3D;\&#39;https://tools.ietf.org/html/rfc7433\&#39;&gt;RFC 7433&lt;/a&gt;. Only \&#39;jwt\&#39;, \&#39;base64\&#39; and \&#39;hex\&#39; encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] [default to undefined]
**requestedAttestationLevel** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The STIR/SHAKEN attestation level (&#x60;A&#x60;, &#x60;B&#x60;, or &#x60;C&#x60;) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the &lt;a href&#x3D;\&#39;/docs/voice/stir-shaken/hosted-signing-service\&#39;&gt;Hosted Signing Service&lt;/a&gt;; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with &#x60;identity&#x60;. A request that includes both is rejected with a &#x60;400&#x60;, as is any value other than &#x60;A&#x60;, &#x60;B&#x60;, or &#x60;C&#x60;. | [optional] [default to undefined]
**identity** | **string** | A complete SIP &#x60;Identity&#x60; 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 &#x60;requestedAttestationLevel&#x60;. A request that includes both, or a value that is too long or not in the expected format, is rejected with a &#x60;400&#x60;. | [optional] [default to undefined]
**applicationId** | **string** | The id of the application associated with the &#x60;from&#x60; number. | [default to undefined]
**answerUrl** | **string** | The full URL to send the &lt;a href&#x3D;\&#39;/docs/voice/webhooks/answer\&#39;&gt;Answer&lt;/a&gt; event to when the called party answers. This endpoint should return the first &lt;a href&#x3D;\&#39;/docs/voice/bxml\&#39;&gt;BXML document&lt;/a&gt; to be executed in the call. Must use &#x60;https&#x60; if specifying &#x60;username&#x60; and &#x60;password&#x60;. | [default to undefined]
**answerMethod** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to undefined]
Expand Down Expand Up @@ -38,6 +40,8 @@ const instance: CreateCall = {
privacy,
displayName,
uui,
requestedAttestationLevel,
identity,
applicationId,
answerUrl,
answerMethod,
Expand Down
4 changes: 4 additions & 0 deletions docs/CreateCallResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Name | Type | Description | Notes
**fallbackUsername** | **string** | Basic auth username. | [optional] [default to undefined]
**fallbackPassword** | **string** | Basic auth password. | [optional] [default to undefined]
**priority** | **number** | The priority of this call over other calls from your account. | [optional] [default to undefined]
**requestedAttestationLevel** | [**AttestationLevelEnum**](AttestationLevelEnum.md) | The &#x60;requestedAttestationLevel&#x60; 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] [default to undefined]
**identity** | **string** | The &#x60;identity&#x60; value provided in the Create Call request, if any. | [optional] [default to undefined]

## Example

Expand Down Expand Up @@ -54,6 +56,8 @@ const instance: CreateCallResponse = {
fallbackUsername,
fallbackPassword,
priority,
requestedAttestationLevel,
identity,
};
```

Expand Down
30 changes: 30 additions & 0 deletions models/attestation-level-enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* tslint:disable */
/* eslint-disable */
/**
* Bandwidth
* Bandwidth\'s Communication APIs
*
* The version of the OpenAPI document: 1.0.0
* Contact: letstalk@bandwidth.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



/**
* The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway).
*/

export const AttestationLevelEnum = {
A: 'A',
B: 'B',
C: 'C',
} as const;

export type AttestationLevelEnum = typeof AttestationLevelEnum[keyof typeof AttestationLevelEnum];



11 changes: 11 additions & 0 deletions models/create-call-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/


// May contain unused imports in some cases
// @ts-ignore
import type { AttestationLevelEnum } from './attestation-level-enum';
// May contain unused imports in some cases
// @ts-ignore
import type { CallbackMethodEnum } from './callback-method-enum';
Expand Down Expand Up @@ -93,6 +96,14 @@ export interface CreateCallResponse {
* The priority of this call over other calls from your account.
*/
'priority'?: number | null;
/**
* 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.
*/
'requestedAttestationLevel'?: AttestationLevelEnum | null;
/**
* The `identity` value provided in the Create Call request, if any.
*/
'identity'?: string | null;
}


Expand Down
11 changes: 11 additions & 0 deletions models/create-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/


// May contain unused imports in some cases
// @ts-ignore
import type { AttestationLevelEnum } from './attestation-level-enum';
// May contain unused imports in some cases
// @ts-ignore
import type { CallbackMethodEnum } from './callback-method-enum';
Expand Down Expand Up @@ -41,6 +44,14 @@ export interface CreateCall {
* 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.
*/
'uui'?: string | null;
/**
* 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`.
*/
'requestedAttestationLevel'?: AttestationLevelEnum | null;
/**
* 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`.
*/
'identity'?: string | null;
/**
* The id of the application associated with the `from` number.
*/
Expand Down
1 change: 1 addition & 0 deletions models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './additional-denial-reason';
export * from './address';
export * from './answer-callback';
export * from './async-lookup-request';
export * from './attestation-level-enum';
export * from './blocked-webhook';
export * from './bridge-complete-callback';
export * from './bridge-target-complete-callback';
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/api/calls-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CallsApi } from '../../../api';
import { Configuration } from '../../../configuration';
import { BW_ACCOUNT_ID, BW_NUMBER, USER_NUMBER, BW_VOICE_APPLICATION_ID, BASE_CALLBACK_URL } from '../constants';
import {
AttestationLevelEnum,
CallbackMethodEnum,
CallDirectionEnum,
CallStateEnum,
Expand All @@ -26,6 +27,7 @@ describe('CallsApi', () => {
const disconnectUrl = `${BASE_CALLBACK_URL}/callbacks/disconnect`;
const callTimeout = 30.0;
const callbackTimeout = 15.0;
const identity = 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken"';

describe('createCall', () => {
test('should create a call', async () => {
Expand All @@ -52,7 +54,9 @@ describe('CallsApi', () => {
disconnectMethod: disconnectMethod,
machineDetection: amdConfig,
callTimeout: callTimeout,
callbackTimeout: callbackTimeout
callbackTimeout: callbackTimeout,
requestedAttestationLevel: AttestationLevelEnum.B,
identity: identity
};

const { status, data } = await callsApi.createCall(BW_ACCOUNT_ID, callBody);
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/models/attestation-level-enum.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AttestationLevelEnum } from '../../../models/attestation-level-enum';

describe('AttestationLevelEnum', () => {
test('should define the expected values', () => {
expect(AttestationLevelEnum.A).toBe('A');
expect(AttestationLevelEnum.B).toBe('B');
expect(AttestationLevelEnum.C).toBe('C');
expect(Object.values(AttestationLevelEnum)).toEqual([
'A',
'B',
'C'
]);
});
});
5 changes: 5 additions & 0 deletions tests/unit/models/create-call-response.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CreateCallResponse } from '../../../models/create-call-response';
import { AttestationLevelEnum } from '../../../models/attestation-level-enum';
import { CallbackMethodEnum } from '../../../models/callback-method-enum';

describe('CreateCallResponse', () => {
Expand All @@ -25,6 +26,8 @@ describe('CreateCallResponse', () => {
fallbackUsername: 'test-fallbackUsername',
fallbackPassword: 'test-fallbackPassword',
priority: 1.5,
requestedAttestationLevel: AttestationLevelEnum.A,
identity: 'test-identity',
};

expect(fixture.applicationId).toBe('test-applicationId');
Expand All @@ -48,5 +51,7 @@ describe('CreateCallResponse', () => {
expect(fixture.fallbackUsername).toBe('test-fallbackUsername');
expect(fixture.fallbackPassword).toBe('test-fallbackPassword');
expect(fixture.priority).toBe(1.5);
expect(fixture.requestedAttestationLevel).toBe(AttestationLevelEnum.A);
expect(fixture.identity).toBe('test-identity');
});
});
5 changes: 5 additions & 0 deletions tests/unit/models/create-call.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CreateCall } from '../../../models/create-call';
import { AttestationLevelEnum } from '../../../models/attestation-level-enum';
import { CallbackMethodEnum } from '../../../models/callback-method-enum';
import { MachineDetectionConfiguration } from '../../../models/machine-detection-configuration';

Expand All @@ -10,6 +11,8 @@ describe('CreateCall', () => {
privacy: true,
displayName: 'test-displayName',
uui: 'test-uui',
requestedAttestationLevel: AttestationLevelEnum.A,
identity: 'test-identity',
applicationId: 'test-applicationId',
answerUrl: 'test-answerUrl',
answerMethod: CallbackMethodEnum.Get,
Expand All @@ -33,6 +36,8 @@ describe('CreateCall', () => {
expect(fixture.privacy).toBe(true);
expect(fixture.displayName).toBe('test-displayName');
expect(fixture.uui).toBe('test-uui');
expect(fixture.requestedAttestationLevel).toBe(AttestationLevelEnum.A);
expect(fixture.identity).toBe('test-identity');
expect(fixture.applicationId).toBe('test-applicationId');
expect(fixture.answerUrl).toBe('test-answerUrl');
expect(fixture.answerMethod).toBe(CallbackMethodEnum.Get);
Expand Down