From 732f97e856c92262c31487fbcaf4d26ea3e3c351 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 21 Apr 2026 14:40:12 +0000 Subject: [PATCH 1/4] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 6 + README.md | 3 + api/openapi.yaml | 436 +++++++++++++----- bandwidth.yml | 129 ++++-- docs/Callback.md | 4 +- docs/CreateCall.md | 4 +- docs/CreateEndpointResponse.md | 4 +- docs/EndpointResponse.md | 4 +- docs/EndpointsApi.md | 10 +- docs/Error1.md | 17 + docs/Error1Source.md | 16 + docs/ErrorResponse.md | 4 +- docs/InboundCallback.md | 4 +- docs/Link1.md | 25 + docs/ListEndpointsResponse.md | 4 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/StatusCallback.md | 2 +- docs/UpdateCall.md | 2 +- src/main/java/com/bandwidth/sdk/JSON.java | 3 + .../com/bandwidth/sdk/api/EndpointsApi.java | 40 +- .../com/bandwidth/sdk/model/CreateCall.java | 4 +- .../sdk/model/CreateEndpointResponse.java | 28 +- .../bandwidth/sdk/model/EndpointResponse.java | 28 +- .../java/com/bandwidth/sdk/model/Error1.java | 414 +++++++++++++++++ .../com/bandwidth/sdk/model/Error1Source.java | 375 +++++++++++++++ .../bandwidth/sdk/model/ErrorResponse.java | 28 +- .../bandwidth/sdk/model/InboundCallback.java | 4 +- .../sdk/model/InboundCallbackTypeEnum.java | 2 +- .../java/com/bandwidth/sdk/model/Link1.java | 404 ++++++++++++++++ .../sdk/model/ListEndpointsResponse.java | 28 +- .../com/bandwidth/sdk/model/LookupResult.java | 2 +- .../model/MachineDetectionConfiguration.java | 2 +- .../bandwidth/sdk/model/MessageRequest.java | 2 +- .../bandwidth/sdk/model/RbmOpenUrlEnum.java | 2 +- .../bandwidth/sdk/model/RbmWebViewEnum.java | 2 +- .../bandwidth/sdk/model/StatusCallback.java | 2 +- .../com/bandwidth/sdk/model/UpdateCall.java | 2 +- 38 files changed, 1785 insertions(+), 265 deletions(-) create mode 100644 docs/Error1.md create mode 100644 docs/Error1Source.md create mode 100644 docs/Link1.md create mode 100644 src/main/java/com/bandwidth/sdk/model/Error1.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Error1Source.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Link1.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8a6ae885..c73957e8 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -68,6 +68,8 @@ docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md docs/Error.md +docs/Error1.md +docs/Error1Source.md docs/ErrorObject.md docs/ErrorResponse.md docs/ErrorSource.md @@ -85,6 +87,7 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md +docs/Link1.md docs/LinkSchema.md docs/LinksObject.md docs/ListEndpointsResponse.md @@ -315,6 +318,8 @@ src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java src/main/java/com/bandwidth/sdk/model/Endpoints.java src/main/java/com/bandwidth/sdk/model/Error.java +src/main/java/com/bandwidth/sdk/model/Error1.java +src/main/java/com/bandwidth/sdk/model/Error1Source.java src/main/java/com/bandwidth/sdk/model/ErrorObject.java src/main/java/com/bandwidth/sdk/model/ErrorResponse.java src/main/java/com/bandwidth/sdk/model/ErrorSource.java @@ -332,6 +337,7 @@ src/main/java/com/bandwidth/sdk/model/InitiateCallback.java src/main/java/com/bandwidth/sdk/model/LatestMessageDeliveryStatusEnum.java src/main/java/com/bandwidth/sdk/model/LineTypeEnum.java src/main/java/com/bandwidth/sdk/model/Link.java +src/main/java/com/bandwidth/sdk/model/Link1.java src/main/java/com/bandwidth/sdk/model/LinkSchema.java src/main/java/com/bandwidth/sdk/model/LinksObject.java src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java diff --git a/README.md b/README.md index 34bf15dc..a3022bd5 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,8 @@ Class | Method | HTTP request | Description - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - [Error](docs/Error.md) + - [Error1](docs/Error1.md) + - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) @@ -267,6 +269,7 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) + - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) - [ListEndpointsResponse](docs/ListEndpointsResponse.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 62525cc2..8e7e134d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5963,6 +5963,16 @@ paths: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple "500": content: application/json: @@ -6071,6 +6081,16 @@ paths: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple "500": content: application/json: @@ -6182,6 +6202,16 @@ paths: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple "500": content: application/json: @@ -6294,6 +6324,16 @@ paths: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple "500": content: application/json: @@ -6405,6 +6445,16 @@ paths: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple "500": content: application/json: @@ -6441,13 +6491,15 @@ components: $ref: "#/components/examples/mmsMessageReceivedCallbackExample" schema: $ref: "#/components/schemas/inboundCallback" - description: |- -

This Inbound Message Webhook is an envelope containing either a received (MO) message to your - message-enabled Bandwidth telephone number or a multichannel client's response to a suggestion response - or location request. -

The payload type will be one of message-received, suggestion-response, or location-request-response. -

Note that suggestion-response and location-request-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. -

Please visit Webhooks

+ description: "

This Inbound Message Webhook is an envelope containing\ + \ either a received (MO) message to your \nmessage-enabled Bandwidth\ + \ telephone number or a multichannel client's response to a suggestion\ + \ response \nor location request. \n

The payload type will be one\ + \ of message-received, suggestion-response,\ + \ or location-request-response.\n

Note that suggestion-response\ + \ and location-request-response callback types are pertinent\ + \ only for RBM messages sent from the /messages/multiChannel\ + \ endpoint.\n

Please visit Webhooks

" required: true responses: "200": @@ -7249,11 +7301,9 @@ 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: @@ -9034,6 +9084,16 @@ components: schema: $ref: "#/components/schemas/errorResponse" description: Too Many Requests + headers: + Retry-After: + description: The number of seconds the client should wait before making + another request. + explode: false + required: true + schema: + example: 900 + type: integer + style: simple serviceUnavailableErrorResponse: content: application/json: @@ -9428,10 +9488,9 @@ components: format: date-time type: string carrierName: - description: |- - The name of the Authorized Message Provider (AMP) that handled this message. - In the US, this is the carrier that the message was sent to. - This field is present only when this account feature has been enabled. + description: "The name of the Authorized Message Provider (AMP) that handled\ + \ this message. \nIn the US, this is the carrier that the message was sent\ + \ to.\nThis field is present only when this account feature has been enabled." example: AT&T type: string message: @@ -9538,9 +9597,13 @@ components: type: array uniqueItems: true from: - description: |- - Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. - Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + description: "Either an alphanumeric sender ID or the sender's Bandwidth\ + \ phone number in E.164 format, which must be hosted within Bandwidth\ + \ and linked to the account that is generating the message. \nAlphanumeric\ + \ Sender IDs can contain up to 11 characters, upper-case letters A-Z,\ + \ lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore\ + \ _ and ampersand &. Alphanumeric Sender IDs must contain at least one\ + \ letter." example: "+15551113333" type: string text: @@ -9770,9 +9833,6 @@ components: type: array type: object link: - example: - rel: rel - href: href properties: rel: type: string @@ -10072,21 +10132,20 @@ components: example: REPLY type: string rbmOpenUrlEnum: - description: |- - 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. + description: "Specifies how the URL should be opened on a mobile device.\n-\ + \ `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. \n- `WEBVIEW` Opens the URL in an in-app WebView." enum: - BROWSER - WEBVIEW example: WEBVIEW type: string rbmWebViewEnum: - description: |- - Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. - - `HALF` WebView takes half of the screen. - - `TALL` WebView takes three-quarters of the screen. + description: "Defines the layout of the WebView on a mobile device. It must\ + \ be defined when application is set to `WEBVIEW`\n- `FULL` WebView takes\ + \ the full screen. \n- `HALF` WebView takes half of the screen.\n- `TALL`\ + \ WebView takes three-quarters of the screen." enum: - FULL - HALF @@ -10650,10 +10709,10 @@ components: example: 4405 type: integer carrierName: - description: |- - The name of the Authorized Message Provider (AMP) that handled this message. - In the US, this is the carrier that the message was sent to. - This field is present only when this account feature has been enabled. + description: "The name of the Authorized Message Provider (AMP) that handled\ + \ this message. \nIn the US, this is the carrier that the message was\ + \ sent to.\nThis field is present only when this account feature has been\ + \ enabled." example: AT&T type: string required: @@ -10673,9 +10732,9 @@ components: type: $ref: "#/components/schemas/inboundCallbackTypeEnum" to: - description: | - The destination phone number the message was sent to. - For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. + description: "The destination phone number the message was sent to. \nFor\ + \ inbound callbacks, this is the Bandwidth number or alphanumeric identifier\ + \ that received the message.\n" example: "+15552223333" type: string description: @@ -10685,10 +10744,10 @@ components: message: $ref: "#/components/schemas/inboundCallbackMessage" carrierName: - description: |- - The name of the Authorized Message Provider (AMP) that handled this message. - In the US, this is the carrier that the message was sent to. - This field is present only when this account feature has been enabled. + description: "The name of the Authorized Message Provider (AMP) that handled\ + \ this message. \nIn the US, this is the carrier that the message was\ + \ sent to.\nThis field is present only when this account feature has been\ + \ enabled." example: AT&T type: string required: @@ -10713,11 +10772,13 @@ components: example: message-delivered type: string inboundCallbackTypeEnum: - description: |- - The possible inbound callback types originating from MO messages or multichannel message client responses: - - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + description: "The possible inbound callback types originating from MO messages\ + \ or multichannel message client responses:\n- `message-received` indicates\ + \ an MO message from a Bandwidth user's client to a Bandwidth number.\n- `request-location-response`\ + \ indicates a response to a location request sent by the Bandwidth user's\ + \ client after receiving an RBM message. \n- `suggestion-response` indicates\ + \ a response to a suggestion sent by the Bandwidth user's client after receiving\ + \ an RBM message." enum: - message-received - request-location-response @@ -10935,10 +10996,10 @@ components: nullable: true type: boolean displayName: - description: |- - 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`. + description: "The caller display name to use when the call is created. \n\ + May not exceed 256 characters nor contain control characters such as new\ + \ lines.\nIf `privacy` is true, only the following values are valid: `Restricted`,\ + \ `Anonymous`, `Private`, or `Unavailable`." example: John Doe maxLength: 256 nullable: true @@ -11067,9 +11128,9 @@ components: May be cleared by setting `tag=""` - Max length 256 characters. + Max length 4096 characters. example: arbitrary text here - maxLength: 256 + maxLength: 4096 nullable: true type: string required: @@ -11430,11 +11491,11 @@ components: May be cleared by setting `tag=""`. - Max length 256 characters. + Max length 4096 characters. Not allowed if `state` is `completed`. example: My Custom Tag - maxLength: 256 + maxLength: 4096 nullable: true type: string type: object @@ -11903,9 +11964,9 @@ components: nullable: true type: number machineSpeechEndThreshold: - description: |- - When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. - If not provided it will default to the speechEndThreshold value. + description: "When an answering machine is detected, the amount of silence\ + \ (in seconds) before assuming the message has finished playing. \nIf\ + \ not provided it will default to the speechEndThreshold value." example: 5 format: double nullable: true @@ -14703,10 +14764,10 @@ components: latestMessageDeliveryStatus: $ref: "#/components/schemas/latestMessageDeliveryStatusEnum" initialMessageDeliveryStatusDate: - description: |- - [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. + description: "[DNI-Only](#section/DNI-Only). The date the phone number entered\ + \ the status described in `latestMessageDeliveryStatus`. \nThink of this\ + \ as the \"start time\" for that status.\nValue resets every time the\ + \ `latestMessageDeliveryStatus` changes." example: 2025-06-20 format: date type: string @@ -16326,6 +16387,29 @@ components: - eventType type: object description: An event that occurred on an endpoint. + link1: + example: + method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + properties: + href: + description: The full URL of the link. + example: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + rel: + description: The relationship of the link to the current resource. + example: self + type: string + method: + description: The HTTP method to use when making the request. + enum: + - GET + - POST + - DELETE + example: GET + type: string + type: object page: example: pageNumber: 0 @@ -16356,6 +16440,41 @@ components: required: - pageSize type: object + error1: + example: + code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + id: + description: A unique identifier for the error. + example: 59512d87-7a92-4040-8e4a-78fb772019b9 + format: uuid + type: string + type: + description: The type of error. + example: resource.not_found + type: string + description: + description: A description of the error. + example: The requested resource was not found. + type: string + code: + description: A code that uniquely identifies the error. + example: "404" + type: string + source: + $ref: "#/components/schemas/error1_source" + required: + - description + - type + type: object listEndpointsResponse: example: data: @@ -16372,30 +16491,40 @@ components: type: WEBRTC status: CONNECTED links: - - rel: rel - href: href - - rel: rel - href: href + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 page: pageNumber: 0 totalPages: 10 pageSize: 10 totalElements: 100 errors: - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found properties: links: items: - $ref: "#/components/schemas/link" + $ref: "#/components/schemas/link1" type: array page: $ref: "#/components/schemas/page" @@ -16405,7 +16534,7 @@ components: type: array errors: items: - $ref: "#/components/schemas/error" + $ref: "#/components/schemas/error1" type: array required: - data @@ -16431,31 +16560,41 @@ components: type: WEBRTC status: CONNECTED links: - - rel: rel - href: href - - rel: rel - href: href + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 errors: - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found properties: links: items: - $ref: "#/components/schemas/link" + $ref: "#/components/schemas/link1" type: array data: $ref: "#/components/schemas/endpoint" errors: items: - $ref: "#/components/schemas/error" + $ref: "#/components/schemas/error1" type: array required: - data @@ -16482,31 +16621,41 @@ components: status: CONNECTED token: xxxxx.yyyyy.zzzzz links: - - rel: rel - href: href - - rel: rel - href: href + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 errors: - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found properties: links: items: - $ref: "#/components/schemas/link" + $ref: "#/components/schemas/link1" type: array data: $ref: "#/components/schemas/createEndpointResponseData" errors: items: - $ref: "#/components/schemas/error" + $ref: "#/components/schemas/error1" type: array required: - data @@ -16517,25 +16666,35 @@ components: example: data: "{}" links: - - rel: rel - href: href - - rel: rel - href: href + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 errors: - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description - - code: 0 - telephoneNumbers: - - telephoneNumber: telephoneNumber - - telephoneNumber: telephoneNumber - description: description + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found properties: links: items: - $ref: "#/components/schemas/link" + $ref: "#/components/schemas/link1" type: array data: additionalProperties: false @@ -16543,7 +16702,7 @@ components: type: object errors: items: - $ref: "#/components/schemas/error" + $ref: "#/components/schemas/error1" type: array required: - data @@ -16711,6 +16870,31 @@ components: - password - username type: object + error1_source: + example: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + properties: + parameter: + description: The URI parameter that caused the error. + example: accountId + type: string + field: + description: The request body field that caused the error. + example: accountId + type: string + header: + description: The header that caused the error. + example: Authorization + type: string + reference: + description: The resource ID or path to the resource (or non-existent resource) + causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + type: object securitySchemes: Basic: description: |- diff --git a/bandwidth.yml b/bandwidth.yml index 4378c202..c7105f39 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2161,7 +2161,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2248,7 +2248,7 @@ components: description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. + linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, @@ -2572,7 +2572,7 @@ components: - `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. + option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. enum: @@ -2585,7 +2585,7 @@ components: Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2987,7 +2987,7 @@ components: to: type: string description: > - The destination phone number the message was sent to. + The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. @@ -3038,7 +3038,7 @@ components: client to a Bandwidth number. - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. @@ -3277,7 +3277,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -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 @@ -4214,7 +4214,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5958,7 +5958,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -7060,6 +7060,26 @@ components: required: - eventType - eventTime + link1: + 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 + enum: + - GET + - POST + - DELETE + description: The HTTP method to use when making the request. + example: GET page: type: object properties: @@ -7085,13 +7105,57 @@ components: example: 0 required: - pageSize + error1: + 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: + 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 + required: + - type + - description listEndpointsResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' page: $ref: '#/components/schemas/page' data: @@ -7101,7 +7165,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7112,13 +7176,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7129,13 +7193,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7146,7 +7210,7 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: type: object nullable: true @@ -7154,7 +7218,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7916,6 +7980,15 @@ components: $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: @@ -9137,10 +9210,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: @@ -9556,12 +9629,12 @@ components: required: true description: >-

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your + received (MO) message to your message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response + client's response to a suggestion response - or location request. + or location request.

The payload type will be one of message-received, suggestion-response, or diff --git a/docs/Callback.md b/docs/Callback.md index 9d38bdd5..56428470 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -11,11 +11,11 @@ Callbacks are divided into two types based on direction of the related message: |**time** | **OffsetDateTime** | | | |**eventTime** | **OffsetDateTime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | |**errorCode** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 7937060a..3992fe94 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -10,7 +10,7 @@ |**to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | | |**from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | | |**privacy** | **Boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] | -|**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 `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | +|**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 `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | |**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] | |**applicationId** | **String** | The id of the application associated with the `from` number. | | |**answerUrl** | **URI** | 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`. | | @@ -27,7 +27,7 @@ |**callbackTimeout** | **Double** | 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] | |**machineDetection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] | |**priority** | **Integer** | 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] | -|**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] | +|**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] | diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index 3c481b31..218f50b8 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link>**](Link.md) | | | +|**links** | [**List<Link1>**](Link1.md) | | | |**data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | | -|**errors** | [**List<Error>**](Error.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index 2240efed..d5615e9c 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link>**](Link.md) | | | +|**links** | [**List<Link1>**](Link1.md) | | | |**data** | [**Endpoint**](Endpoint.md) | | | -|**errors** | [**List<Error>**](Error.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md index 41586cc2..81e89c9b 100644 --- a/docs/EndpointsApi.md +++ b/docs/EndpointsApi.md @@ -90,7 +90,7 @@ public class Example { | **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 | - | @@ -171,7 +171,7 @@ null (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 | - | @@ -253,7 +253,7 @@ public class Example { | **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 | - | @@ -341,7 +341,7 @@ public class Example { | **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 | - | @@ -424,6 +424,6 @@ null (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 | - | diff --git a/docs/Error1.md b/docs/Error1.md new file mode 100644 index 00000000..1835a088 --- /dev/null +++ b/docs/Error1.md @@ -0,0 +1,17 @@ + + +# Error1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | A unique identifier for the error. | [optional] | +|**type** | **String** | The type of error. | | +|**description** | **String** | A description of the error. | | +|**code** | **String** | A code that uniquely identifies the error. | [optional] | +|**source** | [**Error1Source**](Error1Source.md) | | [optional] | + + + diff --git a/docs/Error1Source.md b/docs/Error1Source.md new file mode 100644 index 00000000..4665f119 --- /dev/null +++ b/docs/Error1Source.md @@ -0,0 +1,16 @@ + + +# Error1Source + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**parameter** | **String** | The URI parameter that caused the error. | [optional] | +|**field** | **String** | The request body field that caused the error. | [optional] | +|**header** | **String** | The header that caused the error. | [optional] | +|**reference** | **String** | The resource ID or path to the resource (or non-existent resource) causing the error. | [optional] | + + + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index a5409868..fa7cb478 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link>**](Link.md) | | | +|**links** | [**List<Link1>**](Link1.md) | | | |**data** | **Object** | | | -|**errors** | [**List<Error>**](Error.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index 520e3f24..5a1993cb 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -10,10 +10,10 @@ Represents an inbound callback. |------------ | ------------- | ------------- | -------------| |**time** | **OffsetDateTime** | | | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/Link1.md b/docs/Link1.md new file mode 100644 index 00000000..e2023ab1 --- /dev/null +++ b/docs/Link1.md @@ -0,0 +1,25 @@ + + +# Link1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**href** | **String** | The full URL of the link. | [optional] | +|**rel** | **String** | The relationship of the link to the current resource. | [optional] | +|**method** | [**MethodEnum**](#MethodEnum) | The HTTP method to use when making the request. | [optional] | + + + +## Enum: MethodEnum + +| Name | Value | +|---- | -----| +| GET | "GET" | +| POST | "POST" | +| DELETE | "DELETE" | + + + diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index 2ab178bf..cefcc63e 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link>**](Link.md) | | | +|**links** | [**List<Link1>**](Link1.md) | | | |**page** | [**Page**](Page.md) | | [optional] | |**data** | [**List<Endpoints>**](Endpoints.md) | | | -|**errors** | [**List<Error>**](Error.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index f3aeba26..a3f6de4c 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -13,7 +13,7 @@ The machine detection request used to perform additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Error1 instance itself + */ + public Error1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error1 error1 = (Error1) o; + return Objects.equals(this.id, error1.id) && + Objects.equals(this.type, error1.type) && + Objects.equals(this.description, error1.description) && + Objects.equals(this.code, error1.code) && + Objects.equals(this.source, error1.source)&& + Objects.equals(this.additionalProperties, error1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, description, code, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "type", "description", "code", "source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "description")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1 is not found in the empty JSON string", Error1.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Error1.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + Error1Source.validateJsonElement(jsonObj.get("source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error1 + * @throws IOException if the JSON string is invalid with respect to Error1 + */ + public static Error1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error1.class); + } + + /** + * Convert an instance of Error1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Error1Source.java b/src/main/java/com/bandwidth/sdk/model/Error1Source.java new file mode 100644 index 00000000..d0bc96ac --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Error1Source.java @@ -0,0 +1,375 @@ +/* + * 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. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Error1Source + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Error1Source { + public static final String SERIALIZED_NAME_PARAMETER = "parameter"; + @SerializedName(SERIALIZED_NAME_PARAMETER) + @javax.annotation.Nullable + private String parameter; + + public static final String SERIALIZED_NAME_FIELD = "field"; + @SerializedName(SERIALIZED_NAME_FIELD) + @javax.annotation.Nullable + private String field; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + @javax.annotation.Nullable + private String header; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + @javax.annotation.Nullable + private String reference; + + public Error1Source() { + } + + public Error1Source parameter(@javax.annotation.Nullable String parameter) { + this.parameter = parameter; + return this; + } + + /** + * The URI parameter that caused the error. + * @return parameter + */ + @javax.annotation.Nullable + public String getParameter() { + return parameter; + } + + public void setParameter(@javax.annotation.Nullable String parameter) { + this.parameter = parameter; + } + + + public Error1Source field(@javax.annotation.Nullable String field) { + this.field = field; + return this; + } + + /** + * The request body field that caused the error. + * @return field + */ + @javax.annotation.Nullable + public String getField() { + return field; + } + + public void setField(@javax.annotation.Nullable String field) { + this.field = field; + } + + + public Error1Source header(@javax.annotation.Nullable String header) { + this.header = header; + return this; + } + + /** + * The header that caused the error. + * @return header + */ + @javax.annotation.Nullable + public String getHeader() { + return header; + } + + public void setHeader(@javax.annotation.Nullable String header) { + this.header = header; + } + + + public Error1Source reference(@javax.annotation.Nullable String reference) { + this.reference = reference; + return this; + } + + /** + * The resource ID or path to the resource (or non-existent resource) causing the error. + * @return reference + */ + @javax.annotation.Nullable + public String getReference() { + return reference; + } + + public void setReference(@javax.annotation.Nullable String reference) { + this.reference = reference; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Error1Source instance itself + */ + public Error1Source putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error1Source error1Source = (Error1Source) o; + return Objects.equals(this.parameter, error1Source.parameter) && + Objects.equals(this.field, error1Source.field) && + Objects.equals(this.header, error1Source.header) && + Objects.equals(this.reference, error1Source.reference)&& + Objects.equals(this.additionalProperties, error1Source.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parameter, field, header, reference, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error1Source {\n"); + sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("parameter", "field", "header", "reference")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error1Source + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error1Source.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1Source is not found in the empty JSON string", Error1Source.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("parameter") != null && !jsonObj.get("parameter").isJsonNull()) && !jsonObj.get("parameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `parameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parameter").toString())); + } + if ((jsonObj.get("field") != null && !jsonObj.get("field").isJsonNull()) && !jsonObj.get("field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); + } + if ((jsonObj.get("header") != null && !jsonObj.get("header").isJsonNull()) && !jsonObj.get("header").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `header` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header").toString())); + } + if ((jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonNull()) && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error1Source.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error1Source' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error1Source.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error1Source value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error1Source read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error1Source instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error1Source given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error1Source + * @throws IOException if the JSON string is invalid with respect to Error1Source + */ + public static Error1Source fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error1Source.class); + } + + /** + * Convert an instance of Error1Source to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java index 506e1d91..8c59b063 100644 --- a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java @@ -15,8 +15,8 @@ import java.util.Objects; import java.util.Locale; -import com.bandwidth.sdk.model.Error; -import com.bandwidth.sdk.model.Link; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -59,7 +59,7 @@ public class ErrorResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -69,17 +69,17 @@ public class ErrorResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public ErrorResponse() { } - public ErrorResponse links(@javax.annotation.Nonnull List links) { + public ErrorResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ErrorResponse addLinksItem(Link linksItem) { + public ErrorResponse addLinksItem(Link1 linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -92,11 +92,11 @@ public ErrorResponse addLinksItem(Link linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -120,12 +120,12 @@ public void setData(@javax.annotation.Nullable Object data) { } - public ErrorResponse errors(@javax.annotation.Nonnull List errors) { + public ErrorResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ErrorResponse addErrorsItem(Error errorsItem) { + public ErrorResponse addErrorsItem(Error1 errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -138,11 +138,11 @@ public ErrorResponse addErrorsItem(Error errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -275,7 +275,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link.validateJsonElement(jsonArraylinks.get(i)); + Link1.validateJsonElement(jsonArraylinks.get(i)); }; // ensure the json data is an array if (!jsonObj.get("errors").isJsonArray()) { @@ -285,7 +285,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error.validateJsonElement(jsonArrayerrors.get(i)); + Error1.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java index 17e398fe..bf27d076 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java @@ -132,7 +132,7 @@ public InboundCallback to(@javax.annotation.Nonnull String to) { } /** - * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. + * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. * @return to */ @javax.annotation.Nonnull @@ -189,7 +189,7 @@ public InboundCallback carrierName(@javax.annotation.Nullable String carrierName } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java index 2c09896b..cb3a5b64 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. */ @JsonAdapter(InboundCallbackTypeEnum.Adapter.class) public enum InboundCallbackTypeEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/Link1.java b/src/main/java/com/bandwidth/sdk/model/Link1.java new file mode 100644 index 00000000..46428c5e --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Link1.java @@ -0,0 +1,404 @@ +/* + * 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. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Link1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Link1 { + public static final String SERIALIZED_NAME_HREF = "href"; + @SerializedName(SERIALIZED_NAME_HREF) + @javax.annotation.Nullable + private String href; + + public static final String SERIALIZED_NAME_REL = "rel"; + @SerializedName(SERIALIZED_NAME_REL) + @javax.annotation.Nullable + private String rel; + + /** + * The HTTP method to use when making the request. + */ + @JsonAdapter(MethodEnum.Adapter.class) + public enum MethodEnum { + GET("GET"), + + POST("POST"), + + DELETE("DELETE"); + + private String value; + + MethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + MethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + @javax.annotation.Nullable + private MethodEnum method; + + public Link1() { + } + + public Link1 href(@javax.annotation.Nullable String href) { + this.href = href; + return this; + } + + /** + * The full URL of the link. + * @return href + */ + @javax.annotation.Nullable + public String getHref() { + return href; + } + + public void setHref(@javax.annotation.Nullable String href) { + this.href = href; + } + + + public Link1 rel(@javax.annotation.Nullable String rel) { + this.rel = rel; + return this; + } + + /** + * The relationship of the link to the current resource. + * @return rel + */ + @javax.annotation.Nullable + public String getRel() { + return rel; + } + + public void setRel(@javax.annotation.Nullable String rel) { + this.rel = rel; + } + + + public Link1 method(@javax.annotation.Nullable MethodEnum method) { + this.method = method; + return this; + } + + /** + * The HTTP method to use when making the request. + * @return method + */ + @javax.annotation.Nullable + public MethodEnum getMethod() { + return method; + } + + public void setMethod(@javax.annotation.Nullable MethodEnum method) { + this.method = method; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Link1 instance itself + */ + public Link1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Link1 link1 = (Link1) o; + return Objects.equals(this.href, link1.href) && + Objects.equals(this.rel, link1.rel) && + Objects.equals(this.method, link1.method)&& + Objects.equals(this.additionalProperties, link1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(href, rel, method, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Link1 {\n"); + sb.append(" href: ").append(toIndentedString(href)).append("\n"); + sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("href", "rel", "method")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Link1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Link1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Link1 is not found in the empty JSON string", Link1.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + } + if ((jsonObj.get("rel") != null && !jsonObj.get("rel").isJsonNull()) && !jsonObj.get("rel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `rel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rel").toString())); + } + if ((jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) && !jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + } + // validate the optional field `method` + if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) { + MethodEnum.validateJsonElement(jsonObj.get("method")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Link1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Link1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Link1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Link1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Link1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Link1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Link1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Link1 + * @throws IOException if the JSON string is invalid with respect to Link1 + */ + public static Link1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Link1.class); + } + + /** + * Convert an instance of Link1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java index ceba96e9..b343746a 100644 --- a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java @@ -16,8 +16,8 @@ import java.util.Objects; import java.util.Locale; import com.bandwidth.sdk.model.Endpoints; -import com.bandwidth.sdk.model.Error; -import com.bandwidth.sdk.model.Link; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; import com.bandwidth.sdk.model.Page; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -61,7 +61,7 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -76,17 +76,17 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public ListEndpointsResponse() { } - public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { + public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ListEndpointsResponse addLinksItem(Link linksItem) { + public ListEndpointsResponse addLinksItem(Link1 linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -99,11 +99,11 @@ public ListEndpointsResponse addLinksItem(Link linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -154,12 +154,12 @@ public void setData(@javax.annotation.Nonnull List data) { } - public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { + public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ListEndpointsResponse addErrorsItem(Error errorsItem) { + public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -172,11 +172,11 @@ public ListEndpointsResponse addErrorsItem(Error errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -311,7 +311,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link.validateJsonElement(jsonArraylinks.get(i)); + Link1.validateJsonElement(jsonArraylinks.get(i)); }; // validate the optional field `page` if (jsonObj.get("page") != null && !jsonObj.get("page").isJsonNull()) { @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error.validateJsonElement(jsonArrayerrors.get(i)); + Error1.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/LookupResult.java b/src/main/java/com/bandwidth/sdk/model/LookupResult.java index cc83ada9..131201a3 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupResult.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupResult.java @@ -296,7 +296,7 @@ public LookupResult initialMessageDeliveryStatusDate(@javax.annotation.Nullable } /** - * [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. + * [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. * @return initialMessageDeliveryStatusDate */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java index 4adad0ce..0b46bbae 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java @@ -235,7 +235,7 @@ public MachineDetectionConfiguration machineSpeechEndThreshold(@javax.annotation } /** - * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. + * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. * @return machineSpeechEndThreshold */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java index 0ed3c6db..6bdc175a 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java @@ -154,7 +154,7 @@ public MessageRequest from(@javax.annotation.Nonnull String from) { } /** - * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. * @return from */ @javax.annotation.Nonnull diff --git a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java index ebad86e5..a5749e75 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * 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. */ @JsonAdapter(RbmOpenUrlEnum.Adapter.class) public enum RbmOpenUrlEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java index 66d6526a..882b76fd 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. */ @JsonAdapter(RbmWebViewEnum.Adapter.class) public enum RbmWebViewEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java index d3c67ac6..f0ac27a2 100644 --- a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java @@ -237,7 +237,7 @@ public StatusCallback carrierName(@javax.annotation.Nullable String carrierName) } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/UpdateCall.java b/src/main/java/com/bandwidth/sdk/model/UpdateCall.java index f83fa2eb..cbf1a363 100644 --- a/src/main/java/com/bandwidth/sdk/model/UpdateCall.java +++ b/src/main/java/com/bandwidth/sdk/model/UpdateCall.java @@ -286,7 +286,7 @@ public UpdateCall tag(@javax.annotation.Nullable String tag) { } /** - * 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`. + * 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`. * @return tag */ @javax.annotation.Nullable From 5cdc95311312397e178d4e49439c5b7b79efd115 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 22 Apr 2026 15:54:53 -0400 Subject: [PATCH 2/4] regenerate with updated specs --- .openapi-generator/FILES | 20 +- README.md | 10 +- api/openapi.yaml | 284 +++++----- bandwidth.yml | 114 ++-- docs/{Error1.md => BrtcError.md} | 4 +- ...{ErrorResponse.md => BrtcErrorResponse.md} | 6 +- docs/{Error1Source.md => BrtcErrorSource.md} | 2 +- docs/{Link1.md => BrtcLink.md} | 14 +- docs/Callback.md | 4 +- docs/CreateCall.md | 2 +- docs/CreateEndpointResponse.md | 4 +- docs/CreateEndpointResponseObject.md | 20 - docs/EndpointResponse.md | 4 +- docs/InboundCallback.md | 4 +- docs/ListEndpointsResponse.md | 4 +- docs/LookupResult.md | 2 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/StatusCallback.md | 2 +- .../{Error.md => WebhookSubscriptionError.md} | 2 +- docs/WebhookSubscriptionsListBody.md | 2 +- src/main/java/com/bandwidth/sdk/JSON.java | 10 +- .../com/bandwidth/sdk/api/EndpointsApi.java | 2 +- .../sdk/model/{Error1.java => BrtcError.java} | 82 +-- ...orResponse.java => BrtcErrorResponse.java} | 88 +-- ...Error1Source.java => BrtcErrorSource.java} | 66 +-- .../sdk/model/{Link1.java => BrtcLink.java} | 126 ++--- .../com/bandwidth/sdk/model/CreateCall.java | 2 +- .../sdk/model/CreateEndpointResponse.java | 28 +- .../model/CreateEndpointResponseObject.java | 515 ------------------ .../bandwidth/sdk/model/EndpointResponse.java | 28 +- .../bandwidth/sdk/model/InboundCallback.java | 4 +- .../sdk/model/InboundCallbackTypeEnum.java | 2 +- .../sdk/model/ListEndpointsResponse.java | 28 +- .../com/bandwidth/sdk/model/LookupResult.java | 2 +- .../model/MachineDetectionConfiguration.java | 2 +- .../bandwidth/sdk/model/MessageRequest.java | 2 +- .../bandwidth/sdk/model/RbmOpenUrlEnum.java | 2 +- .../bandwidth/sdk/model/RbmWebViewEnum.java | 2 +- .../bandwidth/sdk/model/StatusCallback.java | 2 +- ...ror.java => WebhookSubscriptionError.java} | 64 +-- .../model/WebhookSubscriptionsListBody.java | 14 +- 42 files changed, 482 insertions(+), 1097 deletions(-) rename docs/{Error1.md => BrtcError.md} (81%) rename docs/{ErrorResponse.md => BrtcErrorResponse.md} (51%) rename docs/{Error1Source.md => BrtcErrorSource.md} (96%) rename docs/{Link1.md => BrtcLink.md} (52%) delete mode 100644 docs/CreateEndpointResponseObject.md rename docs/{Error.md => WebhookSubscriptionError.md} (92%) rename src/main/java/com/bandwidth/sdk/model/{Error1.java => BrtcError.java} (83%) rename src/main/java/com/bandwidth/sdk/model/{ErrorResponse.java => BrtcErrorResponse.java} (79%) rename src/main/java/com/bandwidth/sdk/model/{Error1Source.java => BrtcErrorSource.java} (84%) rename src/main/java/com/bandwidth/sdk/model/{Link1.java => BrtcLink.java} (75%) delete mode 100644 src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java rename src/main/java/com/bandwidth/sdk/model/{Error.java => WebhookSubscriptionError.java} (82%) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c73957e8..0da4f8c5 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -11,6 +11,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 @@ -67,11 +71,7 @@ docs/EndpointStatusEnum.md docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md -docs/Error.md -docs/Error1.md -docs/Error1Source.md docs/ErrorObject.md -docs/ErrorResponse.md docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md @@ -87,7 +87,6 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md -docs/Link1.md docs/LinkSchema.md docs/LinksObject.md docs/ListEndpointsResponse.md @@ -210,6 +209,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 @@ -264,6 +264,10 @@ src/main/java/com/bandwidth/sdk/model/AsyncLookupRequest.java src/main/java/com/bandwidth/sdk/model/BlockedWebhook.java src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java +src/main/java/com/bandwidth/sdk/model/BrtcError.java +src/main/java/com/bandwidth/sdk/model/BrtcErrorResponse.java +src/main/java/com/bandwidth/sdk/model/BrtcErrorSource.java +src/main/java/com/bandwidth/sdk/model/BrtcLink.java src/main/java/com/bandwidth/sdk/model/BusinessEntityTypeEnum.java src/main/java/com/bandwidth/sdk/model/BusinessRegistrationTypeEnum.java src/main/java/com/bandwidth/sdk/model/CallDirectionEnum.java @@ -317,11 +321,7 @@ src/main/java/com/bandwidth/sdk/model/EndpointResponse.java src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java src/main/java/com/bandwidth/sdk/model/Endpoints.java -src/main/java/com/bandwidth/sdk/model/Error.java -src/main/java/com/bandwidth/sdk/model/Error1.java -src/main/java/com/bandwidth/sdk/model/Error1Source.java src/main/java/com/bandwidth/sdk/model/ErrorObject.java -src/main/java/com/bandwidth/sdk/model/ErrorResponse.java src/main/java/com/bandwidth/sdk/model/ErrorSource.java src/main/java/com/bandwidth/sdk/model/FailureWebhook.java src/main/java/com/bandwidth/sdk/model/FieldError.java @@ -337,7 +337,6 @@ src/main/java/com/bandwidth/sdk/model/InitiateCallback.java src/main/java/com/bandwidth/sdk/model/LatestMessageDeliveryStatusEnum.java src/main/java/com/bandwidth/sdk/model/LineTypeEnum.java src/main/java/com/bandwidth/sdk/model/Link.java -src/main/java/com/bandwidth/sdk/model/Link1.java src/main/java/com/bandwidth/sdk/model/LinkSchema.java src/main/java/com/bandwidth/sdk/model/LinksObject.java src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java @@ -450,6 +449,7 @@ src/main/java/com/bandwidth/sdk/model/VoiceApiError.java src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java src/main/java/com/bandwidth/sdk/model/WebhookSubscription.java src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionBasicAuthentication.java +src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionError.java src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionRequestSchema.java src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionTypeEnum.java src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionsListBody.java diff --git a/README.md b/README.md index a3022bd5..0f80d7dc 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,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) @@ -249,11 +253,7 @@ Class | Method | HTTP request | Description - [EndpointStatusEnum](docs/EndpointStatusEnum.md) - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - - [Error](docs/Error.md) - - [Error1](docs/Error1.md) - - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) - - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) @@ -269,7 +269,6 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) - - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) - [ListEndpointsResponse](docs/ListEndpointsResponse.md) @@ -383,6 +382,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/openapi.yaml b/api/openapi.yaml index 8e7e134d..cf852266 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5907,7 +5907,7 @@ paths: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request "401": content: @@ -5916,7 +5916,7 @@ paths: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized "403": content: @@ -5925,7 +5925,7 @@ paths: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden "404": content: @@ -5934,7 +5934,7 @@ paths: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found "405": content: @@ -5943,7 +5943,7 @@ paths: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed "415": content: @@ -5952,7 +5952,7 @@ paths: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type "429": content: @@ -5961,7 +5961,7 @@ paths: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -5980,7 +5980,7 @@ paths: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable summary: List Endpoints tags: @@ -6025,7 +6025,7 @@ paths: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request "401": content: @@ -6034,7 +6034,7 @@ paths: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized "403": content: @@ -6043,7 +6043,7 @@ paths: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden "404": content: @@ -6052,7 +6052,7 @@ paths: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found "405": content: @@ -6061,7 +6061,7 @@ paths: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed "415": content: @@ -6070,7 +6070,7 @@ paths: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type "429": content: @@ -6079,7 +6079,7 @@ paths: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -6098,7 +6098,7 @@ paths: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable summary: Create Endpoint tags: @@ -6146,7 +6146,7 @@ paths: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request "401": content: @@ -6155,7 +6155,7 @@ paths: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized "403": content: @@ -6164,7 +6164,7 @@ paths: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden "404": content: @@ -6173,7 +6173,7 @@ paths: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found "405": content: @@ -6182,7 +6182,7 @@ paths: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed "415": content: @@ -6191,7 +6191,7 @@ paths: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type "429": content: @@ -6200,7 +6200,7 @@ paths: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -6219,7 +6219,7 @@ paths: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable summary: Delete Endpoint tags: @@ -6268,7 +6268,7 @@ paths: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request "401": content: @@ -6277,7 +6277,7 @@ paths: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized "403": content: @@ -6286,7 +6286,7 @@ paths: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden "404": content: @@ -6295,7 +6295,7 @@ paths: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found "405": content: @@ -6304,7 +6304,7 @@ paths: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed "415": content: @@ -6313,7 +6313,7 @@ paths: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type "429": content: @@ -6322,7 +6322,7 @@ paths: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -6341,7 +6341,7 @@ paths: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable summary: Get Endpoint tags: @@ -6389,7 +6389,7 @@ paths: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request "401": content: @@ -6398,7 +6398,7 @@ paths: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized "403": content: @@ -6407,7 +6407,7 @@ paths: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden "404": content: @@ -6416,7 +6416,7 @@ paths: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found "405": content: @@ -6425,7 +6425,7 @@ paths: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed "415": content: @@ -6434,7 +6434,7 @@ paths: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type "429": content: @@ -6443,7 +6443,7 @@ paths: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -6462,7 +6462,7 @@ paths: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable summary: Update Endpoint BXML tags: @@ -6491,15 +6491,13 @@ components: $ref: "#/components/examples/mmsMessageReceivedCallbackExample" schema: $ref: "#/components/schemas/inboundCallback" - description: "

This Inbound Message Webhook is an envelope containing\ - \ either a received (MO) message to your \nmessage-enabled Bandwidth\ - \ telephone number or a multichannel client's response to a suggestion\ - \ response \nor location request. \n

The payload type will be one\ - \ of message-received, suggestion-response,\ - \ or location-request-response.\n

Note that suggestion-response\ - \ and location-request-response callback types are pertinent\ - \ only for RBM messages sent from the /messages/multiChannel\ - \ endpoint.\n

Please visit Webhooks

" + description: |- +

This Inbound Message Webhook is an envelope containing either a received (MO) message to your + message-enabled Bandwidth telephone number or a multichannel client's response to a suggestion response + or location request. +

The payload type will be one of message-received, suggestion-response, or location-request-response. +

Note that suggestion-response and location-request-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

Please visit Webhooks

required: true responses: "200": @@ -9028,7 +9026,7 @@ components: badRequestErrorExample: $ref: "#/components/examples/badRequestErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Bad Request unauthorizedErrorResponse: content: @@ -9037,7 +9035,7 @@ components: unauthorizedErrorExample: $ref: "#/components/examples/unauthorizedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unauthorized forbiddenErrorResponse: content: @@ -9046,7 +9044,7 @@ components: forbiddenErrorExample: $ref: "#/components/examples/forbiddenErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Forbidden notFoundErrorResponse: content: @@ -9055,7 +9053,7 @@ components: notFoundErrorExample: $ref: "#/components/examples/notFoundErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Not Found methodNotAllowedErrorResponse: content: @@ -9064,7 +9062,7 @@ components: methodNotAllowedErrorExample: $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Method Not Allowed unsupportedMediaTypeErrorResponse: content: @@ -9073,7 +9071,7 @@ components: unsuppotedMediaTypeErrorExample: $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Unsupported Media Type tooManyRequestsErrorResponse: content: @@ -9082,7 +9080,7 @@ components: tooManyRequestsErrorExample: $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Too Many Requests headers: Retry-After: @@ -9101,7 +9099,7 @@ components: serviceUnavailableErrorExample: $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/errorResponse" + $ref: "#/components/schemas/brtcErrorResponse" description: Service Unavailable schemas: applicationId: @@ -9488,9 +9486,10 @@ components: format: date-time type: string carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was sent\ - \ to.\nThis field is present only when this account feature has been enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string message: @@ -9597,13 +9596,9 @@ components: type: array uniqueItems: true from: - description: "Either an alphanumeric sender ID or the sender's Bandwidth\ - \ phone number in E.164 format, which must be hosted within Bandwidth\ - \ and linked to the account that is generating the message. \nAlphanumeric\ - \ Sender IDs can contain up to 11 characters, upper-case letters A-Z,\ - \ lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore\ - \ _ and ampersand &. Alphanumeric Sender IDs must contain at least one\ - \ letter." + description: |- + Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. + Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. example: "+15551113333" type: string text: @@ -10132,20 +10127,21 @@ components: example: REPLY type: string rbmOpenUrlEnum: - description: "Specifies how the URL should be opened on a mobile device.\n-\ - \ `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. \n- `WEBVIEW` Opens the URL in an in-app WebView." + description: |- + 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: - BROWSER - WEBVIEW example: WEBVIEW type: string rbmWebViewEnum: - description: "Defines the layout of the WebView on a mobile device. It must\ - \ be defined when application is set to `WEBVIEW`\n- `FULL` WebView takes\ - \ the full screen. \n- `HALF` WebView takes half of the screen.\n- `TALL`\ - \ WebView takes three-quarters of the screen." + description: |- + Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` + - `FULL` WebView takes the full screen. + - `HALF` WebView takes half of the screen. + - `TALL` WebView takes three-quarters of the screen. enum: - FULL - HALF @@ -10709,10 +10705,10 @@ components: example: 4405 type: integer carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was\ - \ sent to.\nThis field is present only when this account feature has been\ - \ enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string required: @@ -10732,9 +10728,9 @@ components: type: $ref: "#/components/schemas/inboundCallbackTypeEnum" to: - description: "The destination phone number the message was sent to. \nFor\ - \ inbound callbacks, this is the Bandwidth number or alphanumeric identifier\ - \ that received the message.\n" + description: | + The destination phone number the message was sent to. + For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. example: "+15552223333" type: string description: @@ -10744,10 +10740,10 @@ components: message: $ref: "#/components/schemas/inboundCallbackMessage" carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was\ - \ sent to.\nThis field is present only when this account feature has been\ - \ enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string required: @@ -10772,13 +10768,11 @@ components: example: message-delivered type: string inboundCallbackTypeEnum: - description: "The possible inbound callback types originating from MO messages\ - \ or multichannel message client responses:\n- `message-received` indicates\ - \ an MO message from a Bandwidth user's client to a Bandwidth number.\n- `request-location-response`\ - \ indicates a response to a location request sent by the Bandwidth user's\ - \ client after receiving an RBM message. \n- `suggestion-response` indicates\ - \ a response to a suggestion sent by the Bandwidth user's client after receiving\ - \ an RBM message." + description: |- + The possible inbound callback types originating from MO messages or multichannel message client responses: + - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. + - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. + - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. enum: - message-received - request-location-response @@ -10996,10 +10990,10 @@ components: nullable: true type: boolean displayName: - description: "The caller display name to use when the call is created. \n\ - May not exceed 256 characters nor contain control characters such as new\ - \ lines.\nIf `privacy` is true, only the following values are valid: `Restricted`,\ - \ `Anonymous`, `Private`, or `Unavailable`." + description: |- + 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`. example: John Doe maxLength: 256 nullable: true @@ -11964,9 +11958,9 @@ components: nullable: true type: number machineSpeechEndThreshold: - description: "When an answering machine is detected, the amount of silence\ - \ (in seconds) before assuming the message has finished playing. \nIf\ - \ not provided it will default to the speechEndThreshold value." + description: |- + When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. + If not provided it will default to the speechEndThreshold value. example: 5 format: double nullable: true @@ -14764,10 +14758,10 @@ components: latestMessageDeliveryStatus: $ref: "#/components/schemas/latestMessageDeliveryStatusEnum" initialMessageDeliveryStatusDate: - description: "[DNI-Only](#section/DNI-Only). The date the phone number entered\ - \ the status described in `latestMessageDeliveryStatus`. \nThink of this\ - \ as the \"start time\" for that status.\nValue resets every time the\ - \ `latestMessageDeliveryStatus` changes." + description: |- + [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. example: 2025-06-20 format: date type: string @@ -15724,7 +15718,7 @@ components: $ref: "#/components/schemas/linksObject" errors: items: - $ref: "#/components/schemas/error" + $ref: "#/components/schemas/webhookSubscriptionError" type: array data: items: @@ -15756,7 +15750,7 @@ components: \ return the last page of result." type: string type: object - error: + webhookSubscriptionError: example: code: 0 telephoneNumbers: @@ -16387,7 +16381,7 @@ components: - eventType type: object description: An event that occurred on an endpoint. - link1: + brtcLink: example: method: GET rel: self @@ -16403,10 +16397,6 @@ components: type: string method: description: The HTTP method to use when making the request. - enum: - - GET - - POST - - DELETE example: GET type: string type: object @@ -16440,7 +16430,7 @@ components: required: - pageSize type: object - error1: + brtcError: example: code: "404" description: The requested resource was not found. @@ -16470,11 +16460,36 @@ components: example: "404" type: string source: - $ref: "#/components/schemas/error1_source" + $ref: "#/components/schemas/brtcErrorSource" required: - description - type type: object + brtcErrorSource: + example: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + properties: + parameter: + description: The URI parameter that caused the error. + example: accountId + type: string + field: + description: The request body field that caused the error. + example: accountId + type: string + header: + description: The header that caused the error. + example: Authorization + type: string + reference: + description: The resource ID or path to the resource (or non-existent resource) + causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + type: object listEndpointsResponse: example: data: @@ -16524,7 +16539,7 @@ components: properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/brtcLink" type: array page: $ref: "#/components/schemas/page" @@ -16534,7 +16549,7 @@ components: type: array errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/brtcError" type: array required: - data @@ -16588,13 +16603,13 @@ components: properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/brtcLink" type: array data: $ref: "#/components/schemas/endpoint" errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/brtcError" type: array required: - data @@ -16649,20 +16664,20 @@ components: properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/brtcLink" type: array data: $ref: "#/components/schemas/createEndpointResponseData" errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/brtcError" type: array required: - data - errors - links type: object - errorResponse: + brtcErrorResponse: example: data: "{}" links: @@ -16694,7 +16709,7 @@ components: properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/brtcLink" type: array data: additionalProperties: false @@ -16702,7 +16717,7 @@ components: type: object errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/brtcError" type: array required: - data @@ -16870,31 +16885,6 @@ components: - password - username type: object - error1_source: - example: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - properties: - parameter: - description: The URI parameter that caused the error. - example: accountId - type: string - field: - description: The request body field that caused the error. - example: accountId - type: string - header: - description: The header that caused the error. - example: Authorization - type: string - reference: - description: The resource ID or path to the resource (or non-existent resource) - causing the error. - example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - type: string - type: object securitySchemes: Basic: description: |- diff --git a/bandwidth.yml b/bandwidth.yml index c7105f39..6ad54bc1 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2161,7 +2161,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2248,7 +2248,7 @@ components: description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. + linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, @@ -2571,8 +2571,8 @@ 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 - option is used by default. + 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: @@ -2585,7 +2585,7 @@ components: Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2987,7 +2987,7 @@ components: to: type: string description: > - The destination phone number the message was sent to. + The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. @@ -3038,7 +3038,7 @@ components: client to a Bandwidth number. - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. @@ -3277,7 +3277,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -4214,7 +4214,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5958,7 +5958,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -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,7 +7060,7 @@ components: required: - eventType - eventTime - link1: + brtcLink: type: object properties: href: @@ -7074,10 +7074,6 @@ components: example: self method: type: string - enum: - - GET - - POST - - DELETE description: The HTTP method to use when making the request. example: GET page: @@ -7105,7 +7101,7 @@ components: example: 0 required: - pageSize - error1: + brtcError: type: object properties: id: @@ -7126,36 +7122,38 @@ components: description: A code that uniquely identifies the error. example: '404' source: - 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 + $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/link1' + $ref: '#/components/schemas/brtcLink' page: $ref: '#/components/schemas/page' data: @@ -7165,7 +7163,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7176,13 +7174,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7193,24 +7191,24 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data - errors - errorResponse: + brtcErrorResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: type: object nullable: true @@ -7218,7 +7216,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7929,7 +7927,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: badRequestErrorExample: $ref: '#/components/examples/badRequestErrorExample' @@ -7938,7 +7936,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unauthorizedErrorExample: $ref: '#/components/examples/unauthorizedErrorExample' @@ -7947,7 +7945,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: forbiddenErrorExample: $ref: '#/components/examples/forbiddenErrorExample' @@ -7956,7 +7954,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: notFoundErrorExample: $ref: '#/components/examples/notFoundErrorExample' @@ -7965,7 +7963,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: methodNotAllowedErrorExample: $ref: '#/components/examples/methodNotAllowedErrorExample' @@ -7974,7 +7972,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unsuppotedMediaTypeErrorExample: $ref: '#/components/examples/unsupportedMediaTypeErrorExample' @@ -7992,7 +7990,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: tooManyRequestsErrorExample: $ref: '#/components/examples/tooManyRequestsErrorExample' @@ -8001,7 +7999,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: serviceUnavailableErrorExample: $ref: '#/components/examples/serviceUnavailableErrorExample' @@ -9629,12 +9627,12 @@ components: required: true description: >-

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your + received (MO) message to your message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response + client's response to a suggestion response - or location request. + or location request.

