diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0047818..7fd34a1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -24,6 +24,10 @@ docs/AsyncLookupRequest.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md +docs/BrtcError.md +docs/BrtcErrorResponse.md +docs/BrtcErrorSource.md +docs/BrtcLink.md docs/BusinessEntityTypeEnum.md docs/BusinessRegistrationTypeEnum.md docs/CallDirectionEnum.md @@ -80,9 +84,7 @@ docs/EndpointStatusEnum.md docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md -docs/Error.md docs/ErrorObject.md -docs/ErrorResponse.md docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md @@ -220,6 +222,7 @@ docs/VoiceApiError.md docs/VoiceCodeResponse.md docs/WebhookSubscription.md docs/WebhookSubscriptionBasicAuthentication.md +docs/WebhookSubscriptionError.md docs/WebhookSubscriptionRequestSchema.md docs/WebhookSubscriptionTypeEnum.md docs/WebhookSubscriptionsListBody.md @@ -233,6 +236,10 @@ models/async-lookup-request.ts models/blocked-webhook.ts models/bridge-complete-callback.ts models/bridge-target-complete-callback.ts +models/brtc-error-response.ts +models/brtc-error-source.ts +models/brtc-error.ts +models/brtc-link.ts models/business-entity-type-enum.ts models/business-registration-type-enum.ts models/call-direction-enum.ts @@ -287,7 +294,6 @@ models/endpoint-type-enum.ts models/endpoint.ts models/endpoints.ts models/error-object.ts -models/error-response.ts models/error-source.ts models/failure-webhook.ts models/field-error.ts @@ -331,7 +337,6 @@ models/mfa-request-error.ts models/mfa-unauthorized-request-error.ts models/mms-message-content-file.ts models/mms-message-content.ts -models/model-error.ts models/multi-channel-action-calendar-event.ts models/multi-channel-action.ts models/multi-channel-channel-list-mmsobject.ts @@ -417,6 +422,7 @@ models/verify-code-response.ts models/voice-api-error.ts models/voice-code-response.ts models/webhook-subscription-basic-authentication.ts +models/webhook-subscription-error.ts models/webhook-subscription-request-schema.ts models/webhook-subscription-type-enum.ts models/webhook-subscription.ts diff --git a/README.md b/README.md index a0a7a66..4eb50e1 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,10 @@ Class | Method | HTTP request | Description - [BlockedWebhook](docs/BlockedWebhook.md) - [BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) + - [BrtcError](docs/BrtcError.md) + - [BrtcErrorResponse](docs/BrtcErrorResponse.md) + - [BrtcErrorSource](docs/BrtcErrorSource.md) + - [BrtcLink](docs/BrtcLink.md) - [BusinessEntityTypeEnum](docs/BusinessEntityTypeEnum.md) - [BusinessRegistrationTypeEnum](docs/BusinessRegistrationTypeEnum.md) - [CallDirectionEnum](docs/CallDirectionEnum.md) @@ -227,7 +231,6 @@ Class | Method | HTTP request | Description - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - [ErrorObject](docs/ErrorObject.md) - - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) @@ -270,7 +273,6 @@ Class | Method | HTTP request | Description - [MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) - [MmsMessageContent](docs/MmsMessageContent.md) - [MmsMessageContentFile](docs/MmsMessageContentFile.md) - - [ModelError](docs/ModelError.md) - [MultiChannelAction](docs/MultiChannelAction.md) - [MultiChannelActionCalendarEvent](docs/MultiChannelActionCalendarEvent.md) - [MultiChannelChannelListMMSObject](docs/MultiChannelChannelListMMSObject.md) @@ -357,6 +359,7 @@ Class | Method | HTTP request | Description - [VoiceCodeResponse](docs/VoiceCodeResponse.md) - [WebhookSubscription](docs/WebhookSubscription.md) - [WebhookSubscriptionBasicAuthentication](docs/WebhookSubscriptionBasicAuthentication.md) + - [WebhookSubscriptionError](docs/WebhookSubscriptionError.md) - [WebhookSubscriptionRequestSchema](docs/WebhookSubscriptionRequestSchema.md) - [WebhookSubscriptionTypeEnum](docs/WebhookSubscriptionTypeEnum.md) - [WebhookSubscriptionsListBody](docs/WebhookSubscriptionsListBody.md) diff --git a/api/endpoints-api.ts b/api/endpoints-api.ts index 2891576..2b27714 100644 --- a/api/endpoints-api.ts +++ b/api/endpoints-api.ts @@ -22,6 +22,8 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore +import type { BrtcErrorResponse } from '../models'; +// @ts-ignore import type { CreateEndpointResponse } from '../models'; // @ts-ignore import type { CreateWebRtcConnectionRequest } from '../models'; @@ -32,8 +34,6 @@ import type { EndpointStatusEnum } from '../models'; // @ts-ignore import type { EndpointTypeEnum } from '../models'; // @ts-ignore -import type { ErrorResponse } from '../models'; -// @ts-ignore import type { ListEndpointsResponse } from '../models'; /** * EndpointsApi - axios parameter creator diff --git a/bandwidth.yml b/bandwidth.yml index 4378c20..6ad54bc 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2571,7 +2571,7 @@ components: Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If - application is not set or the device doesn’t support WebView, this + application is not set or the device doesn't support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. @@ -3455,8 +3455,8 @@ components: May be cleared by setting `tag=""` - Max length 256 characters. - maxLength: 256 + Max length 4096 characters. + maxLength: 4096 example: arbitrary text here createCallResponse: type: object @@ -3833,11 +3833,11 @@ components: May be cleared by setting `tag=""`. - Max length 256 characters. + Max length 4096 characters. Not allowed if `state` is `completed`. - maxLength: 256 + maxLength: 4096 example: My Custom Tag updateCallRecording: type: object @@ -6635,7 +6635,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/webhookSubscriptionError' data: items: $ref: '#/components/schemas/webhookSubscription' @@ -6661,7 +6661,7 @@ components: If more results exist than specified by 'size', this link return the last page of result. type: string - error: + webhookSubscriptionError: type: object properties: code: @@ -7060,6 +7060,22 @@ components: required: - eventType - eventTime + brtcLink: + type: object + properties: + href: + type: string + description: The full URL of the link. + example: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: + type: string + description: The relationship of the link to the current resource. + example: self + method: + type: string + description: The HTTP method to use when making the request. + example: GET page: type: object properties: @@ -7085,13 +7101,59 @@ components: example: 0 required: - pageSize + brtcError: + type: object + properties: + id: + type: string + format: uuid + description: A unique identifier for the error. + example: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: + type: string + description: The type of error. + example: resource.not_found + description: + type: string + description: A description of the error. + example: The requested resource was not found. + code: + type: string + description: A code that uniquely identifies the error. + example: '404' + source: + $ref: '#/components/schemas/brtcErrorSource' + required: + - type + - description + brtcErrorSource: + type: object + properties: + parameter: + type: string + description: The URI parameter that caused the error. + example: accountId + field: + type: string + description: The request body field that caused the error. + example: accountId + header: + type: string + description: The header that caused the error. + example: Authorization + reference: + type: string + description: >- + The resource ID or path to the resource (or non-existent resource) + causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 listEndpointsResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/brtcLink' page: $ref: '#/components/schemas/page' data: @@ -7101,7 +7163,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7112,13 +7174,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7129,24 +7191,24 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/brtcError' required: - links - data - errors - errorResponse: + brtcErrorResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/brtcLink' data: type: object nullable: true @@ -7154,7 +7216,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7865,7 +7927,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: badRequestErrorExample: $ref: '#/components/examples/badRequestErrorExample' @@ -7874,7 +7936,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unauthorizedErrorExample: $ref: '#/components/examples/unauthorizedErrorExample' @@ -7883,7 +7945,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: forbiddenErrorExample: $ref: '#/components/examples/forbiddenErrorExample' @@ -7892,7 +7954,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: notFoundErrorExample: $ref: '#/components/examples/notFoundErrorExample' @@ -7901,7 +7963,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: methodNotAllowedErrorExample: $ref: '#/components/examples/methodNotAllowedErrorExample' @@ -7910,16 +7972,25 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unsuppotedMediaTypeErrorExample: $ref: '#/components/examples/unsupportedMediaTypeErrorExample' tooManyRequestsErrorResponse: description: Too Many Requests + headers: + Retry-After: + description: >- + The number of seconds the client should wait before making another + request. + required: true + schema: + type: integer + example: 900 content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: tooManyRequestsErrorExample: $ref: '#/components/examples/tooManyRequestsErrorExample' @@ -7928,7 +7999,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: serviceUnavailableErrorExample: $ref: '#/components/examples/serviceUnavailableErrorExample' @@ -9137,10 +9208,10 @@ components: links: [] data: null errors: - - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - type: too_many_requests - description: The client has sent too many requests in a given amount of time. - code: '429' + - type: too_many_endpoints + description: >- + Too many endpoints. Please delete an existing endpoint or wait 24 + hours for an endpoint to be removed. serviceUnavailableErrorExample: summary: Service Unavailable Error Example value: diff --git a/custom_templates/modelAllOf.mustache b/custom_templates/modelAllOf.mustache new file mode 100644 index 0000000..76e4beb --- /dev/null +++ b/custom_templates/modelAllOf.mustache @@ -0,0 +1,14 @@ +/** + * @type {{classname}}{{#description}} + * {{{.}}}{{/description}} + */ +export interface {{classname}} { +{{#vars}} +{{#description}} + /** + * {{{.}}} + */ +{{/description}} + '{{name}}'{{^required}}?{{/required}}: {{{dataType}}}; +{{/vars}} +} diff --git a/docs/BrtcError.md b/docs/BrtcError.md new file mode 100644 index 0000000..7dd09f5 --- /dev/null +++ b/docs/BrtcError.md @@ -0,0 +1,28 @@ +# BrtcError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | A unique identifier for the error. | [optional] [default to undefined] +**type** | **string** | The type of error. | [default to undefined] +**description** | **string** | A description of the error. | [default to undefined] +**code** | **string** | A code that uniquely identifies the error. | [optional] [default to undefined] +**source** | [**BrtcErrorSource**](BrtcErrorSource.md) | | [optional] [default to undefined] + +## Example + +```typescript +import { BrtcError } from 'bandwidth-sdk'; + +const instance: BrtcError = { + id, + type, + description, + code, + source, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorResponse.md b/docs/BrtcErrorResponse.md similarity index 58% rename from docs/ErrorResponse.md rename to docs/BrtcErrorResponse.md index b4c56be..3749482 100644 --- a/docs/ErrorResponse.md +++ b/docs/BrtcErrorResponse.md @@ -1,20 +1,20 @@ -# ErrorResponse +# BrtcErrorResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**Array<Link>**](Link.md) | | [default to undefined] +**links** | [**Array<BrtcLink>**](BrtcLink.md) | | [default to undefined] **data** | **object** | | [default to undefined] -**errors** | [**Array<ModelError>**](ModelError.md) | | [default to undefined] +**errors** | [**Array<BrtcError>**](BrtcError.md) | | [default to undefined] ## Example ```typescript -import { ErrorResponse } from 'bandwidth-sdk'; +import { BrtcErrorResponse } from 'bandwidth-sdk'; -const instance: ErrorResponse = { +const instance: BrtcErrorResponse = { links, data, errors, diff --git a/docs/BrtcErrorSource.md b/docs/BrtcErrorSource.md new file mode 100644 index 0000000..20dcaa8 --- /dev/null +++ b/docs/BrtcErrorSource.md @@ -0,0 +1,26 @@ +# BrtcErrorSource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parameter** | **string** | The URI parameter that caused the error. | [optional] [default to undefined] +**field** | **string** | The request body field that caused the error. | [optional] [default to undefined] +**header** | **string** | The header that caused the error. | [optional] [default to undefined] +**reference** | **string** | The resource ID or path to the resource (or non-existent resource) causing the error. | [optional] [default to undefined] + +## Example + +```typescript +import { BrtcErrorSource } from 'bandwidth-sdk'; + +const instance: BrtcErrorSource = { + parameter, + field, + header, + reference, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BrtcLink.md b/docs/BrtcLink.md new file mode 100644 index 0000000..93b4ae1 --- /dev/null +++ b/docs/BrtcLink.md @@ -0,0 +1,24 @@ +# BrtcLink + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **string** | The full URL of the link. | [optional] [default to undefined] +**rel** | **string** | The relationship of the link to the current resource. | [optional] [default to undefined] +**method** | **string** | The HTTP method to use when making the request. | [optional] [default to undefined] + +## Example + +```typescript +import { BrtcLink } from 'bandwidth-sdk'; + +const instance: BrtcLink = { + href, + rel, + method, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCall.md b/docs/CreateCall.md index c0fe3fd..c18ba9a 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -25,7 +25,7 @@ Name | Type | Description | Notes **callbackTimeout** | **number** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional] [default to 15] **machineDetection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] [default to undefined] **priority** | **number** | The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. | [optional] [default to 5] -**tag** | **string** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href=\'/docs/voice/bxml/tag\'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] [default to undefined] +**tag** | **string** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href=\'/docs/voice/bxml/tag\'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters. | [optional] [default to undefined] ## Example diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index 5737b6e..f801171 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**Array<Link>**](Link.md) | | [default to undefined] +**links** | [**Array<BrtcLink>**](BrtcLink.md) | | [default to undefined] **data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | [default to undefined] -**errors** | [**Array<ModelError>**](ModelError.md) | | [default to undefined] +**errors** | [**Array<BrtcError>**](BrtcError.md) | | [default to undefined] ## Example diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index 4086be9..064a896 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**Array<Link>**](Link.md) | | [default to undefined] +**links** | [**Array<BrtcLink>**](BrtcLink.md) | | [default to undefined] **data** | [**Endpoint**](Endpoint.md) | | [default to undefined] -**errors** | [**Array<ModelError>**](ModelError.md) | | [default to undefined] +**errors** | [**Array<BrtcError>**](BrtcError.md) | | [default to undefined] ## Example diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md index baa4304..e8ec89b 100644 --- a/docs/EndpointsApi.md +++ b/docs/EndpointsApi.md @@ -67,7 +67,7 @@ const { status, data } = await apiInstance.createEndpoint( |**404** | Not Found | - | |**405** | Method Not Allowed | - | |**415** | Unsupported Media Type | - | -|**429** | Too Many Requests | - | +|**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| |**500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -129,7 +129,7 @@ void (empty response body) |**404** | Not Found | - | |**405** | Method Not Allowed | - | |**415** | Unsupported Media Type | - | -|**429** | Too Many Requests | - | +|**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| |**500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -191,7 +191,7 @@ const { status, data } = await apiInstance.getEndpoint( |**404** | Not Found | - | |**405** | Method Not Allowed | - | |**415** | Unsupported Media Type | - | -|**429** | Too Many Requests | - | +|**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| |**500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -262,7 +262,7 @@ const { status, data } = await apiInstance.listEndpoints( |**404** | Not Found | - | |**405** | Method Not Allowed | - | |**415** | Unsupported Media Type | - | -|**429** | Too Many Requests | - | +|**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| |**500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -327,7 +327,7 @@ void (empty response body) |**404** | Not Found | - | |**405** | Method Not Allowed | - | |**415** | Unsupported Media Type | - | -|**429** | Too Many Requests | - | +|**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| |**500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index 9d3b63f..3e37152 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**Array<Link>**](Link.md) | | [default to undefined] +**links** | [**Array<BrtcLink>**](BrtcLink.md) | | [default to undefined] **page** | [**Page**](Page.md) | | [optional] [default to undefined] **data** | [**Array<Endpoints>**](Endpoints.md) | | [default to undefined] -**errors** | [**Array<ModelError>**](ModelError.md) | | [default to undefined] +**errors** | [**Array<BrtcError>**](BrtcError.md) | | [default to undefined] ## Example diff --git a/docs/LookupResult.md b/docs/LookupResult.md index 4174d49..89b6265 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **deactivationDate** | **string** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] [default to undefined] **deactivationEvent** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] [default to undefined] **latestMessageDeliveryStatus** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] [default to undefined] -**initialMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] [default to undefined] +**initialMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] [default to undefined] **latestMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] [default to undefined] **rcsEnabled** | **boolean** | [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. | [optional] [default to undefined] diff --git a/docs/RbmOpenUrlEnum.md b/docs/RbmOpenUrlEnum.md index 3d603fd..0f8ca14 100644 --- a/docs/RbmOpenUrlEnum.md +++ b/docs/RbmOpenUrlEnum.md @@ -1,6 +1,6 @@ # RbmOpenUrlEnum -Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. +Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn\'t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. ## Enum diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md index d016dd9..1d30279 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **redirectFallbackMethod** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to undefined] **fallbackUsername** | **string** | Basic auth username. | [optional] [default to undefined] **fallbackPassword** | **string** | Basic auth password. | [optional] [default to undefined] -**tag** | **string** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] [default to undefined] +**tag** | **string** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`. | [optional] [default to undefined] ## Example diff --git a/docs/Error.md b/docs/WebhookSubscriptionError.md similarity index 82% rename from docs/Error.md rename to docs/WebhookSubscriptionError.md index 3514538..4b30919 100644 --- a/docs/Error.md +++ b/docs/WebhookSubscriptionError.md @@ -1,4 +1,4 @@ -# ModelError +# WebhookSubscriptionError ## Properties @@ -12,9 +12,9 @@ Name | Type | Description | Notes ## Example ```typescript -import { ModelError } from 'bandwidth-sdk'; +import { WebhookSubscriptionError } from 'bandwidth-sdk'; -const instance: ModelError = { +const instance: WebhookSubscriptionError = { code, description, telephoneNumbers, diff --git a/docs/WebhookSubscriptionsListBody.md b/docs/WebhookSubscriptionsListBody.md index 8485b50..ce0e6de 100644 --- a/docs/WebhookSubscriptionsListBody.md +++ b/docs/WebhookSubscriptionsListBody.md @@ -7,7 +7,7 @@ A list of all webhook subscriptions registered for this account ID for this part Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **links** | [**LinksObject**](LinksObject.md) | | [optional] [default to undefined] -**errors** | [**Array<ModelError>**](ModelError.md) | | [optional] [default to undefined] +**errors** | [**Array<WebhookSubscriptionError>**](WebhookSubscriptionError.md) | | [optional] [default to undefined] **data** | [**Array<WebhookSubscription>**](WebhookSubscription.md) | | [default to undefined] ## Example diff --git a/models/error-response.ts b/models/brtc-error-response.ts similarity index 72% rename from models/error-response.ts rename to models/brtc-error-response.ts index f59da8f..9cb97bc 100644 --- a/models/error-response.ts +++ b/models/brtc-error-response.ts @@ -15,14 +15,14 @@ // May contain unused imports in some cases // @ts-ignore -import type { Link } from './link'; +import type { BrtcError } from './brtc-error'; // May contain unused imports in some cases // @ts-ignore -import type { ModelError } from './model-error'; +import type { BrtcLink } from './brtc-link'; -export interface ErrorResponse { - 'links': Array; +export interface BrtcErrorResponse { + 'links': Array; 'data': object | null; - 'errors': Array; + 'errors': Array; } diff --git a/models/brtc-error-source.ts b/models/brtc-error-source.ts new file mode 100644 index 0000000..aaccfa3 --- /dev/null +++ b/models/brtc-error-source.ts @@ -0,0 +1,35 @@ +/* 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. + */ + + + +export interface BrtcErrorSource { + /** + * The URI parameter that caused the error. + */ + 'parameter'?: string; + /** + * The request body field that caused the error. + */ + 'field'?: string; + /** + * The header that caused the error. + */ + 'header'?: string; + /** + * The resource ID or path to the resource (or non-existent resource) causing the error. + */ + 'reference'?: string; +} + diff --git a/models/brtc-error.ts b/models/brtc-error.ts new file mode 100644 index 0000000..01ab53f --- /dev/null +++ b/models/brtc-error.ts @@ -0,0 +1,39 @@ +/* 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. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { BrtcErrorSource } from './brtc-error-source'; + +export interface BrtcError { + /** + * A unique identifier for the error. + */ + 'id'?: string; + /** + * The type of error. + */ + 'type': string; + /** + * A description of the error. + */ + 'description': string; + /** + * A code that uniquely identifies the error. + */ + 'code'?: string; + 'source'?: BrtcErrorSource; +} + diff --git a/models/brtc-link.ts b/models/brtc-link.ts new file mode 100644 index 0000000..ef62862 --- /dev/null +++ b/models/brtc-link.ts @@ -0,0 +1,31 @@ +/* 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. + */ + + + +export interface BrtcLink { + /** + * The full URL of the link. + */ + 'href'?: string; + /** + * The relationship of the link to the current resource. + */ + 'rel'?: string; + /** + * The HTTP method to use when making the request. + */ + 'method'?: string; +} + diff --git a/models/create-call.ts b/models/create-call.ts index 853a29a..184c4f1 100644 --- a/models/create-call.ts +++ b/models/create-call.ts @@ -90,7 +90,7 @@ export interface CreateCall { */ 'priority'?: number | null; /** - * A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. + * A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters. */ 'tag'?: string | null; } diff --git a/models/create-endpoint-response-data.ts b/models/create-endpoint-response-data.ts index 5fd1f3d..835dd26 100644 --- a/models/create-endpoint-response-data.ts +++ b/models/create-endpoint-response-data.ts @@ -29,9 +29,30 @@ import type { EndpointTypeEnum } from './endpoint-type-enum'; /** * @type CreateEndpointResponseData */ -export interface CreateEndpointResponseData extends Endpoint { +export interface CreateEndpointResponseData { + /** + * The unique ID of the endpoint. + */ + 'endpointId': string; + 'type': EndpointTypeEnum; + 'status': EndpointStatusEnum; + /** + * The time the endpoint was created. In ISO-8601 format. + */ + 'creationTimestamp': string; + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + */ + 'expirationTimestamp': string; + /** + * A tag for the endpoint. + */ + 'tag'?: string; + 'devices'?: Array; /** * The json web token specific to the endpoint. Used to authenticate the client with the media gateway. */ 'token': string; } + + diff --git a/models/create-endpoint-response.ts b/models/create-endpoint-response.ts index c00f714..3a07bac 100644 --- a/models/create-endpoint-response.ts +++ b/models/create-endpoint-response.ts @@ -15,17 +15,17 @@ // May contain unused imports in some cases // @ts-ignore -import type { CreateEndpointResponseData } from './create-endpoint-response-data'; +import type { BrtcError } from './brtc-error'; // May contain unused imports in some cases // @ts-ignore -import type { Link } from './link'; +import type { BrtcLink } from './brtc-link'; // May contain unused imports in some cases // @ts-ignore -import type { ModelError } from './model-error'; +import type { CreateEndpointResponseData } from './create-endpoint-response-data'; export interface CreateEndpointResponse { - 'links': Array; + 'links': Array; 'data': CreateEndpointResponseData; - 'errors': Array; + 'errors': Array; } diff --git a/models/create-web-rtc-connection-request.ts b/models/create-web-rtc-connection-request.ts index d907ec3..9fcd57d 100644 --- a/models/create-web-rtc-connection-request.ts +++ b/models/create-web-rtc-connection-request.ts @@ -26,6 +26,22 @@ import type { EndpointTypeEnum } from './endpoint-type-enum'; /** * @type CreateWebRtcConnectionRequest */ -export type CreateWebRtcConnectionRequest = CreateEndpointRequestBase; +export interface CreateWebRtcConnectionRequest { + 'type': EndpointTypeEnum; + 'direction': EndpointDirectionEnum; + /** + * The URL to send event callbacks to. + */ + 'eventCallbackUrl'?: string; + /** + * The URL to send event fallbacks to. + */ + 'eventFallbackUrl'?: string; + /** + * A tag for the endpoint. + */ + 'tag'?: string; + 'connectionMetadata'?: object; +} diff --git a/models/endpoint-event.ts b/models/endpoint-event.ts index f1667d2..ce05cc6 100644 --- a/models/endpoint-event.ts +++ b/models/endpoint-event.ts @@ -33,6 +33,31 @@ import type { Endpoints } from './endpoints'; * @type EndpointEvent * An event that occurred on an endpoint. */ -export type EndpointEvent = Endpoints; +export interface EndpointEvent { + /** + * The unique ID of the endpoint. + */ + 'endpointId': string; + 'type': EndpointTypeEnum; + 'status': EndpointStatusEnum; + /** + * The time the endpoint was created. In ISO-8601 format. + */ + 'creationTimestamp': string; + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + */ + 'expirationTimestamp': string; + /** + * A tag for the endpoint. + */ + 'tag'?: string; + /** + * The time the event occurred. In ISO-8601 format. + */ + 'eventTime': string; + 'eventType': EndpointEventTypeEnum; + 'device'?: Device; +} diff --git a/models/endpoint-response.ts b/models/endpoint-response.ts index c8e5e76..37013eb 100644 --- a/models/endpoint-response.ts +++ b/models/endpoint-response.ts @@ -15,17 +15,17 @@ // May contain unused imports in some cases // @ts-ignore -import type { Endpoint } from './endpoint'; +import type { BrtcError } from './brtc-error'; // May contain unused imports in some cases // @ts-ignore -import type { Link } from './link'; +import type { BrtcLink } from './brtc-link'; // May contain unused imports in some cases // @ts-ignore -import type { ModelError } from './model-error'; +import type { Endpoint } from './endpoint'; export interface EndpointResponse { - 'links': Array; + 'links': Array; 'data': Endpoint; - 'errors': Array; + 'errors': Array; } diff --git a/models/endpoint.ts b/models/endpoint.ts index e23a9aa..dd0ef90 100644 --- a/models/endpoint.ts +++ b/models/endpoint.ts @@ -29,6 +29,26 @@ import type { Endpoints } from './endpoints'; /** * @type Endpoint */ -export interface Endpoint extends Endpoints { +export interface Endpoint { + /** + * The unique ID of the endpoint. + */ + 'endpointId': string; + 'type': EndpointTypeEnum; + 'status': EndpointStatusEnum; + /** + * The time the endpoint was created. In ISO-8601 format. + */ + 'creationTimestamp': string; + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + */ + 'expirationTimestamp': string; + /** + * A tag for the endpoint. + */ + 'tag'?: string; 'devices'?: Array; } + + diff --git a/models/inbound-callback-message.ts b/models/inbound-callback-message.ts index 28e609a..b56b57b 100644 --- a/models/inbound-callback-message.ts +++ b/models/inbound-callback-message.ts @@ -38,6 +38,47 @@ import type { StatusCallbackMessage } from './status-callback-message'; /** * @type InboundCallbackMessage */ -export type InboundCallbackMessage = StatusCallbackMessage; +export interface InboundCallbackMessage { + /** + * A unique identifier of the message. + */ + 'id': string; + /** + * The Bandwidth phone number or alphanumeric identifier associated with the message. + */ + 'owner': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'time': string; + /** + * The number of segments the user\'s message is broken into before sending over carrier networks. + */ + 'segmentCount': number; + 'direction': MessageDirectionEnum; + /** + * The phone number recipients of the message. + */ + 'to': Set; + /** + * The Bandwidth phone number or alphanumeric identifier the message was sent from. + */ + 'from': string; + 'text'?: string; + /** + * A custom string that will be included in callback events of the message. Max 1024 characters. + */ + 'tag'?: string; + /** + * Optional media, not applicable for sms + */ + 'media'?: Array; + 'priority'?: PriorityEnum; + 'channel'?: MultiChannelMessageChannelEnum; + 'content'?: MultiChannelMessageContent; + 'suggestionResponse'?: RbmSuggestionResponse; + 'locationResponse'?: RbmLocationResponse; +} diff --git a/models/index.ts b/models/index.ts index ed01abf..bb6e465 100644 --- a/models/index.ts +++ b/models/index.ts @@ -6,6 +6,10 @@ export * from './async-lookup-request'; export * from './blocked-webhook'; export * from './bridge-complete-callback'; export * from './bridge-target-complete-callback'; +export * from './brtc-error'; +export * from './brtc-error-response'; +export * from './brtc-error-source'; +export * from './brtc-link'; export * from './business-entity-type-enum'; export * from './business-registration-type-enum'; export * from './call-direction-enum'; @@ -60,7 +64,6 @@ export * from './endpoint-status-enum'; export * from './endpoint-type-enum'; export * from './endpoints'; export * from './error-object'; -export * from './error-response'; export * from './error-source'; export * from './failure-webhook'; export * from './field-error'; @@ -103,7 +106,6 @@ export * from './mfa-request-error'; export * from './mfa-unauthorized-request-error'; export * from './mms-message-content'; export * from './mms-message-content-file'; -export * from './model-error'; export * from './multi-channel-action'; export * from './multi-channel-action-calendar-event'; export * from './multi-channel-channel-list-mmsobject'; @@ -190,6 +192,7 @@ export * from './voice-api-error'; export * from './voice-code-response'; export * from './webhook-subscription'; export * from './webhook-subscription-basic-authentication'; +export * from './webhook-subscription-error'; export * from './webhook-subscription-request-schema'; export * from './webhook-subscription-type-enum'; export * from './webhook-subscriptions-list-body'; diff --git a/models/list-endpoints-response.ts b/models/list-endpoints-response.ts index a8a1235..a9f7b42 100644 --- a/models/list-endpoints-response.ts +++ b/models/list-endpoints-response.ts @@ -15,21 +15,21 @@ // May contain unused imports in some cases // @ts-ignore -import type { Endpoints } from './endpoints'; +import type { BrtcError } from './brtc-error'; // May contain unused imports in some cases // @ts-ignore -import type { Link } from './link'; +import type { BrtcLink } from './brtc-link'; // May contain unused imports in some cases // @ts-ignore -import type { ModelError } from './model-error'; +import type { Endpoints } from './endpoints'; // May contain unused imports in some cases // @ts-ignore import type { Page } from './page'; export interface ListEndpointsResponse { - 'links': Array; + 'links': Array; 'page'?: Page; 'data': Array; - 'errors': Array; + 'errors': Array; } diff --git a/models/multi-channel-action-calendar-event.ts b/models/multi-channel-action-calendar-event.ts index 7fc8036..bd86f36 100644 --- a/models/multi-channel-action-calendar-event.ts +++ b/models/multi-channel-action-calendar-event.ts @@ -23,6 +23,32 @@ import type { RbmActionTypeEnum } from './rbm-action-type-enum'; /** * @type MultiChannelActionCalendarEvent */ -export type MultiChannelActionCalendarEvent = RbmActionBase; +export interface MultiChannelActionCalendarEvent { + 'type': RbmActionTypeEnum; + /** + * Displayed text for user to click + */ + 'text': string; + /** + * Base64 payload the customer receives when the reply is clicked. + */ + 'postbackData': string; + /** + * The title of the event. + */ + 'title': string; + /** + * The start time of the event. + */ + 'startTime': string; + /** + * The end time of the event. + */ + 'endTime': string; + /** + * The description of the event. + */ + 'description'?: string; +} diff --git a/models/multi-channel-channel-list-mmsobject.ts b/models/multi-channel-channel-list-mmsobject.ts index 3b0ffeb..7703a6e 100644 --- a/models/multi-channel-channel-list-mmsobject.ts +++ b/models/multi-channel-channel-list-mmsobject.ts @@ -26,6 +26,17 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha /** * @type MultiChannelChannelListMMSObject */ -export type MultiChannelChannelListMMSObject = MultiChannelChannelListObjectBase; +export interface MultiChannelChannelListMMSObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': MmsMessageContent; +} diff --git a/models/multi-channel-channel-list-mmsresponse-object.ts b/models/multi-channel-channel-list-mmsresponse-object.ts index 95b451e..e2d85b9 100644 --- a/models/multi-channel-channel-list-mmsresponse-object.ts +++ b/models/multi-channel-channel-list-mmsresponse-object.ts @@ -29,6 +29,21 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha /** * @type MultiChannelChannelListMMSResponseObject */ -export type MultiChannelChannelListMMSResponseObject = MultiChannelChannelListMMSObject & MultiChannelChannelListOwnerObject; +export interface MultiChannelChannelListMMSResponseObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': MmsMessageContent; + /** + * The Bandwidth senderId associated with the message. Identical to \'from\'. + */ + 'owner': string; +} diff --git a/models/multi-channel-channel-list-rbmobject.ts b/models/multi-channel-channel-list-rbmobject.ts index fb00b51..8f121ec 100644 --- a/models/multi-channel-channel-list-rbmobject.ts +++ b/models/multi-channel-channel-list-rbmobject.ts @@ -26,6 +26,17 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha /** * @type MultiChannelChannelListRBMObject */ -export type MultiChannelChannelListRBMObject = MultiChannelChannelListObjectBase; +export interface MultiChannelChannelListRBMObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': MultiChannelChannelListRBMObjectAllOfContent; +} diff --git a/models/multi-channel-channel-list-rbmresponse-object.ts b/models/multi-channel-channel-list-rbmresponse-object.ts index f3c4e77..1147ca9 100644 --- a/models/multi-channel-channel-list-rbmresponse-object.ts +++ b/models/multi-channel-channel-list-rbmresponse-object.ts @@ -29,6 +29,21 @@ import type { MultiChannelMessageChannelEnum } from './multi-channel-message-cha /** * @type MultiChannelChannelListRBMResponseObject */ -export type MultiChannelChannelListRBMResponseObject = MultiChannelChannelListOwnerObject & MultiChannelChannelListRBMObject; +export interface MultiChannelChannelListRBMResponseObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': MultiChannelChannelListRBMObjectAllOfContent; + /** + * The Bandwidth senderId associated with the message. Identical to \'from\'. + */ + 'owner': string; +} diff --git a/models/multi-channel-channel-list-smsobject.ts b/models/multi-channel-channel-list-smsobject.ts index b85d6a0..ebad627 100644 --- a/models/multi-channel-channel-list-smsobject.ts +++ b/models/multi-channel-channel-list-smsobject.ts @@ -26,6 +26,17 @@ import type { SmsMessageContent } from './sms-message-content'; /** * @type MultiChannelChannelListSMSObject */ -export type MultiChannelChannelListSMSObject = MultiChannelChannelListObjectBase; +export interface MultiChannelChannelListSMSObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': SmsMessageContent; +} diff --git a/models/multi-channel-channel-list-smsresponse-object.ts b/models/multi-channel-channel-list-smsresponse-object.ts index 131d01b..1cf47b3 100644 --- a/models/multi-channel-channel-list-smsresponse-object.ts +++ b/models/multi-channel-channel-list-smsresponse-object.ts @@ -29,6 +29,21 @@ import type { SmsMessageContent } from './sms-message-content'; /** * @type MultiChannelChannelListSMSResponseObject */ -export type MultiChannelChannelListSMSResponseObject = MultiChannelChannelListOwnerObject & MultiChannelChannelListSMSObject; +export interface MultiChannelChannelListSMSResponseObject { + /** + * The sender ID of the message. This could be an alphanumeric sender ID. + */ + 'from': string; + /** + * The ID of the Application your from number or senderId is associated with in the Bandwidth App. + */ + 'applicationId': string; + 'channel': MultiChannelMessageChannelEnum; + 'content': SmsMessageContent; + /** + * The Bandwidth senderId associated with the message. Identical to \'from\'. + */ + 'owner': string; +} diff --git a/models/rbm-action-dial.ts b/models/rbm-action-dial.ts index 95df4d0..d292a21 100644 --- a/models/rbm-action-dial.ts +++ b/models/rbm-action-dial.ts @@ -23,6 +23,20 @@ import type { RbmActionTypeEnum } from './rbm-action-type-enum'; /** * @type RbmActionDial */ -export type RbmActionDial = RbmActionBase; +export interface RbmActionDial { + 'type': RbmActionTypeEnum; + /** + * Displayed text for user to click + */ + 'text': string; + /** + * Base64 payload the customer receives when the reply is clicked. + */ + 'postbackData': string; + /** + * The phone number to dial. Must be E164 format. + */ + 'phoneNumber': string; +} diff --git a/models/rbm-action-open-url.ts b/models/rbm-action-open-url.ts index 26eb979..6fb3f3b 100644 --- a/models/rbm-action-open-url.ts +++ b/models/rbm-action-open-url.ts @@ -29,6 +29,22 @@ import type { RbmWebViewEnum } from './rbm-web-view-enum'; /** * @type RbmActionOpenUrl */ -export type RbmActionOpenUrl = RbmActionBase; +export interface RbmActionOpenUrl { + 'type': RbmActionTypeEnum; + /** + * Displayed text for user to click + */ + 'text': string; + /** + * Base64 payload the customer receives when the reply is clicked. + */ + 'postbackData': string; + /** + * The URL to open in browser. + */ + 'url': string; + 'application'?: RbmOpenUrlEnum; + 'webviewViewMode'?: RbmWebViewEnum; +} diff --git a/models/rbm-action-view-location.ts b/models/rbm-action-view-location.ts index d507e56..9e0510e 100644 --- a/models/rbm-action-view-location.ts +++ b/models/rbm-action-view-location.ts @@ -23,6 +23,28 @@ import type { RbmActionTypeEnum } from './rbm-action-type-enum'; /** * @type RbmActionViewLocation */ -export type RbmActionViewLocation = RbmActionBase; +export interface RbmActionViewLocation { + 'type': RbmActionTypeEnum; + /** + * Displayed text for user to click + */ + 'text': string; + /** + * Base64 payload the customer receives when the reply is clicked. + */ + 'postbackData': string; + /** + * The latitude of the location. + */ + 'latitude': number; + /** + * The longitude of the location. + */ + 'longitude': number; + /** + * The label of the location. + */ + 'label'?: string; +} diff --git a/models/rbm-card-content-media.ts b/models/rbm-card-content-media.ts index e8ea2cb..c4a0b6d 100644 --- a/models/rbm-card-content-media.ts +++ b/models/rbm-card-content-media.ts @@ -23,6 +23,16 @@ import type { RbmMessageContentFile } from './rbm-message-content-file'; /** * @type RbmCardContentMedia */ -export type RbmCardContentMedia = RbmMessageContentFile; +export interface RbmCardContentMedia { + /** + * The URL of the media file. 100MB is the maximum file size. + */ + 'fileUrl': string; + /** + * The URL of the thumbnail image. Applies only to video file media. + */ + 'thumbnailUrl'?: string; + 'height': RbmMediaHeightEnum; +} diff --git a/models/rbm-open-url-enum.ts b/models/rbm-open-url-enum.ts index d4e75a6..3f1e003 100644 --- a/models/rbm-open-url-enum.ts +++ b/models/rbm-open-url-enum.ts @@ -15,7 +15,7 @@ /** - * Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. + * Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device\'s default browser. If application is not set or the device doesn\'t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. */ export const RbmOpenUrlEnum = { diff --git a/models/update-call.ts b/models/update-call.ts index f374513..95ad6f2 100644 --- a/models/update-call.ts +++ b/models/update-call.ts @@ -49,7 +49,7 @@ export interface UpdateCall { */ 'fallbackPassword'?: string | null; /** - * A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. + * A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`. */ 'tag'?: string | null; } diff --git a/models/model-error.ts b/models/webhook-subscription-error.ts similarity index 92% rename from models/model-error.ts rename to models/webhook-subscription-error.ts index 8fe991b..57dac6a 100644 --- a/models/model-error.ts +++ b/models/webhook-subscription-error.ts @@ -17,7 +17,7 @@ // @ts-ignore import type { TelephoneNumber } from './telephone-number'; -export interface ModelError { +export interface WebhookSubscriptionError { 'code'?: number; 'description'?: string; 'telephoneNumbers'?: Array; diff --git a/models/webhook-subscriptions-list-body.ts b/models/webhook-subscriptions-list-body.ts index c54ce43..6f18db2 100644 --- a/models/webhook-subscriptions-list-body.ts +++ b/models/webhook-subscriptions-list-body.ts @@ -18,17 +18,17 @@ import type { LinksObject } from './links-object'; // May contain unused imports in some cases // @ts-ignore -import type { ModelError } from './model-error'; +import type { WebhookSubscription } from './webhook-subscription'; // May contain unused imports in some cases // @ts-ignore -import type { WebhookSubscription } from './webhook-subscription'; +import type { WebhookSubscriptionError } from './webhook-subscription-error'; /** * A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated). */ export interface WebhookSubscriptionsListBody { 'links'?: LinksObject; - 'errors'?: Array; + 'errors'?: Array; 'data': Array; } diff --git a/tests/unit/models/brtc-error-response.test.ts b/tests/unit/models/brtc-error-response.test.ts new file mode 100644 index 0000000..98cb52b --- /dev/null +++ b/tests/unit/models/brtc-error-response.test.ts @@ -0,0 +1,50 @@ +import { BrtcErrorResponse } from '../../../models/brtc-error-response'; +import { BrtcLink } from '../../../models/brtc-link'; +import { BrtcError } from '../../../models/brtc-error'; +import { BrtcErrorSource } from '../../../models/brtc-error-source'; + +describe('BrtcErrorResponse', () => { + test('should support full error response shape', () => { + const source: BrtcErrorSource = { + parameter: 'endpointId', + field: 'id', + header: 'Authorization', + reference: '/endpoints/ep-123' + }; + + const link: BrtcLink = { + href: 'http://api.example.com/endpoints', + rel: 'self', + method: 'GET' + }; + + const error: BrtcError = { + id: 'err-001', + type: 'not-found', + description: 'Endpoint not found', + code: '404', + source + }; + + const response: BrtcErrorResponse = { + links: [link], + data: null, + errors: [error] + }; + + expect(response.links).toHaveLength(1); + expect(response.links[0].href).toBe('http://api.example.com/endpoints'); + expect(response.links[0].rel).toBe('self'); + expect(response.links[0].method).toBe('GET'); + expect(response.data).toBeNull(); + expect(response.errors).toHaveLength(1); + expect(response.errors[0].id).toBe('err-001'); + expect(response.errors[0].type).toBe('not-found'); + expect(response.errors[0].description).toBe('Endpoint not found'); + expect(response.errors[0].code).toBe('404'); + expect(response.errors[0].source?.parameter).toBe('endpointId'); + expect(response.errors[0].source?.field).toBe('id'); + expect(response.errors[0].source?.header).toBe('Authorization'); + expect(response.errors[0].source?.reference).toBe('/endpoints/ep-123'); + }); +}); diff --git a/tests/unit/models/brtc-error-source.test.ts b/tests/unit/models/brtc-error-source.test.ts new file mode 100644 index 0000000..e43b345 --- /dev/null +++ b/tests/unit/models/brtc-error-source.test.ts @@ -0,0 +1,17 @@ +import { BrtcErrorSource } from '../../../models/brtc-error-source'; + +describe('BrtcErrorSource', () => { + test('should support full BrtcErrorSource shape', () => { + const source: BrtcErrorSource = { + parameter: 'endpointId', + field: 'id', + header: 'Authorization', + reference: '/endpoints/ep-123' + }; + + expect(source.parameter).toBe('endpointId'); + expect(source.field).toBe('id'); + expect(source.header).toBe('Authorization'); + expect(source.reference).toBe('/endpoints/ep-123'); + }); +}); diff --git a/tests/unit/models/brtc-error.test.ts b/tests/unit/models/brtc-error.test.ts new file mode 100644 index 0000000..a1513e7 --- /dev/null +++ b/tests/unit/models/brtc-error.test.ts @@ -0,0 +1,30 @@ +import { BrtcError } from '../../../models/brtc-error'; +import { BrtcErrorSource } from '../../../models/brtc-error-source'; + +describe('BrtcError', () => { + test('should support full BrtcError shape', () => { + const source: BrtcErrorSource = { + parameter: 'endpointId', + field: 'id', + header: 'Authorization', + reference: '/endpoints/ep-123' + }; + + const error: BrtcError = { + id: 'err-001', + type: 'not-found', + description: 'Endpoint not found', + code: '404', + source + }; + + expect(error.id).toBe('err-001'); + expect(error.type).toBe('not-found'); + expect(error.description).toBe('Endpoint not found'); + expect(error.code).toBe('404'); + expect(error.source?.parameter).toBe('endpointId'); + expect(error.source?.field).toBe('id'); + expect(error.source?.header).toBe('Authorization'); + expect(error.source?.reference).toBe('/endpoints/ep-123'); + }); +}); diff --git a/tests/unit/models/brtc-link.test.ts b/tests/unit/models/brtc-link.test.ts new file mode 100644 index 0000000..d7f36a0 --- /dev/null +++ b/tests/unit/models/brtc-link.test.ts @@ -0,0 +1,15 @@ +import { BrtcLink } from '../../../models/brtc-link'; + +describe('BrtcLink', () => { + test('should support full BrtcLink shape', () => { + const link: BrtcLink = { + href: 'http://api.example.com/endpoints', + rel: 'self', + method: 'GET' + }; + + expect(link.href).toBe('http://api.example.com/endpoints'); + expect(link.rel).toBe('self'); + expect(link.method).toBe('GET'); + }); +}); diff --git a/tests/unit/models/create-endpoint-response.test.ts b/tests/unit/models/create-endpoint-response.test.ts index ed7058c..2ccfdd6 100644 --- a/tests/unit/models/create-endpoint-response.test.ts +++ b/tests/unit/models/create-endpoint-response.test.ts @@ -4,14 +4,16 @@ import { Device } from '../../../models/device'; import { DeviceStatusEnum } from '../../../models/device-status-enum'; import { EndpointStatusEnum } from '../../../models/endpoint-status-enum'; import { EndpointTypeEnum } from '../../../models/endpoint-type-enum'; -import { Link } from '../../../models/link'; -import { ModelError } from '../../../models/model-error'; +import { BrtcLink } from '../../../models/brtc-link'; +import { BrtcError } from '../../../models/brtc-error'; +import { BrtcErrorSource } from '../../../models/brtc-error-source'; describe('CreateEndpointResponse', () => { test('should create an endpoint response with all fields', () => { - const link: Link = { + const link: BrtcLink = { + href: 'http://api.example.com/endpoints/ep-123456', rel: 'self', - href: 'http://api.example.com/endpoints/ep-123456' + method: 'POST' }; const devices: Device[] = [ @@ -34,9 +36,19 @@ describe('CreateEndpointResponse', () => { devices }; - const error: ModelError = { - code: 400, - description: 'Missing required field: endpointId' + const source: BrtcErrorSource = { + parameter: 'endpointId', + field: 'id', + header: 'Authorization', + reference: '/endpoints' + }; + + const error: BrtcError = { + id: 'err-400', + type: 'validation-error', + description: 'Missing required field: endpointId', + code: '400', + source }; const response: CreateEndpointResponse = { @@ -46,8 +58,9 @@ describe('CreateEndpointResponse', () => { }; expect(response.links).toHaveLength(1); - expect(response.links[0].rel).toBe('self'); expect(response.links[0].href).toBe('http://api.example.com/endpoints/ep-123456'); + expect(response.links[0].rel).toBe('self'); + expect(response.links[0].method).toBe('POST'); expect(response.data.endpointId).toBe('ep-123456'); expect(response.data.type).toBe('WEBRTC'); expect(response.data.status).toBe('CONNECTED'); @@ -61,7 +74,13 @@ describe('CreateEndpointResponse', () => { expect(response.data.devices![0].status).toBe(DeviceStatusEnum.Connected); expect(response.data.devices![0].creationTimestamp).toBe('2024-02-18T10:31:00Z'); expect(response.errors).toHaveLength(1); - expect(response.errors[0].code).toBe(400); + expect(response.errors[0].id).toBe('err-400'); + expect(response.errors[0].type).toBe('validation-error'); expect(response.errors[0].description).toContain('endpointId'); + expect(response.errors[0].code).toBe('400'); + expect(response.errors[0].source?.parameter).toBe('endpointId'); + expect(response.errors[0].source?.field).toBe('id'); + expect(response.errors[0].source?.header).toBe('Authorization'); + expect(response.errors[0].source?.reference).toBe('/endpoints'); }); }); diff --git a/tests/unit/models/endpoint-event.test.ts b/tests/unit/models/endpoint-event.test.ts index 5eab3a6..220e25b 100644 --- a/tests/unit/models/endpoint-event.test.ts +++ b/tests/unit/models/endpoint-event.test.ts @@ -1,16 +1,29 @@ import { EndpointEvent } from '../../../models/endpoint-event'; +import { EndpointEventTypeEnum } from '../../../models/endpoint-event-type-enum'; import { EndpointStatusEnum } from '../../../models/endpoint-status-enum'; import { EndpointTypeEnum } from '../../../models/endpoint-type-enum'; +import { Device } from '../../../models/device'; +import { DeviceStatusEnum } from '../../../models/device-status-enum'; describe('EndpointEvent', () => { test('should create an endpoint event with all fields', () => { + const device: Device = { + deviceId: 'dev-1', + deviceName: 'Chrome Browser', + status: DeviceStatusEnum.Connected, + creationTimestamp: '2024-02-18T10:31:00Z' + }; + const event: EndpointEvent = { endpointId: 'ep-123456', type: EndpointTypeEnum.Webrtc, status: EndpointStatusEnum.Connected, creationTimestamp: '2024-02-18T10:30:00Z', expirationTimestamp: '2024-02-19T10:30:00Z', - tag: 'test-event' + tag: 'test-event', + eventTime: '2024-02-18T10:35:00Z', + eventType: EndpointEventTypeEnum.DeviceConnected, + device }; expect(event.endpointId).toBe('ep-123456'); @@ -21,5 +34,11 @@ describe('EndpointEvent', () => { expect(new Date(event.expirationTimestamp).getFullYear()).toBe(2024); expect(new Date(event.expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); expect(event.tag).toBe('test-event'); + expect(new Date(event.eventTime).toISOString()).toBe('2024-02-18T10:35:00.000Z'); + expect(event.eventType).toBe(EndpointEventTypeEnum.DeviceConnected); + expect(event.device?.deviceId).toBe('dev-1'); + expect(event.device?.deviceName).toBe('Chrome Browser'); + expect(event.device?.status).toBe(DeviceStatusEnum.Connected); + expect(event.device?.creationTimestamp).toBe('2024-02-18T10:31:00Z'); }); }); diff --git a/tests/unit/models/endpoint-response.test.ts b/tests/unit/models/endpoint-response.test.ts index 7a145ea..6219079 100644 --- a/tests/unit/models/endpoint-response.test.ts +++ b/tests/unit/models/endpoint-response.test.ts @@ -4,14 +4,16 @@ import { Device } from '../../../models/device'; import { DeviceStatusEnum } from '../../../models/device-status-enum'; import { EndpointStatusEnum } from '../../../models/endpoint-status-enum'; import { EndpointTypeEnum } from '../../../models/endpoint-type-enum'; -import { Link } from '../../../models/link'; -import { ModelError } from '../../../models/model-error'; +import { BrtcLink } from '../../../models/brtc-link'; +import { BrtcError } from '../../../models/brtc-error'; +import { BrtcErrorSource } from '../../../models/brtc-error-source'; describe('EndpointResponse', () => { test('should create an endpoint response with all fields', () => { - const link: Link = { + const link: BrtcLink = { + href: 'http://api.example.com/endpoints/ep-123456', rel: 'self', - href: 'http://api.example.com/endpoints/ep-123456' + method: 'GET' }; const devices: Device[] = [ @@ -33,9 +35,19 @@ describe('EndpointResponse', () => { devices }; - const error: ModelError = { - code: 400, - description: 'Invalid endpoint configuration' + const source: BrtcErrorSource = { + parameter: 'endpointId', + field: 'id', + header: 'Authorization', + reference: '/endpoints/ep-123456' + }; + + const error: BrtcError = { + id: 'err-400', + type: 'validation-error', + description: 'Invalid endpoint configuration', + code: '400', + source }; const response: EndpointResponse = { @@ -45,8 +57,9 @@ describe('EndpointResponse', () => { }; expect(response.links).toHaveLength(1); - expect(response.links[0].rel).toBe('self'); expect(response.links[0].href).toBe('http://api.example.com/endpoints/ep-123456'); + expect(response.links[0].rel).toBe('self'); + expect(response.links[0].method).toBe('GET'); expect(response.data.endpointId).toBe('ep-123456'); expect(response.data.type).toBe(EndpointTypeEnum.Webrtc); expect(response.data.status).toBe(EndpointStatusEnum.Connected); @@ -59,7 +72,13 @@ describe('EndpointResponse', () => { expect(response.data.devices![0].status).toBe(DeviceStatusEnum.Connected); expect(response.data.devices![0].creationTimestamp).toBe('2024-02-18T10:31:00Z'); expect(response.errors).toHaveLength(1); - expect(response.errors[0].code).toBe(400); + expect(response.errors[0].id).toBe('err-400'); + expect(response.errors[0].type).toBe('validation-error'); expect(response.errors[0].description).toBe('Invalid endpoint configuration'); + expect(response.errors[0].code).toBe('400'); + expect(response.errors[0].source?.parameter).toBe('endpointId'); + expect(response.errors[0].source?.field).toBe('id'); + expect(response.errors[0].source?.header).toBe('Authorization'); + expect(response.errors[0].source?.reference).toBe('/endpoints/ep-123456'); }); }); diff --git a/tests/unit/models/error-response.test.ts b/tests/unit/models/error-response.test.ts deleted file mode 100644 index e0f370b..0000000 --- a/tests/unit/models/error-response.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ErrorResponse } from '../../../models/error-response'; -import { Link } from '../../../models/link'; -import { ModelError } from '../../../models/model-error'; - -describe('ErrorResponse', () => { - test('should support full error response shape', () => { - const link: Link = { - rel: 'self', - href: 'http://api.example.com/endpoints' - }; - - const error: ModelError = { - code: 404, - description: 'Endpoint not found' - }; - - const response: ErrorResponse = { - links: [link], - data: null, - errors: [error] - }; - - expect(response.links).toHaveLength(1); - expect(response.links[0].rel).toBe('self'); - expect(response.links[0].href).toBe('http://api.example.com/endpoints'); - expect(response.data).toBeNull(); - expect(response.errors).toHaveLength(1); - expect(response.errors[0].code).toBe(404); - expect(response.errors[0].description).toBe('Endpoint not found'); - }); -}); diff --git a/tests/unit/models/list-endpoints-response.test.ts b/tests/unit/models/list-endpoints-response.test.ts index 37a749c..7373694 100644 --- a/tests/unit/models/list-endpoints-response.test.ts +++ b/tests/unit/models/list-endpoints-response.test.ts @@ -2,15 +2,17 @@ import { ListEndpointsResponse } from '../../../models/list-endpoints-response'; import { Endpoints } from '../../../models/endpoints'; import { EndpointStatusEnum } from '../../../models/endpoint-status-enum'; import { EndpointTypeEnum } from '../../../models/endpoint-type-enum'; -import { Link } from '../../../models/link'; +import { BrtcLink } from '../../../models/brtc-link'; +import { BrtcError } from '../../../models/brtc-error'; +import { BrtcErrorSource } from '../../../models/brtc-error-source'; import { Page } from '../../../models/page'; -import { ModelError } from '../../../models/model-error'; describe('ListEndpointsResponse', () => { test('should create a list endpoints response with all fields', () => { - const link: Link = { + const link: BrtcLink = { + href: 'http://api.example.com/endpoints?page=1', rel: 'self', - href: 'http://api.example.com/endpoints?page=1' + method: 'GET' }; const page: Page = { @@ -38,9 +40,19 @@ describe('ListEndpointsResponse', () => { } ]; - const error: ModelError = { - code: 500, - description: 'Internal server error' + const source: BrtcErrorSource = { + parameter: 'page', + field: 'pageNumber', + header: 'Authorization', + reference: '/endpoints' + }; + + const error: BrtcError = { + id: 'err-500', + type: 'internal-error', + description: 'Internal server error', + code: '500', + source }; const response: ListEndpointsResponse = { @@ -51,8 +63,9 @@ describe('ListEndpointsResponse', () => { }; expect(response.links).toHaveLength(1); - expect(response.links[0].rel).toBe('self'); expect(response.links[0].href).toBe('http://api.example.com/endpoints?page=1'); + expect(response.links[0].rel).toBe('self'); + expect(response.links[0].method).toBe('GET'); expect(response.page).toBeDefined(); expect(response.page?.pageSize).toBe(10); expect(response.page?.pageNumber).toBe(1); @@ -69,7 +82,13 @@ describe('ListEndpointsResponse', () => { expect(new Date(response.data[1].expirationTimestamp).getFullYear()).toBe(2024); expect(new Date(response.data[1].expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); expect(response.errors).toHaveLength(1); - expect(response.errors[0].code).toBe(500); + expect(response.errors[0].id).toBe('err-500'); + expect(response.errors[0].type).toBe('internal-error'); expect(response.errors[0].description).toBe('Internal server error'); + expect(response.errors[0].code).toBe('500'); + expect(response.errors[0].source?.parameter).toBe('page'); + expect(response.errors[0].source?.field).toBe('pageNumber'); + expect(response.errors[0].source?.header).toBe('Authorization'); + expect(response.errors[0].source?.reference).toBe('/endpoints'); }); });