The payload type will be one of message-received, suggestion-response, or diff --git a/docs/Error1.md b/docs/BrtcError.md similarity index 81% rename from docs/Error1.md rename to docs/BrtcError.md index 1835a088..29beefb0 100644 --- a/docs/Error1.md +++ b/docs/BrtcError.md @@ -1,6 +1,6 @@ -# Error1 +# BrtcError ## Properties @@ -11,7 +11,7 @@ |**type** | **String** | The type of error. | | |**description** | **String** | A description of the error. | | |**code** | **String** | A code that uniquely identifies the error. | [optional] | -|**source** | [**Error1Source**](Error1Source.md) | | [optional] | +|**source** | [**BrtcErrorSource**](BrtcErrorSource.md) | | [optional] | diff --git a/docs/ErrorResponse.md b/docs/BrtcErrorResponse.md similarity index 51% rename from docs/ErrorResponse.md rename to docs/BrtcErrorResponse.md index fa7cb478..163924a1 100644 --- a/docs/ErrorResponse.md +++ b/docs/BrtcErrorResponse.md @@ -1,15 +1,15 @@ -# ErrorResponse +# BrtcErrorResponse ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<BrtcLink>**](BrtcLink.md) | | | |**data** | **Object** | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<BrtcError>**](BrtcError.md) | | | diff --git a/docs/Error1Source.md b/docs/BrtcErrorSource.md similarity index 96% rename from docs/Error1Source.md rename to docs/BrtcErrorSource.md index 4665f119..000c5515 100644 --- a/docs/Error1Source.md +++ b/docs/BrtcErrorSource.md @@ -1,6 +1,6 @@ -# Error1Source +# BrtcErrorSource ## Properties diff --git a/docs/Link1.md b/docs/BrtcLink.md similarity index 52% rename from docs/Link1.md rename to docs/BrtcLink.md index e2023ab1..d9aa3828 100644 --- a/docs/Link1.md +++ b/docs/BrtcLink.md @@ -1,6 +1,6 @@ -# Link1 +# BrtcLink ## Properties @@ -9,17 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**href** | **String** | The full URL of the link. | [optional] | |**rel** | **String** | The relationship of the link to the current resource. | [optional] | -|**method** | [**MethodEnum**](#MethodEnum) | The HTTP method to use when making the request. | [optional] | - - - -## Enum: MethodEnum - -| Name | Value | -|---- | -----| -| GET | "GET" | -| POST | "POST" | -| DELETE | "DELETE" | +|**method** | **String** | The HTTP method to use when making the request. | [optional] | diff --git a/docs/Callback.md b/docs/Callback.md index 56428470..9d38bdd5 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -11,11 +11,11 @@ Callbacks are divided into two types based on direction of the related message: |**time** | **OffsetDateTime** | | | |**eventTime** | **OffsetDateTime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | |**errorCode** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 3992fe94..2561841f 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -10,7 +10,7 @@ |**to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | | |**from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | | |**privacy** | **Boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] | -|**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 `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | +|**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 `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | |**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] | |**applicationId** | **String** | The id of the application associated with the `from` number. | | |**answerUrl** | **URI** | 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`. | | diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index 218f50b8..1a55313d 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<BrtcLink>**](BrtcLink.md) | | | |**data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<BrtcError>**](BrtcError.md) | | | diff --git a/docs/CreateEndpointResponseObject.md b/docs/CreateEndpointResponseObject.md deleted file mode 100644 index 4506e590..00000000 --- a/docs/CreateEndpointResponseObject.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# CreateEndpointResponseObject - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**endpointId** | **String** | The unique ID of the endpoint. | | -|**type** | **EndpointTypeEnum** | | | -|**status** | **EndpointStatusEnum** | | | -|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | -|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | -|**tag** | **String** | A tag for the endpoint. | [optional] | -|**devices** | [**List<Device>**](Device.md) | | [optional] | -|**token** | **String** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | | - - - diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index d5615e9c..9c3f932d 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<BrtcLink>**](BrtcLink.md) | | | |**data** | [**Endpoint**](Endpoint.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<BrtcError>**](BrtcError.md) | | | diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index 5a1993cb..520e3f24 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -10,10 +10,10 @@ Represents an inbound callback. |------------ | ------------- | ------------- | -------------| |**time** | **OffsetDateTime** | | | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index cefcc63e..7aacc62d 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<BrtcLink>**](BrtcLink.md) | | | |**page** | [**Page**](Page.md) | | [optional] | |**data** | [**List<Endpoints>**](Endpoints.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<BrtcError>**](BrtcError.md) | | | diff --git a/docs/LookupResult.md b/docs/LookupResult.md index 8da97817..f411de19 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -17,7 +17,7 @@ Carrier information results for the specified telephone number. |**deactivationDate** | **String** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] | |**deactivationEvent** | **DeactivationEventEnum** | | [optional] | |**latestMessageDeliveryStatus** | **LatestMessageDeliveryStatusEnum** | | [optional] | -|**initialMessageDeliveryStatusDate** | **LocalDate** | [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] | +|**initialMessageDeliveryStatusDate** | **LocalDate** | [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] | |**latestMessageDeliveryStatusDate** | **LocalDate** | [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] | |**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] | diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index a3f6de4c..f3aeba26 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -13,7 +13,7 @@ The machine detection request used to perform elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Error1.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BrtcError.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Error1 value) throws IOException { + public void write(JsonWriter out, BrtcError value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -360,12 +360,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Error1 read(JsonReader in) throws IOException { + public BrtcError read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Error1 instance = thisAdapter.fromJsonTree(jsonObj); + BrtcError instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -392,18 +392,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Error1 given an JSON string + * Create an instance of BrtcError given an JSON string * * @param jsonString JSON string - * @return An instance of Error1 - * @throws IOException if the JSON string is invalid with respect to Error1 + * @return An instance of BrtcError + * @throws IOException if the JSON string is invalid with respect to BrtcError */ - public static Error1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error1.class); + public static BrtcError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BrtcError.class); } /** - * Convert an instance of Error1 to an JSON string + * Convert an instance of BrtcError to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java b/src/main/java/com/bandwidth/sdk/model/BrtcErrorResponse.java similarity index 79% rename from src/main/java/com/bandwidth/sdk/model/ErrorResponse.java rename to src/main/java/com/bandwidth/sdk/model/BrtcErrorResponse.java index 8c59b063..b54a27a5 100644 --- a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/BrtcErrorResponse.java @@ -15,8 +15,8 @@ import java.util.Objects; import java.util.Locale; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; +import com.bandwidth.sdk.model.BrtcError; +import com.bandwidth.sdk.model.BrtcLink; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -52,14 +52,14 @@ import com.bandwidth.sdk.JSON; /** - * ErrorResponse + * BrtcErrorResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class ErrorResponse { +public class BrtcErrorResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -69,17 +69,17 @@ public class ErrorResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); - public ErrorResponse() { + public BrtcErrorResponse() { } - public ErrorResponse links(@javax.annotation.Nonnull List links) { + public BrtcErrorResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ErrorResponse addLinksItem(Link1 linksItem) { + public BrtcErrorResponse addLinksItem(BrtcLink linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -92,16 +92,16 @@ public ErrorResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } - public ErrorResponse data(@javax.annotation.Nullable Object data) { + public BrtcErrorResponse data(@javax.annotation.Nullable Object data) { this.data = data; return this; } @@ -120,12 +120,12 @@ public void setData(@javax.annotation.Nullable Object data) { } - public ErrorResponse errors(@javax.annotation.Nonnull List errors) { + public BrtcErrorResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ErrorResponse addErrorsItem(Error1 errorsItem) { + public BrtcErrorResponse addErrorsItem(BrtcError errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -138,11 +138,11 @@ public ErrorResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -159,9 +159,9 @@ public void setErrors(@javax.annotation.Nonnull List errors) { * * @param key name of the property * @param value value of the property - * @return the ErrorResponse instance itself + * @return the BrtcErrorResponse instance itself */ - public ErrorResponse putAdditionalProperty(String key, Object value) { + public BrtcErrorResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -200,11 +200,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.links, errorResponse.links) && - Objects.equals(this.data, errorResponse.data) && - Objects.equals(this.errors, errorResponse.errors)&& - Objects.equals(this.additionalProperties, errorResponse.additionalProperties); + BrtcErrorResponse brtcErrorResponse = (BrtcErrorResponse) o; + return Objects.equals(this.links, brtcErrorResponse.links) && + Objects.equals(this.data, brtcErrorResponse.data) && + Objects.equals(this.errors, brtcErrorResponse.errors)&& + Objects.equals(this.additionalProperties, brtcErrorResponse.additionalProperties); } @Override @@ -215,7 +215,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); + sb.append("class BrtcErrorResponse {\n"); sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); @@ -251,17 +251,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + * @throws IOException if the JSON Element is invalid with respect to BrtcErrorResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + if (!BrtcErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BrtcErrorResponse is not found in the empty JSON string", BrtcErrorResponse.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ErrorResponse.openapiRequiredFields) { + for (String requiredField : BrtcErrorResponse.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } @@ -275,7 +275,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + BrtcLink.validateJsonElement(jsonArraylinks.get(i)); }; // ensure the json data is an array if (!jsonObj.get("errors").isJsonArray()) { @@ -285,7 +285,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + BrtcError.validateJsonElement(jsonArrayerrors.get(i)); }; } @@ -293,16 +293,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ErrorResponse' and its subtypes + if (!BrtcErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BrtcErrorResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BrtcErrorResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, ErrorResponse value) throws IOException { + public void write(JsonWriter out, BrtcErrorResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -330,12 +330,12 @@ else if (entry.getValue() instanceof Character) } @Override - public ErrorResponse read(JsonReader in) throws IOException { + public BrtcErrorResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - ErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + BrtcErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -362,18 +362,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of ErrorResponse given an JSON string + * Create an instance of BrtcErrorResponse given an JSON string * * @param jsonString JSON string - * @return An instance of ErrorResponse - * @throws IOException if the JSON string is invalid with respect to ErrorResponse + * @return An instance of BrtcErrorResponse + * @throws IOException if the JSON string is invalid with respect to BrtcErrorResponse */ - public static ErrorResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + public static BrtcErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BrtcErrorResponse.class); } /** - * Convert an instance of ErrorResponse to an JSON string + * Convert an instance of BrtcErrorResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/bandwidth/sdk/model/Error1Source.java b/src/main/java/com/bandwidth/sdk/model/BrtcErrorSource.java similarity index 84% rename from src/main/java/com/bandwidth/sdk/model/Error1Source.java rename to src/main/java/com/bandwidth/sdk/model/BrtcErrorSource.java index d0bc96ac..74092329 100644 --- a/src/main/java/com/bandwidth/sdk/model/Error1Source.java +++ b/src/main/java/com/bandwidth/sdk/model/BrtcErrorSource.java @@ -48,10 +48,10 @@ import com.bandwidth.sdk.JSON; /** - * Error1Source + * BrtcErrorSource */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Error1Source { +public class BrtcErrorSource { public static final String SERIALIZED_NAME_PARAMETER = "parameter"; @SerializedName(SERIALIZED_NAME_PARAMETER) @javax.annotation.Nullable @@ -72,10 +72,10 @@ public class Error1Source { @javax.annotation.Nullable private String reference; - public Error1Source() { + public BrtcErrorSource() { } - public Error1Source parameter(@javax.annotation.Nullable String parameter) { + public BrtcErrorSource parameter(@javax.annotation.Nullable String parameter) { this.parameter = parameter; return this; } @@ -94,7 +94,7 @@ public void setParameter(@javax.annotation.Nullable String parameter) { } - public Error1Source field(@javax.annotation.Nullable String field) { + public BrtcErrorSource field(@javax.annotation.Nullable String field) { this.field = field; return this; } @@ -113,7 +113,7 @@ public void setField(@javax.annotation.Nullable String field) { } - public Error1Source header(@javax.annotation.Nullable String header) { + public BrtcErrorSource header(@javax.annotation.Nullable String header) { this.header = header; return this; } @@ -132,7 +132,7 @@ public void setHeader(@javax.annotation.Nullable String header) { } - public Error1Source reference(@javax.annotation.Nullable String reference) { + public BrtcErrorSource reference(@javax.annotation.Nullable String reference) { this.reference = reference; return this; } @@ -163,9 +163,9 @@ public void setReference(@javax.annotation.Nullable String reference) { * * @param key name of the property * @param value value of the property - * @return the Error1Source instance itself + * @return the BrtcErrorSource instance itself */ - public Error1Source putAdditionalProperty(String key, Object value) { + public BrtcErrorSource putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -204,12 +204,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Error1Source error1Source = (Error1Source) o; - return Objects.equals(this.parameter, error1Source.parameter) && - Objects.equals(this.field, error1Source.field) && - Objects.equals(this.header, error1Source.header) && - Objects.equals(this.reference, error1Source.reference)&& - Objects.equals(this.additionalProperties, error1Source.additionalProperties); + BrtcErrorSource brtcErrorSource = (BrtcErrorSource) o; + return Objects.equals(this.parameter, brtcErrorSource.parameter) && + Objects.equals(this.field, brtcErrorSource.field) && + Objects.equals(this.header, brtcErrorSource.header) && + Objects.equals(this.reference, brtcErrorSource.reference)&& + Objects.equals(this.additionalProperties, brtcErrorSource.additionalProperties); } @Override @@ -220,7 +220,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Error1Source {\n"); + sb.append("class BrtcErrorSource {\n"); sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); sb.append(" field: ").append(toIndentedString(field)).append("\n"); sb.append(" header: ").append(toIndentedString(header)).append("\n"); @@ -257,12 +257,12 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error1Source + * @throws IOException if the JSON Element is invalid with respect to BrtcErrorSource */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Error1Source.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1Source is not found in the empty JSON string", Error1Source.openapiRequiredFields.toString())); + if (!BrtcErrorSource.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BrtcErrorSource is not found in the empty JSON string", BrtcErrorSource.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -284,16 +284,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Error1Source.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Error1Source' and its subtypes + if (!BrtcErrorSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BrtcErrorSource' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Error1Source.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BrtcErrorSource.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Error1Source value) throws IOException { + public void write(JsonWriter out, BrtcErrorSource value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -321,12 +321,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Error1Source read(JsonReader in) throws IOException { + public BrtcErrorSource read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Error1Source instance = thisAdapter.fromJsonTree(jsonObj); + BrtcErrorSource instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -353,18 +353,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Error1Source given an JSON string + * Create an instance of BrtcErrorSource given an JSON string * * @param jsonString JSON string - * @return An instance of Error1Source - * @throws IOException if the JSON string is invalid with respect to Error1Source + * @return An instance of BrtcErrorSource + * @throws IOException if the JSON string is invalid with respect to BrtcErrorSource */ - public static Error1Source fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error1Source.class); + public static BrtcErrorSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BrtcErrorSource.class); } /** - * Convert an instance of Error1Source to an JSON string + * Convert an instance of BrtcErrorSource to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/bandwidth/sdk/model/Link1.java b/src/main/java/com/bandwidth/sdk/model/BrtcLink.java similarity index 75% rename from src/main/java/com/bandwidth/sdk/model/Link1.java rename to src/main/java/com/bandwidth/sdk/model/BrtcLink.java index 46428c5e..b8e5fb67 100644 --- a/src/main/java/com/bandwidth/sdk/model/Link1.java +++ b/src/main/java/com/bandwidth/sdk/model/BrtcLink.java @@ -48,10 +48,10 @@ import com.bandwidth.sdk.JSON; /** - * Link1 + * BrtcLink */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Link1 { +public class BrtcLink { public static final String SERIALIZED_NAME_HREF = "href"; @SerializedName(SERIALIZED_NAME_HREF) @javax.annotation.Nullable @@ -62,69 +62,15 @@ public class Link1 { @javax.annotation.Nullable private String rel; - /** - * The HTTP method to use when making the request. - */ - @JsonAdapter(MethodEnum.Adapter.class) - public enum MethodEnum { - GET("GET"), - - POST("POST"), - - DELETE("DELETE"); - - private String value; - - MethodEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MethodEnum fromValue(String value) { - for (MethodEnum b : MethodEnum.values()) { - if (b.value.equalsIgnoreCase(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return MethodEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - MethodEnum.fromValue(value); - } - } - public static final String SERIALIZED_NAME_METHOD = "method"; @SerializedName(SERIALIZED_NAME_METHOD) @javax.annotation.Nullable - private MethodEnum method; + private String method; - public Link1() { + public BrtcLink() { } - public Link1 href(@javax.annotation.Nullable String href) { + public BrtcLink href(@javax.annotation.Nullable String href) { this.href = href; return this; } @@ -143,7 +89,7 @@ public void setHref(@javax.annotation.Nullable String href) { } - public Link1 rel(@javax.annotation.Nullable String rel) { + public BrtcLink rel(@javax.annotation.Nullable String rel) { this.rel = rel; return this; } @@ -162,7 +108,7 @@ public void setRel(@javax.annotation.Nullable String rel) { } - public Link1 method(@javax.annotation.Nullable MethodEnum method) { + public BrtcLink method(@javax.annotation.Nullable String method) { this.method = method; return this; } @@ -172,11 +118,11 @@ public Link1 method(@javax.annotation.Nullable MethodEnum method) { * @return method */ @javax.annotation.Nullable - public MethodEnum getMethod() { + public String getMethod() { return method; } - public void setMethod(@javax.annotation.Nullable MethodEnum method) { + public void setMethod(@javax.annotation.Nullable String method) { this.method = method; } @@ -193,9 +139,9 @@ public void setMethod(@javax.annotation.Nullable MethodEnum method) { * * @param key name of the property * @param value value of the property - * @return the Link1 instance itself + * @return the BrtcLink instance itself */ - public Link1 putAdditionalProperty(String key, Object value) { + public BrtcLink putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -234,11 +180,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Link1 link1 = (Link1) o; - return Objects.equals(this.href, link1.href) && - Objects.equals(this.rel, link1.rel) && - Objects.equals(this.method, link1.method)&& - Objects.equals(this.additionalProperties, link1.additionalProperties); + BrtcLink brtcLink = (BrtcLink) o; + return Objects.equals(this.href, brtcLink.href) && + Objects.equals(this.rel, brtcLink.rel) && + Objects.equals(this.method, brtcLink.method)&& + Objects.equals(this.additionalProperties, brtcLink.additionalProperties); } @Override @@ -249,7 +195,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Link1 {\n"); + sb.append("class BrtcLink {\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); sb.append(" method: ").append(toIndentedString(method)).append("\n"); @@ -285,12 +231,12 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Link1 + * @throws IOException if the JSON Element is invalid with respect to BrtcLink */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Link1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Link1 is not found in the empty JSON string", Link1.openapiRequiredFields.toString())); + if (!BrtcLink.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in BrtcLink is not found in the empty JSON string", BrtcLink.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -303,26 +249,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) && !jsonObj.get("method").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); } - // validate the optional field `method` - if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) { - MethodEnum.validateJsonElement(jsonObj.get("method")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Link1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Link1' and its subtypes + if (!BrtcLink.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BrtcLink' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Link1.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BrtcLink.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Link1 value) throws IOException { + public void write(JsonWriter out, BrtcLink value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -350,12 +292,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Link1 read(JsonReader in) throws IOException { + public BrtcLink read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Link1 instance = thisAdapter.fromJsonTree(jsonObj); + BrtcLink instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -382,18 +324,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Link1 given an JSON string + * Create an instance of BrtcLink given an JSON string * * @param jsonString JSON string - * @return An instance of Link1 - * @throws IOException if the JSON string is invalid with respect to Link1 + * @return An instance of BrtcLink + * @throws IOException if the JSON string is invalid with respect to BrtcLink */ - public static Link1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Link1.class); + public static BrtcLink fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BrtcLink.class); } /** - * Convert an instance of Link1 to an JSON string + * Convert an instance of BrtcLink to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/bandwidth/sdk/model/CreateCall.java b/src/main/java/com/bandwidth/sdk/model/CreateCall.java index 16c7af05..bca06f12 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateCall.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateCall.java @@ -227,7 +227,7 @@ public CreateCall displayName(@javax.annotation.Nullable String displayName) { } /** - * 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`. + * 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`. * @return displayName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java index a08ec312..081e24fc 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java @@ -15,9 +15,9 @@ import java.util.Objects; import java.util.Locale; +import com.bandwidth.sdk.model.BrtcError; +import com.bandwidth.sdk.model.BrtcLink; import com.bandwidth.sdk.model.CreateEndpointResponseData; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -60,7 +60,7 @@ public class CreateEndpointResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -70,17 +70,17 @@ public class CreateEndpointResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public CreateEndpointResponse() { } - public CreateEndpointResponse links(@javax.annotation.Nonnull List links) { + public CreateEndpointResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public CreateEndpointResponse addLinksItem(Link1 linksItem) { + public CreateEndpointResponse addLinksItem(BrtcLink linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -93,11 +93,11 @@ public CreateEndpointResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -121,12 +121,12 @@ public void setData(@javax.annotation.Nonnull CreateEndpointResponseData data) { } - public CreateEndpointResponse errors(@javax.annotation.Nonnull List errors) { + public CreateEndpointResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public CreateEndpointResponse addErrorsItem(Error1 errorsItem) { + public CreateEndpointResponse addErrorsItem(BrtcError errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -139,11 +139,11 @@ public CreateEndpointResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -276,7 +276,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + BrtcLink.validateJsonElement(jsonArraylinks.get(i)); }; // validate the required field `data` CreateEndpointResponseData.validateJsonElement(jsonObj.get("data")); @@ -288,7 +288,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + BrtcError.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java deleted file mode 100644 index e951cbac..00000000 --- a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java +++ /dev/null @@ -1,515 +0,0 @@ -/* - * 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. - */ - - -package com.bandwidth.sdk.model; - -import java.util.Objects; -import java.util.Locale; -import com.bandwidth.sdk.model.Device; -import com.bandwidth.sdk.model.EndpointStatusEnum; -import com.bandwidth.sdk.model.EndpointTypeEnum; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import com.bandwidth.sdk.JSON; - -/** - * CreateEndpointResponseObject - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class CreateEndpointResponseObject { - public static final String SERIALIZED_NAME_ENDPOINT_ID = "endpointId"; - @SerializedName(SERIALIZED_NAME_ENDPOINT_ID) - @javax.annotation.Nonnull - private String endpointId; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private EndpointTypeEnum type; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - @javax.annotation.Nonnull - private EndpointStatusEnum status; - - public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; - @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) - @javax.annotation.Nonnull - private OffsetDateTime creationTimestamp; - - public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; - @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) - @javax.annotation.Nonnull - private OffsetDateTime expirationTimestamp; - - public static final String SERIALIZED_NAME_TAG = "tag"; - @SerializedName(SERIALIZED_NAME_TAG) - @javax.annotation.Nullable - private String tag; - - public static final String SERIALIZED_NAME_DEVICES = "devices"; - @SerializedName(SERIALIZED_NAME_DEVICES) - @javax.annotation.Nullable - private List devices = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - @javax.annotation.Nonnull - private String token; - - public CreateEndpointResponseObject() { - } - - public CreateEndpointResponseObject endpointId(@javax.annotation.Nonnull String endpointId) { - this.endpointId = endpointId; - return this; - } - - /** - * The unique ID of the endpoint. - * @return endpointId - */ - @javax.annotation.Nonnull - public String getEndpointId() { - return endpointId; - } - - public void setEndpointId(@javax.annotation.Nonnull String endpointId) { - this.endpointId = endpointId; - } - - - public CreateEndpointResponseObject type(@javax.annotation.Nonnull EndpointTypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - public EndpointTypeEnum getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { - this.type = type; - } - - - public CreateEndpointResponseObject status(@javax.annotation.Nonnull EndpointStatusEnum status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - @javax.annotation.Nonnull - public EndpointStatusEnum getStatus() { - return status; - } - - public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { - this.status = status; - } - - - public CreateEndpointResponseObject creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { - this.creationTimestamp = creationTimestamp; - return this; - } - - /** - * The time the endpoint was created. In ISO-8601 format. - * @return creationTimestamp - */ - @javax.annotation.Nonnull - public OffsetDateTime getCreationTimestamp() { - return creationTimestamp; - } - - public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { - this.creationTimestamp = creationTimestamp; - } - - - public CreateEndpointResponseObject expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { - this.expirationTimestamp = expirationTimestamp; - return this; - } - - /** - * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. - * @return expirationTimestamp - */ - @javax.annotation.Nonnull - public OffsetDateTime getExpirationTimestamp() { - return expirationTimestamp; - } - - public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { - this.expirationTimestamp = expirationTimestamp; - } - - - public CreateEndpointResponseObject tag(@javax.annotation.Nullable String tag) { - this.tag = tag; - return this; - } - - /** - * A tag for the endpoint. - * @return tag - */ - @javax.annotation.Nullable - public String getTag() { - return tag; - } - - public void setTag(@javax.annotation.Nullable String tag) { - this.tag = tag; - } - - - public CreateEndpointResponseObject devices(@javax.annotation.Nullable List devices) { - this.devices = devices; - return this; - } - - public CreateEndpointResponseObject addDevicesItem(Device devicesItem) { - if (this.devices == null) { - this.devices = new ArrayList<>(); - } - this.devices.add(devicesItem); - return this; - } - - /** - * Get devices - * @return devices - */ - @javax.annotation.Nullable - public List getDevices() { - return devices; - } - - public void setDevices(@javax.annotation.Nullable List devices) { - this.devices = devices; - } - - - public CreateEndpointResponseObject token(@javax.annotation.Nonnull String token) { - this.token = token; - return this; - } - - /** - * The json web token specific to the endpoint. Used to authenticate the client with the media gateway. - * @return token - */ - @javax.annotation.Nonnull - public String getToken() { - return token; - } - - public void setToken(@javax.annotation.Nonnull String token) { - this.token = token; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the CreateEndpointResponseObject instance itself - */ - public CreateEndpointResponseObject putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEndpointResponseObject createEndpointResponseObject = (CreateEndpointResponseObject) o; - return Objects.equals(this.endpointId, createEndpointResponseObject.endpointId) && - Objects.equals(this.type, createEndpointResponseObject.type) && - Objects.equals(this.status, createEndpointResponseObject.status) && - Objects.equals(this.creationTimestamp, createEndpointResponseObject.creationTimestamp) && - Objects.equals(this.expirationTimestamp, createEndpointResponseObject.expirationTimestamp) && - Objects.equals(this.tag, createEndpointResponseObject.tag) && - Objects.equals(this.devices, createEndpointResponseObject.devices) && - Objects.equals(this.token, createEndpointResponseObject.token)&& - Objects.equals(this.additionalProperties, createEndpointResponseObject.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices, token, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEndpointResponseObject {\n"); - sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); - sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); - sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); - sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices", "token")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "token")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateEndpointResponseObject - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateEndpointResponseObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateEndpointResponseObject is not found in the empty JSON string", CreateEndpointResponseObject.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateEndpointResponseObject.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("endpointId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); - } - // validate the required field `type` - EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); - // validate the required field `status` - EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); - if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); - } - if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - if (jsonArraydevices != null) { - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); - } - - // validate the optional field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - Device.validateJsonElement(jsonArraydevices.get(i)); - }; - } - } - if (!jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateEndpointResponseObject.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateEndpointResponseObject' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateEndpointResponseObject.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateEndpointResponseObject value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public CreateEndpointResponseObject read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - CreateEndpointResponseObject instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CreateEndpointResponseObject given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateEndpointResponseObject - * @throws IOException if the JSON string is invalid with respect to CreateEndpointResponseObject - */ - public static CreateEndpointResponseObject fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateEndpointResponseObject.class); - } - - /** - * Convert an instance of CreateEndpointResponseObject to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java index 3cb5e4b3..e0bb35e0 100644 --- a/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java @@ -15,9 +15,9 @@ import java.util.Objects; import java.util.Locale; +import com.bandwidth.sdk.model.BrtcError; +import com.bandwidth.sdk.model.BrtcLink; import com.bandwidth.sdk.model.Endpoint; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -60,7 +60,7 @@ public class EndpointResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -70,17 +70,17 @@ public class EndpointResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public EndpointResponse() { } - public EndpointResponse links(@javax.annotation.Nonnull List links) { + public EndpointResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public EndpointResponse addLinksItem(Link1 linksItem) { + public EndpointResponse addLinksItem(BrtcLink linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -93,11 +93,11 @@ public EndpointResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -121,12 +121,12 @@ public void setData(@javax.annotation.Nonnull Endpoint data) { } - public EndpointResponse errors(@javax.annotation.Nonnull List errors) { + public EndpointResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public EndpointResponse addErrorsItem(Error1 errorsItem) { + public EndpointResponse addErrorsItem(BrtcError errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -139,11 +139,11 @@ public EndpointResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -276,7 +276,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + BrtcLink.validateJsonElement(jsonArraylinks.get(i)); }; // validate the required field `data` Endpoint.validateJsonElement(jsonObj.get("data")); @@ -288,7 +288,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + BrtcError.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java index bf27d076..17e398fe 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java @@ -132,7 +132,7 @@ public InboundCallback to(@javax.annotation.Nonnull String to) { } /** - * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. + * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. * @return to */ @javax.annotation.Nonnull @@ -189,7 +189,7 @@ public InboundCallback carrierName(@javax.annotation.Nullable String carrierName } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java index cb3a5b64..2c09896b 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. */ @JsonAdapter(InboundCallbackTypeEnum.Adapter.class) public enum InboundCallbackTypeEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java index b343746a..c6aa8069 100644 --- a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java @@ -15,9 +15,9 @@ import java.util.Objects; import java.util.Locale; +import com.bandwidth.sdk.model.BrtcError; +import com.bandwidth.sdk.model.BrtcLink; import com.bandwidth.sdk.model.Endpoints; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; import com.bandwidth.sdk.model.Page; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -61,7 +61,7 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -76,17 +76,17 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public ListEndpointsResponse() { } - public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { + public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ListEndpointsResponse addLinksItem(Link1 linksItem) { + public ListEndpointsResponse addLinksItem(BrtcLink linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -99,11 +99,11 @@ public ListEndpointsResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -154,12 +154,12 @@ public void setData(@javax.annotation.Nonnull List data) { } - public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { + public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { + public ListEndpointsResponse addErrorsItem(BrtcError errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -172,11 +172,11 @@ public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -311,7 +311,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + BrtcLink.validateJsonElement(jsonArraylinks.get(i)); }; // validate the optional field `page` if (jsonObj.get("page") != null && !jsonObj.get("page").isJsonNull()) { @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + BrtcError.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/LookupResult.java b/src/main/java/com/bandwidth/sdk/model/LookupResult.java index 131201a3..cc83ada9 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupResult.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupResult.java @@ -296,7 +296,7 @@ public LookupResult initialMessageDeliveryStatusDate(@javax.annotation.Nullable } /** - * [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. + * [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. * @return initialMessageDeliveryStatusDate */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java index 0b46bbae..4adad0ce 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java @@ -235,7 +235,7 @@ public MachineDetectionConfiguration machineSpeechEndThreshold(@javax.annotation } /** - * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. + * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. * @return machineSpeechEndThreshold */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java index 6bdc175a..0ed3c6db 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java @@ -154,7 +154,7 @@ public MessageRequest from(@javax.annotation.Nonnull String from) { } /** - * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. * @return from */ @javax.annotation.Nonnull diff --git a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java index a5749e75..a65398bb 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * 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. */ @JsonAdapter(RbmOpenUrlEnum.Adapter.class) public enum RbmOpenUrlEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java index 882b76fd..66d6526a 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. */ @JsonAdapter(RbmWebViewEnum.Adapter.class) public enum RbmWebViewEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java index f0ac27a2..d3c67ac6 100644 --- a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java @@ -237,7 +237,7 @@ public StatusCallback carrierName(@javax.annotation.Nullable String carrierName) } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/Error.java b/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionError.java similarity index 82% rename from src/main/java/com/bandwidth/sdk/model/Error.java rename to src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionError.java index 3df93d39..2e001483 100644 --- a/src/main/java/com/bandwidth/sdk/model/Error.java +++ b/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionError.java @@ -51,10 +51,10 @@ import com.bandwidth.sdk.JSON; /** - * Error + * WebhookSubscriptionError */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Error { +public class WebhookSubscriptionError { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) @javax.annotation.Nullable @@ -70,10 +70,10 @@ public class Error { @javax.annotation.Nullable private List telephoneNumbers = new ArrayList<>(); - public Error() { + public WebhookSubscriptionError() { } - public Error code(@javax.annotation.Nullable Integer code) { + public WebhookSubscriptionError code(@javax.annotation.Nullable Integer code) { this.code = code; return this; } @@ -92,7 +92,7 @@ public void setCode(@javax.annotation.Nullable Integer code) { } - public Error description(@javax.annotation.Nullable String description) { + public WebhookSubscriptionError description(@javax.annotation.Nullable String description) { this.description = description; return this; } @@ -111,12 +111,12 @@ public void setDescription(@javax.annotation.Nullable String description) { } - public Error telephoneNumbers(@javax.annotation.Nullable List telephoneNumbers) { + public WebhookSubscriptionError telephoneNumbers(@javax.annotation.Nullable List telephoneNumbers) { this.telephoneNumbers = telephoneNumbers; return this; } - public Error addTelephoneNumbersItem(TelephoneNumber telephoneNumbersItem) { + public WebhookSubscriptionError addTelephoneNumbersItem(TelephoneNumber telephoneNumbersItem) { if (this.telephoneNumbers == null) { this.telephoneNumbers = new ArrayList<>(); } @@ -150,9 +150,9 @@ public void setTelephoneNumbers(@javax.annotation.Nullable List * * @param key name of the property * @param value value of the property - * @return the Error instance itself + * @return the WebhookSubscriptionError instance itself */ - public Error putAdditionalProperty(String key, Object value) { + public WebhookSubscriptionError putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -191,11 +191,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Error error = (Error) o; - return Objects.equals(this.code, error.code) && - Objects.equals(this.description, error.description) && - Objects.equals(this.telephoneNumbers, error.telephoneNumbers)&& - Objects.equals(this.additionalProperties, error.additionalProperties); + WebhookSubscriptionError webhookSubscriptionError = (WebhookSubscriptionError) o; + return Objects.equals(this.code, webhookSubscriptionError.code) && + Objects.equals(this.description, webhookSubscriptionError.description) && + Objects.equals(this.telephoneNumbers, webhookSubscriptionError.telephoneNumbers)&& + Objects.equals(this.additionalProperties, webhookSubscriptionError.additionalProperties); } @Override @@ -206,7 +206,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Error {\n"); + sb.append("class WebhookSubscriptionError {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" telephoneNumbers: ").append(toIndentedString(telephoneNumbers)).append("\n"); @@ -242,12 +242,12 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error + * @throws IOException if the JSON Element is invalid with respect to WebhookSubscriptionError */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); + if (!WebhookSubscriptionError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in WebhookSubscriptionError is not found in the empty JSON string", WebhookSubscriptionError.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -274,16 +274,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Error.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Error' and its subtypes + if (!WebhookSubscriptionError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSubscriptionError' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Error.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSubscriptionError.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Error value) throws IOException { + public void write(JsonWriter out, WebhookSubscriptionError value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additional properties @@ -311,12 +311,12 @@ else if (entry.getValue() instanceof Character) } @Override - public Error read(JsonReader in) throws IOException { + public WebhookSubscriptionError read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); JsonObject jsonObj = jsonElement.getAsJsonObject(); // store additional fields in the deserialized instance - Error instance = thisAdapter.fromJsonTree(jsonObj); + WebhookSubscriptionError instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type @@ -343,18 +343,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } /** - * Create an instance of Error given an JSON string + * Create an instance of WebhookSubscriptionError given an JSON string * * @param jsonString JSON string - * @return An instance of Error - * @throws IOException if the JSON string is invalid with respect to Error + * @return An instance of WebhookSubscriptionError + * @throws IOException if the JSON string is invalid with respect to WebhookSubscriptionError */ - public static Error fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error.class); + public static WebhookSubscriptionError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSubscriptionError.class); } /** - * Convert an instance of Error to an JSON string + * Convert an instance of WebhookSubscriptionError to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionsListBody.java b/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionsListBody.java index b19ed25f..26b8a72f 100644 --- a/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionsListBody.java +++ b/src/main/java/com/bandwidth/sdk/model/WebhookSubscriptionsListBody.java @@ -15,9 +15,9 @@ import java.util.Objects; import java.util.Locale; -import com.bandwidth.sdk.model.Error; import com.bandwidth.sdk.model.LinksObject; import com.bandwidth.sdk.model.WebhookSubscription; +import com.bandwidth.sdk.model.WebhookSubscriptionError; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -65,7 +65,7 @@ public class WebhookSubscriptionsListBody { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nullable - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -94,12 +94,12 @@ public void setLinks(@javax.annotation.Nullable LinksObject links) { } - public WebhookSubscriptionsListBody errors(@javax.annotation.Nullable List errors) { + public WebhookSubscriptionsListBody errors(@javax.annotation.Nullable List errors) { this.errors = errors; return this; } - public WebhookSubscriptionsListBody addErrorsItem(Error errorsItem) { + public WebhookSubscriptionsListBody addErrorsItem(WebhookSubscriptionError errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -112,11 +112,11 @@ public WebhookSubscriptionsListBody addErrorsItem(Error errorsItem) { * @return errors */ @javax.annotation.Nullable - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nullable List errors) { + public void setErrors(@javax.annotation.Nullable List errors) { this.errors = errors; } @@ -282,7 +282,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error.validateJsonElement(jsonArrayerrors.get(i)); + WebhookSubscriptionError.validateJsonElement(jsonArrayerrors.get(i)); }; } } From fe1db9e31dee4a6bb161d768617fd7cd785c3a31 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 22 Apr 2026 16:13:48 -0400 Subject: [PATCH 3/4] fix tests --- .../bandwidth/sdk/smoke/EndpointsApiTest.java | 1 - .../CreateEndpointResponseObjectTest.java | 115 ------------------ .../models/CreateEndpointResponseTest.java | 8 +- .../sdk/unit/models/EndpointResponseTest.java | 8 +- .../sdk/unit/models/ErrorResponseTest.java | 16 +-- .../models/ListEndpointsResponseTest.java | 8 +- ...java => WebhookSubscriptionErrorTest.java} | 14 +-- .../WebhookSubscriptionsListBodyTest.java | 4 +- 8 files changed, 29 insertions(+), 145 deletions(-) delete mode 100644 src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java rename src/test/java/com/bandwidth/sdk/unit/models/{ErrorTest.java => WebhookSubscriptionErrorTest.java} (77%) diff --git a/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java index 85dc851e..1f2582f3 100644 --- a/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java +++ b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java @@ -13,7 +13,6 @@ import com.bandwidth.sdk.model.EndpointDirectionEnum; import com.bandwidth.sdk.model.EndpointTypeEnum; import com.bandwidth.sdk.model.EndpointStatusEnum; -import com.bandwidth.sdk.model.Link; import com.bandwidth.sdk.model.ListEndpointsResponse; import com.bandwidth.sdk.model.Page; import org.junit.jupiter.api.MethodOrderer; diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java deleted file mode 100644 index d3be488f..00000000 --- a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ - -package com.bandwidth.sdk.unit.models; - -import org.junit.jupiter.api.Test; - -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; -import com.bandwidth.sdk.model.CreateEndpointResponseObject; -import com.bandwidth.sdk.model.EndpointTypeEnum; -import com.bandwidth.sdk.model.EndpointStatusEnum; -import com.bandwidth.sdk.model.Device; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.CoreMatchers.instanceOf; - -/** - * Model tests for CreateEndpointResponseObject - */ -public class CreateEndpointResponseObjectTest { - private final CreateEndpointResponseObject model = new CreateEndpointResponseObject() - .endpointId("endpointId") - .type(EndpointTypeEnum.WEBRTC) - .status(EndpointStatusEnum.CONNECTED) - .creationTimestamp(OffsetDateTime.now()) - .expirationTimestamp(OffsetDateTime.now()) - .tag("tag") - .devices(new ArrayList(Arrays.asList(new Device()))) - .token("token"); - - /** - * Model tests for CreateEndpointResponseObject - */ - @Test - public void testCreateEndpointResponseObject() { - assertThat(model, instanceOf(CreateEndpointResponseObject.class)); - } - - /** - * Test the property 'endpointId' - */ - @Test - public void endpointIdTest() { - assertThat(model.getEndpointId(), instanceOf(String.class)); - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); - } - - /** - * Test the property 'creationTimestamp' - */ - @Test - public void creationTimestampTest() { - assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); - } - - /** - * Test the property 'expirationTimestamp' - */ - @Test - public void expirationTimestampTest() { - assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); - } - - /** - * Test the property 'tag' - */ - @Test - public void tagTest() { - assertThat(model.getTag(), instanceOf(String.class)); - } - - /** - * Test the property 'devices' - */ - @Test - public void devicesTest() { - assertThat(model.getDevices(), instanceOf(List.class)); - } - - /** - * Test the property 'token' - */ - @Test - public void tokenTest() { - assertThat(model.getToken(), instanceOf(String.class)); - } - -} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java index c6f6c036..d6030a48 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java @@ -19,8 +19,8 @@ import java.util.ArrayList; import com.bandwidth.sdk.model.CreateEndpointResponse; import com.bandwidth.sdk.model.CreateEndpointResponseData; -import com.bandwidth.sdk.model.Link; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.BrtcLink; +import com.bandwidth.sdk.model.BrtcError; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.instanceOf; @@ -31,9 +31,9 @@ */ public class CreateEndpointResponseTest { private final CreateEndpointResponse model = new CreateEndpointResponse() - .links(new ArrayList(Arrays.asList(new Link()))) + .links(new ArrayList(Arrays.asList(new BrtcLink()))) .data(new CreateEndpointResponseData()) - .errors(new ArrayList(Arrays.asList(new Error()))); + .errors(new ArrayList(Arrays.asList(new BrtcError()))); /** * Model tests for CreateEndpointResponse diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java index 99735e0d..93eb810b 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java @@ -19,8 +19,8 @@ import java.util.ArrayList; import com.bandwidth.sdk.model.EndpointResponse; import com.bandwidth.sdk.model.Endpoint; -import com.bandwidth.sdk.model.Link; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.BrtcLink; +import com.bandwidth.sdk.model.BrtcError; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.instanceOf; @@ -31,9 +31,9 @@ */ public class EndpointResponseTest { private final EndpointResponse model = new EndpointResponse() - .links(new ArrayList(Arrays.asList(new Link()))) + .links(new ArrayList(Arrays.asList(new BrtcLink()))) .data(new Endpoint()) - .errors(new ArrayList(Arrays.asList(new Error()))); + .errors(new ArrayList(Arrays.asList(new BrtcError()))); /** * Model tests for EndpointResponse diff --git a/src/test/java/com/bandwidth/sdk/unit/models/ErrorResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/ErrorResponseTest.java index 2cd932f1..1e49dbd0 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/ErrorResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/ErrorResponseTest.java @@ -16,9 +16,9 @@ import java.util.ArrayList; import java.util.List; -import com.bandwidth.sdk.model.ErrorResponse; -import com.bandwidth.sdk.model.Link; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.BrtcErrorResponse; +import com.bandwidth.sdk.model.BrtcLink; +import com.bandwidth.sdk.model.BrtcError; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.instanceOf; @@ -27,20 +27,20 @@ import static org.hamcrest.CoreMatchers.equalTo; /** - * Model tests for ErrorResponse + * Model tests for BrtcErrorResponse */ public class ErrorResponseTest { - private final ErrorResponse model = new ErrorResponse() - .links(new ArrayList()) + private final BrtcErrorResponse model = new BrtcErrorResponse() + .links(new ArrayList()) .data(null) - .errors(new ArrayList()); + .errors(new ArrayList()); /** * Model tests for ErrorResponse */ @Test public void testErrorResponse() { - assertThat(model, instanceOf(ErrorResponse.class)); + assertThat(model, instanceOf(BrtcErrorResponse.class)); } /** diff --git a/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java index 49ead100..59135fe1 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java @@ -19,8 +19,8 @@ import java.util.ArrayList; import com.bandwidth.sdk.model.ListEndpointsResponse; import com.bandwidth.sdk.model.Endpoints; -import com.bandwidth.sdk.model.Link; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.BrtcLink; +import com.bandwidth.sdk.model.BrtcError; import com.bandwidth.sdk.model.Page; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,10 +32,10 @@ */ public class ListEndpointsResponseTest { private final ListEndpointsResponse model = new ListEndpointsResponse() - .links(new ArrayList(Arrays.asList(new Link()))) + .links(new ArrayList(Arrays.asList(new BrtcLink()))) .page(new Page()) .data(new ArrayList(Arrays.asList(new Endpoints()))) - .errors(new ArrayList(Arrays.asList(new Error()))); + .errors(new ArrayList(Arrays.asList(new BrtcError()))); /** * Model tests for ListEndpointsResponse diff --git a/src/test/java/com/bandwidth/sdk/unit/models/ErrorTest.java b/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionErrorTest.java similarity index 77% rename from src/test/java/com/bandwidth/sdk/unit/models/ErrorTest.java rename to src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionErrorTest.java index dcaf5ec6..cbda91ec 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/ErrorTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionErrorTest.java @@ -17,27 +17,27 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.WebhookSubscriptionError; import com.bandwidth.sdk.model.TelephoneNumber; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.instanceOf; /** - * Model tests for Error + * Model tests for WebhookSubscriptionError */ -public class ErrorTest { - private final Error model = new Error() +public class WebhookSubscriptionErrorTest { + private final WebhookSubscriptionError model = new WebhookSubscriptionError() .code(1234) .description("description") .telephoneNumbers(new ArrayList(Arrays.asList(new TelephoneNumber()))); /** - * Model tests for Error + * Model tests for WebhookSubscriptionError */ @Test - public void testError() { - assertThat(model, instanceOf(Error.class)); + public void testWebhookSubscriptionError() { + assertThat(model, instanceOf(WebhookSubscriptionError.class)); } /** diff --git a/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionsListBodyTest.java b/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionsListBodyTest.java index a80baef6..4edf48dd 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionsListBodyTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/WebhookSubscriptionsListBodyTest.java @@ -18,7 +18,7 @@ import java.util.Arrays; import java.util.ArrayList; import com.bandwidth.sdk.model.WebhookSubscriptionsListBody; -import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.WebhookSubscriptionError; import com.bandwidth.sdk.model.LinksObject; import com.bandwidth.sdk.model.WebhookSubscription; @@ -31,7 +31,7 @@ public class WebhookSubscriptionsListBodyTest { private final WebhookSubscriptionsListBody model = new WebhookSubscriptionsListBody() .links(new LinksObject()) - .errors(new ArrayList(Arrays.asList(new Error()))) + .errors(new ArrayList(Arrays.asList(new WebhookSubscriptionError()))) .data(new ArrayList(Arrays.asList(new WebhookSubscription()))); /** From 7605d1b14ff0188b8001a006fe4ae22207c85442 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Wed, 22 Apr 2026 16:37:02 -0400 Subject: [PATCH 4/4] unit tests for new models --- .../unit/models/BrtcErrorResponseTest.java | 73 ++++++++++++++++ .../sdk/unit/models/BrtcErrorSourceTest.java | 72 ++++++++++++++++ .../sdk/unit/models/BrtcErrorTest.java | 83 +++++++++++++++++++ .../sdk/unit/models/BrtcLinkTest.java | 63 ++++++++++++++ 4 files changed, 291 insertions(+) create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorResponseTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorSourceTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/BrtcLinkTest.java diff --git a/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorResponseTest.java new file mode 100644 index 00000000..f1155f1e --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorResponseTest.java @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.BrtcErrorResponse; +import com.bandwidth.sdk.model.BrtcLink; +import com.bandwidth.sdk.model.BrtcError; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; + +/** + * Model tests for BrtcErrorResponse + */ +public class BrtcErrorResponseTest { + private final BrtcErrorResponse model = new BrtcErrorResponse() + .links(new ArrayList(Arrays.asList(new BrtcLink()))) + .data(null) + .errors(new ArrayList(Arrays.asList(new BrtcError()))); + + /** + * Model tests for BrtcErrorResponse + */ + @Test + public void testBrtcErrorResponse() { + assertThat(model, instanceOf(BrtcErrorResponse.class)); + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + assertThat(model.getLinks(), instanceOf(List.class)); + assertThat(model.getLinks().size(), equalTo(1)); + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + assertThat(model.getData(), is(nullValue())); + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + assertThat(model.getErrors(), instanceOf(List.class)); + assertThat(model.getErrors().size(), equalTo(1)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorSourceTest.java b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorSourceTest.java new file mode 100644 index 00000000..27f92f9a --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorSourceTest.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.BrtcErrorSource; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; + +/** + * Model tests for BrtcErrorSource + */ +public class BrtcErrorSourceTest { + private final BrtcErrorSource model = new BrtcErrorSource() + .parameter("parameter") + .field("field") + .header("header") + .reference("reference"); + + /** + * Model tests for BrtcErrorSource + */ + @Test + public void testBrtcErrorSource() { + assertThat(model, instanceOf(BrtcErrorSource.class)); + } + + /** + * Test the property 'parameter' + */ + @Test + public void parameterTest() { + assertThat(model.getParameter(), instanceOf(String.class)); + } + + /** + * Test the property 'field' + */ + @Test + public void fieldTest() { + assertThat(model.getField(), instanceOf(String.class)); + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + assertThat(model.getHeader(), instanceOf(String.class)); + } + + /** + * Test the property 'reference' + */ + @Test + public void referenceTest() { + assertThat(model.getReference(), instanceOf(String.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorTest.java b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorTest.java new file mode 100644 index 00000000..6dad651f --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/BrtcErrorTest.java @@ -0,0 +1,83 @@ +/* + * 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. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.util.UUID; +import com.bandwidth.sdk.model.BrtcError; +import com.bandwidth.sdk.model.BrtcErrorSource; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for BrtcError + */ +public class BrtcErrorTest { + private final BrtcError model = new BrtcError() + .id(UUID.fromString("a3cc5a81-9c97-4e22-b2a4-95a86d684bc2")) + .type("type") + .description("description") + .code("code") + .source(new BrtcErrorSource()); + + /** + * Model tests for BrtcError + */ + @Test + public void testBrtcError() { + assertThat(model, instanceOf(BrtcError.class)); + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + assertThat(model.getId(), instanceOf(UUID.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(String.class)); + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + assertThat(model.getDescription(), instanceOf(String.class)); + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + assertThat(model.getCode(), instanceOf(String.class)); + } + + /** + * Test the property 'source' + */ + @Test + public void sourceTest() { + assertThat(model.getSource(), instanceOf(BrtcErrorSource.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/BrtcLinkTest.java b/src/test/java/com/bandwidth/sdk/unit/models/BrtcLinkTest.java new file mode 100644 index 00000000..a1dec6cd --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/BrtcLinkTest.java @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.BrtcLink; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for BrtcLink + */ +public class BrtcLinkTest { + private final BrtcLink model = new BrtcLink() + .href("href") + .rel("rel") + .method("method"); + + /** + * Model tests for BrtcLink + */ + @Test + public void testBrtcLink() { + assertThat(model, instanceOf(BrtcLink.class)); + } + + /** + * Test the property 'href' + */ + @Test + public void hrefTest() { + assertThat(model.getHref(), instanceOf(String.class)); + } + + /** + * Test the property 'rel' + */ + @Test + public void relTest() { + assertThat(model.getRel(), instanceOf(String.class)); + } + + /** + * Test the property 'method' + */ + @Test + public void methodTest() { + assertThat(model.getMethod(), instanceOf(String.class)); + } + +}