This Inbound Message Webhook is an envelope containing a received (MO) message to your message-enabled Bandwidth telephone number. The payload type will always indicate "message-received".
-
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
This Outbound Message Webhook is an envelope containing status information regarding a message sent (MT) from your message-enabled Bandwidth telephone number. The payload type will be one of "message-sending", "message-delivered", or "message-failed".
+ $ref: '#/components/schemas/statusCallback'
+ description: |-
+
This Outbound Message Webhook is an envelope containing status information regarding a message sent (MT)
+ from your message-enabled Bandwidth telephone number.
+
The payload type will be one of message-sending, message-delivered, message-failed or message-read.
+
Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.
required: true
responses:
"200":
description: OK
- multiChannelMessageCallback:
- '{multiChannelMessageCallbackUrl}':
- post:
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/multiChannelCallbackData'
- description: Status Callback Payload
- required: true
- responses:
- "204":
- description: No Content
+ "202":
+ description: Accepted
tfVerificationStatus:
your_url.com/webhookService:
post:
@@ -6880,6 +7051,12 @@ components:
schema:
$ref: '#/components/schemas/messagingRequestError'
description: Not Found
+ messagingMethodNotAllowedError:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/messagingRequestError'
+ description: Method Not Allowed
messagingInvalidMediaTypeError:
content:
application/json:
@@ -6898,6 +7075,117 @@ components:
schema:
$ref: '#/components/schemas/messagingRequestError'
description: Internal Server Error
+ multiChannelBadRequestError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: request-validation
+ description: "The 'channelList[0].from' field must contain exactly one\
+ \ telephone number"
+ source:
+ field: "channelList[0].from"
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Bad Request
+ multiChannelNotAcceptableError:
+ description: Not Acceptable
+ multiChannelUnauthorizedError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: unauthorized
+ description: Authentication Failed
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Unauthorized
+ multiChannelForbiddenError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: forbidden
+ description: Access Denied
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Forbidden
+ multiChannelNotFoundError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: forbidden
+ description: Resource not found.
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Not Found
+ multiChannelMethodNotAllowedError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: method-not-allowed
+ description: Method 'PUT' not supported for this resource.
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Method Not Allowed
+ multiChannelInvalidMediaTypeError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: unsupported-content-type
+ description: Content-Type 'application/xml;charset=UTF-8' is not supported.
+ Please use 'application/json'
+ source:
+ header: Content-Type
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Unsupported Media Type
+ multiChannelTooManyRequestsError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: rate-limit-exceeded
+ description: You have exceeded your rate limit for this endpoint. Please
+ retry later.
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Too Many Requests
+ multiChannelInternalServerError:
+ content:
+ application/json:
+ example:
+ links: []
+ data: null
+ errors:
+ - type: internal-server-error
+ description: Internal server error. No further information available
+ source: {}
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ description: Internal Server Error
createCallResponse:
content:
application/json:
@@ -7295,6 +7583,8 @@ components:
schema:
$ref: '#/components/schemas/tfvError'
description: Bad Request
+ noContentResponse:
+ description: No Content
tfvPostBadRequestResponse:
content:
application/json:
@@ -7376,20 +7666,10 @@ components:
with in the Bandwidth Phone Number Dashboard.
example: 93de2206-9669-4e07-948d-329f4b722ee2
type: string
- callbackTypeEnum:
- description: |
- Indicates the type of the callback:
- - `message-received` for inbound callbacks.
- - One of `message-sending`, `message-delivered`, `message-failed` for status callbacks.
- enum:
- - message-received
- - message-sending
- - message-delivered
- - message-failed
- example: message-delivered
- type: string
priorityEnum:
- description: The priority specified by the user.
+ description: "Specifies the message's sending priority with respect to other\
+ \ messages in your account. For best results and optimal throughput, reserve\
+ \ the 'high' priority setting for critical messages only."
enum:
- default
- high
@@ -7546,7 +7826,8 @@ components:
messageType:
$ref: '#/components/schemas/messageTypeEnum'
segmentCount:
- description: The number of segments the message was sent as.
+ description: The number of segments the user's message is broken into before
+ sending over carrier networks.
example: 1
type: integer
errorCode:
@@ -7677,20 +7958,17 @@ components:
type: string
title: Media
type: object
+ segmentCount:
+ description: The number of segments the user's message is broken into before
+ sending over carrier networks.
+ example: 1
+ type: integer
tag:
description: A custom string that will be included in callback events of the
message. Max 1024 characters.
example: custom string
title: Tag
type: string
- deferredResult:
- properties:
- result:
- type: object
- setOrExpired:
- type: boolean
- title: DeferredResult
- type: object
expiration:
description: "A string with the date/time value that the message will automatically\
\ expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z\
@@ -7698,13 +7976,19 @@ components:
example: 2021-02-01T11:29:18-05:00
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."
+ example: AT&T
+ type: string
message:
example:
owner: "+15554443333"
media:
- https://dev.bandwidth.com/images/bandwidth-logo.png
priority: default
- segmentCount: 2
+ segmentCount: 1
from: "+15553332222"
expiration: 2021-02-01T11:29:18-05:00
id: 1589228074636lm4k2je7j7jklbn2
@@ -7712,7 +7996,7 @@ components:
to:
- "+15552223333"
text: Hello world
- tag: custom tag
+ tag: custom string
applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
direction: in
properties:
@@ -7725,7 +8009,8 @@ components:
example: "+15554443333"
type: string
applicationId:
- description: The application ID associated with the message.
+ description: The ID of the Application your from number or senderId is associated
+ with in the Bandwidth Phone Number Dashboard.
example: 93de2206-9669-4e07-948d-329f4b722ee2
type: string
time:
@@ -7734,9 +8019,9 @@ components:
format: date-time
type: string
segmentCount:
- description: The number of segments the original message from the user is
- broken into before sending over to carrier networks.
- example: 2
+ description: The number of segments the user's message is broken into before
+ sending over carrier networks.
+ example: 1
type: integer
direction:
$ref: '#/components/schemas/messageDirectionEnum'
@@ -7768,8 +8053,10 @@ components:
example: Hello world
type: string
tag:
- description: The custom string set by the user.
- example: custom tag
+ description: A custom string that will be included in callback events of
+ the message. Max 1024 characters.
+ example: custom string
+ title: Tag
type: string
priority:
$ref: '#/components/schemas/priorityEnum'
@@ -7785,8 +8072,8 @@ components:
messageRequest:
properties:
applicationId:
- description: The ID of the Application your from number is associated with
- in the Bandwidth Phone Number Dashboard.
+ description: The ID of the Application your from number or senderId is associated
+ with in the Bandwidth Phone Number Dashboard.
example: 93de2206-9669-4e07-948d-329f4b722ee2
type: string
to:
@@ -7867,51 +8154,233 @@ components:
createMultiChannelMessageResponse:
example:
data:
- channel: RBM
+ channelList:
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
messageId: 1589228074636lm4k2je7j7jklbn2
- from: BandwidthRBM
+ expiration: 2021-02-01T11:29:18-05:00
time: 2025-01-01T18:20:16Z
- to: "+15552223333"
+ to:
+ - "+15554443333"
tag: custom string
- applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
- status: DELIVERED
- direction: OUTBOUND
+ priority: default
+ direction: in
+ links: []
+ errors: []
+ properties:
links:
- - rel: rel
- href: href
- - rel: rel
- href: href
+ example: []
+ items:
+ $ref: '#/components/schemas/link'
+ type: array
+ data:
+ $ref: '#/components/schemas/multiChannelMessageResponseData'
+ errors:
+ example: []
+ items:
+ $ref: '#/components/schemas/errorObject'
+ type: array
+ type: object
+ multiChannelError:
+ example:
+ data: "{}"
+ links: []
errors:
- - code: code
- message: message
- - code: code
- message: message
+ - description: description
+ source:
+ reference: reference
+ field: field
+ parameter: parameter
+ header: header
+ type: type
+ - description: description
+ source:
+ reference: reference
+ field: field
+ parameter: parameter
+ header: header
+ type: type
properties:
links:
+ example: []
items:
$ref: '#/components/schemas/link'
type: array
data:
- $ref: '#/components/schemas/multiChannelMessageData'
+ nullable: true
+ type: object
+ example: null
errors:
items:
$ref: '#/components/schemas/errorObject'
type: array
type: object
- multiChannelMessageChannelEnum:
- description: The channel of the multi-channel message.
- enum:
- - RBM
- - SMS
+ link:
+ properties:
+ rel:
+ type: string
+ href:
+ type: string
+ type: object
+ errorObject:
+ example:
+ description: description
+ source:
+ reference: reference
+ field: field
+ parameter: parameter
+ header: header
+ type: type
+ properties:
+ type:
+ description: A concise summary of the error used for categorization.
+ type: string
+ description:
+ description: A detailed explanation of the error.
+ type: string
+ source:
+ $ref: '#/components/schemas/errorSource'
+ required:
+ - description
+ - source
+ - type
+ type: object
+ errorSource:
+ description: "Specifies relevant sources of the error, if any."
+ example:
+ reference: reference
+ field: field
+ parameter: parameter
+ header: header
+ properties:
+ parameter:
+ description: The relevant URI query parameter causing the error
+ type: string
+ field:
+ description: The request body field that led to the error
+ type: string
+ header:
+ description: The header field that contributed to the error
+ type: string
+ reference:
+ description: A resource ID or path linked to the error
+ type: string
+ title: Error Source
+ type: object
+ multiChannelMessageChannelEnum:
+ description: The channel of the multi-channel message.
+ enum:
+ - RBM
+ - SMS
- MMS
example: RBM
type: string
- multiChannelMessageDirectionEnum:
- enum:
- - INBOUND
- - OUTBOUND
- example: OUTBOUND
- type: string
multiChannelSenderId:
description: The sender ID of the message. This could be an alphanumeric sender
ID.
@@ -7921,7 +8390,38 @@ components:
description: The phone number the message should be sent to in E164 format.
example: "+15552223333"
type: string
+ multiChannelDestinations:
+ description: "The destination phone number(s) of the message, in E164 format."
+ example:
+ - "+15554443333"
+ items:
+ type: string
+ type: array
+ uniqueItems: true
rbmMessageContentText:
+ example:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
properties:
text:
description: The text associated with the message. Must be 3270 characters
@@ -7966,6 +8466,21 @@ components:
- fileUrl
title: RBM Rich Media File
type: object
+ mmsMessageContentFile:
+ properties:
+ fileUrl:
+ description: |-
+ The URL of a media attachment.
+
+ For MMS, the API limits file size to 3.5MB. Specific carriers and channels may have a smaller limit that could cause a large file to fail, see [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) for more details.
+ example: https://dev.bandwidth.com/images/bandwidth-logo.png
+ format: uri
+ maxLength: 1000
+ type: string
+ required:
+ - fileUrl
+ title: MMS Media File
+ type: object
rbmMessageMedia:
properties:
media:
@@ -8083,16 +8598,8 @@ components:
maxLength: 2048
type: string
media:
- description: |-
- A list of URLs to include as media attachments as part of the message.
- Each URL can be at most 4096 characters.
- example:
- - https://dev.bandwidth.com/images/bandwidth-logo.png
- - https://dev.bandwidth.com/images/github_logo.png
items:
- format: uri
- maxLength: 4096
- type: string
+ $ref: '#/components/schemas/mmsMessageContentFile'
type: array
title: MMS Message
type: object
@@ -8117,7 +8624,7 @@ components:
maxLength: 25
title: Text
type: string
- rbmActionPostBackData:
+ rbmActionPostbackData:
description: Base64 payload the customer receives when the reply is clicked.
example: !!binary |-
U0dWc2JHOGdkMjl5YkdRPQ==
@@ -8126,6 +8633,11 @@ components:
title: Post Back Data
type: string
rbmActionBase:
+ example:
+ postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
properties:
type:
$ref: '#/components/schemas/rbmActionTypeEnum'
@@ -8135,7 +8647,7 @@ components:
maxLength: 25
title: Text
type: string
- postBackData:
+ postbackData:
description: Base64 payload the customer receives when the reply is clicked.
example: !!binary |-
U0dWc2JHOGdkMjl5YkdRPQ==
@@ -8144,7 +8656,7 @@ components:
title: Post Back Data
type: string
required:
- - postBackData
+ - postbackData
- text
- type
type: object
@@ -8250,14 +8762,6 @@ components:
- $ref: '#/components/schemas/rbmActionViewLocation'
- $ref: '#/components/schemas/multiChannelActionCalendarEvent'
- $ref: '#/components/schemas/rbmActionOpenUrl'
- multiChannelStatusEnum:
- enum:
- - QUEUED
- - SENDING
- - DELIVERED
- - FAILED
- example: DELIVERED
- type: string
multiChannelChannelListObject:
properties:
from:
@@ -8314,155 +8818,304 @@ components:
- channelList
- to
type: object
- multiChannelMessageCallbackData:
- properties:
- messageId:
- description: The ID of the message.
- example: 1589228074636lm4k2je7j7jklbn2
- type: string
- status:
- $ref: '#/components/schemas/multiChannelStatusEnum'
- direction:
- $ref: '#/components/schemas/multiChannelMessageDirectionEnum'
- from:
- description: The sender ID of the message. This could be an alphanumeric
- sender ID.
- example: BandwidthRBM
- type: string
- to:
- description: The phone number the message should be sent to in E164 format.
- example: "+15552223333"
- type: string
- applicationId:
- description: The ID of the Application your from number or senderId is associated
- with in the Bandwidth Phone Number Dashboard.
- example: 93de2206-9669-4e07-948d-329f4b722ee2
- type: string
- channel:
- $ref: '#/components/schemas/multiChannelMessageChannelEnum'
- tag:
- description: A custom string that will be included in callback events of
- the message. Max 1024 characters.
- example: custom string
- title: Tag
- type: string
- type: object
- multiChannelMessageData:
+ multiChannelMessageResponseData:
+ description: The data returned in a multichannel message response.
example:
- channel: RBM
+ channelList:
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
+ - owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
messageId: 1589228074636lm4k2je7j7jklbn2
- from: BandwidthRBM
+ expiration: 2021-02-01T11:29:18-05:00
time: 2025-01-01T18:20:16Z
- to: "+15552223333"
+ to:
+ - "+15554443333"
tag: custom string
- applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
- status: DELIVERED
- direction: OUTBOUND
+ priority: default
+ direction: in
properties:
messageId:
description: The ID of the message.
example: 1589228074636lm4k2je7j7jklbn2
type: string
- status:
- $ref: '#/components/schemas/multiChannelStatusEnum'
time:
description: The time the message was received by the Bandwidth API.
example: 2025-01-01T18:20:16Z
format: date-time
type: string
direction:
- $ref: '#/components/schemas/multiChannelMessageDirectionEnum'
- from:
- description: The sender ID of the message. This could be an alphanumeric
- sender ID.
- example: BandwidthRBM
- type: string
+ $ref: '#/components/schemas/messageDirectionEnum'
to:
- description: The phone number the message should be sent to in E164 format.
- example: "+15552223333"
- type: string
- applicationId:
- description: The ID of the Application your from number or senderId is associated
- with in the Bandwidth Phone Number Dashboard.
- example: 93de2206-9669-4e07-948d-329f4b722ee2
- type: string
- channel:
- $ref: '#/components/schemas/multiChannelMessageChannelEnum'
+ description: "The destination phone number(s) of the message, in E164 format."
+ example:
+ - "+15554443333"
+ items:
+ type: string
+ type: array
+ uniqueItems: true
+ channelList:
+ description: "A list of message bodies. The messages will be attempted in\
+ \ the order they are listed. Once a message sends successfully, the others\
+ \ will be ignored."
+ items:
+ $ref: '#/components/schemas/multiChannelMessageResponseData_channelList_inner'
+ maxItems: 4
+ type: array
tag:
description: A custom string that will be included in callback events of
the message. Max 1024 characters.
example: custom string
title: Tag
type: string
- type: object
- multiChannelCallbackData:
- properties:
- time:
- description: The time of the callback event.
- example: 2025-01-01T18:20:16Z
+ priority:
+ $ref: '#/components/schemas/priorityEnum'
+ expiration:
+ description: "A string with the date/time value that the message will automatically\
+ \ expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z\
+ \ or 2021-03-13T20:59:26-05:00. Must be a date-time in the future."
+ example: 2021-02-01T11:29:18-05:00
format: date-time
type: string
- type:
- $ref: '#/components/schemas/multiChannelStatusEnum'
- to:
- description: The phone number the message should be sent to in E164 format.
- example: "+15552223333"
- type: string
- description:
- example: Incoming message received
+ required:
+ - channelList
+ - direction
+ - messageId
+ - time
+ - to
+ type: object
+ multiChannelMessageContent:
+ description: The structure of the content field of a multichannel message.
+ properties:
+ text:
type: string
- message:
- $ref: '#/components/schemas/multiChannelMessageCallbackData'
+ media:
+ $ref: '#/components/schemas/rbmMessageContentFile'
type: object
- link:
- example:
- rel: rel
- href: href
+ rbmSuggestionResponse:
properties:
- rel:
+ text:
+ description: The text associated with the suggestion response.
+ example: "Yes, I would like to proceed"
type: string
- href:
+ postbackData:
+ description: Base64 payload the customer receives when the reply is clicked.
+ example: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ format: byte
+ maxLength: 2048
+ title: Post Back Data
type: string
type: object
- errorObject:
- example:
- code: code
- message: message
+ rbmLocationResponse:
properties:
- code:
+ latitude:
+ description: The latitude of the client's location.
+ example: "37.7749"
+ format: double
type: string
- message:
+ longitude:
+ description: The longitude of the client's location.
+ example: "-122.4194"
+ format: double
type: string
type: object
- messageCallback:
- description: Message Callback Schema
+ callback:
+ description: |-
+ Callbacks are divided into two types based on direction of the related message:
+ - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message.
+ - `inboundCallback` indicates an inbound MO message or a multichannel message client's response to a suggestion or location request.
+ discriminator:
+ mapping:
+ message-sent: '#/components/schemas/statusCallback'
+ message-delivered: '#/components/schemas/statusCallback'
+ message-failed: '#/components/schemas/statusCallback'
+ message-read: '#/components/schemas/statusCallback'
+ message-received: '#/components/schemas/inboundCallback'
+ request-location-response: '#/components/schemas/inboundCallback'
+ suggestion-response: '#/components/schemas/inboundCallback'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/statusCallback'
+ - $ref: '#/components/schemas/inboundCallback'
+ type: object
+ statusCallback:
+ description: Represents a status callback for an outbound MT SMS or MMS or RBM
+ message.
properties:
time:
example: 2024-12-02T20:15:57.278Z
format: date-time
type: string
+ eventTime:
+ description: "Represents the time at which the message was read, for `message-read`\
+ \ callbacks."
+ example: 2024-12-02T20:15:58.278Z
+ format: date-time
+ type: string
type:
- $ref: '#/components/schemas/callbackTypeEnum'
+ $ref: '#/components/schemas/statusCallbackTypeEnum'
to:
+ description: |-
+ The destination phone number the message was sent to.
+ For status callbacks, this the the Bandwidth user's client phone number.
example: "+15552223333"
type: string
description:
description: A detailed description of the event described by the callback.
- example: rejected-unallocated-from-number
+ example: Message delivered to carrier.
type: string
message:
- $ref: '#/components/schemas/messageCallbackMessage'
+ $ref: '#/components/schemas/statusCallbackMessage'
errorCode:
description: "Optional error code, applicable only when type is `message-failed`."
example: 4405
- nullable: true
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 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:
+ - description
+ - message
+ - time
+ - to
+ - type
+ type: object
+ inboundCallback:
+ description: Represents an inbound callback.
+ properties:
+ time:
+ example: 2024-12-02T20:15:57.278Z
+ format: date-time
+ type: string
+ 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"
+ example: "+15552223333"
+ type: string
+ description:
+ description: A detailed description of the event described by the callback.
+ example: Incoming message received
+ type: string
+ 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."
example: AT&T
- nullable: true
type: string
required:
- description
@@ -8471,16 +9124,49 @@ components:
- to
- type
type: object
- messageCallbackMessage:
- description: Message payload schema within a MessageCallback
+ statusCallbackTypeEnum:
+ description: |-
+ The possible status callbacks when sending an MT SMS or MMS or RBM message:
+ - `message-sending` indicates that Bandwidth is sending the message to the upstream provider.
+ - `message-delivered` indicates that the message was successfully sent.
+ - `message-failed` indicates that the message could not be sent to the intended recipient.
+ - `message-read` indicates that the RBM message was read by the recipient.
+ enum:
+ - message-sending
+ - message-delivered
+ - message-failed
+ - message-read
+ 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."
+ enum:
+ - message-received
+ - request-location-response
+ - suggestion-response
+ example: message-received
+ type: string
+ statusCallbackMessage:
+ description: Message payload schema within a callback
properties:
id:
+ description: A unique identifier of the message.
example: 1661365814859loidf7mcwd4qacn7
type: string
owner:
+ description: The Bandwidth phone number or alphanumeric identifier associated
+ with the message.
example: "+15553332222"
type: string
applicationId:
+ description: The ID of the Application your from number or senderId is associated
+ with in the Bandwidth Phone Number Dashboard.
example: 93de2206-9669-4e07-948d-329f4b722ee2
type: string
time:
@@ -8488,11 +9174,14 @@ components:
format: date-time
type: string
segmentCount:
+ description: The number of segments the user's message is broken into before
+ sending over carrier networks.
example: 1
type: integer
direction:
$ref: '#/components/schemas/messageDirectionEnum'
to:
+ description: The phone number recipients of the message.
example:
- "+15552223333"
items:
@@ -8500,26 +9189,32 @@ components:
type: array
uniqueItems: true
from:
+ description: The Bandwidth phone number or alphanumeric identifier the message
+ was sent from.
example: "+15553332222"
type: string
text:
example: Hello world
type: string
tag:
+ description: A custom string that will be included in callback events of
+ the message. Max 1024 characters.
example: custom string
+ title: Tag
type: string
media:
- description: "Optional media, applicable only for mms"
+ description: "Optional media, not applicable for sms"
example:
- https://dev.bandwidth.com/images/bandwidth-logo.png
- https://dev.bandwidth.com/images/github_logo.png
items:
format: uri
type: string
- nullable: true
type: array
priority:
$ref: '#/components/schemas/priorityEnum'
+ channel:
+ $ref: '#/components/schemas/multiChannelMessageChannelEnum'
required:
- applicationId
- direction
@@ -8527,10 +9222,29 @@ components:
- id
- owner
- segmentCount
- - text
- time
- to
type: object
+ inboundCallbackMessage:
+ allOf:
+ - $ref: '#/components/schemas/statusCallbackMessage'
+ - properties:
+ content:
+ $ref: '#/components/schemas/multiChannelMessageContent'
+ suggestionResponse:
+ $ref: '#/components/schemas/rbmSuggestionResponse'
+ locationResponse:
+ $ref: '#/components/schemas/rbmLocationResponse'
+ type: object
+ required:
+ - applicationId
+ - direction
+ - from
+ - id
+ - owner
+ - segmentCount
+ - time
+ - to
callbackMethodEnum:
default: POST
description: The HTTP method to use to deliver the callback. GET or POST. Default
@@ -13234,6 +13948,45 @@ components:
- $ref: '#/components/schemas/rbmMessageContentRichCard'
- $ref: '#/components/schemas/smsMessageContent'
- $ref: '#/components/schemas/mmsMessageContent'
+ multiChannelMessageResponseData_channelList_inner:
+ allOf:
+ - $ref: '#/components/schemas/multiChannelChannelListObject'
+ - properties:
+ owner:
+ description: The Bandwidth senderId associated with the message. Identical
+ to 'from'.
+ type: string
+ required:
+ - owner
+ type: object
+ example:
+ owner: owner
+ channel: RBM
+ from: BandwidthRBM
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ content:
+ suggestions:
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ - postbackData: !!binary |-
+ U0dWc2JHOGdkMjl5YkdRPQ==
+ text: Hello world
+ type: REPLY
+ text: Hello world
webhookSubscription_basicAuthentication:
description: "Basic authentication credentials are not required, but if present,\
\ both username and password must be provided."
diff --git a/bandwidth.yml b/bandwidth.yml
index 03769645..4b3681cb 100644
--- a/bandwidth.yml
+++ b/bandwidth.yml
@@ -223,6 +223,8 @@ paths:
$ref: '#/components/responses/messagingForbiddenError'
'404':
$ref: '#/components/responses/messagingNotFoundError'
+ '405':
+ $ref: '#/components/responses/messagingMethodNotAllowedError'
'406':
$ref: '#/components/responses/messagingNotAcceptableError'
'415':
@@ -250,24 +252,26 @@ paths:
'202':
$ref: '#/components/responses/createMultiChannelMessageResponse'
'400':
- $ref: '#/components/responses/createMessageBadRequestError'
+ $ref: '#/components/responses/multiChannelBadRequestError'
'401':
- $ref: '#/components/responses/messagingUnauthorizedError'
+ $ref: '#/components/responses/multiChannelUnauthorizedError'
'403':
- $ref: '#/components/responses/messagingForbiddenError'
+ $ref: '#/components/responses/multiChannelForbiddenError'
'404':
- $ref: '#/components/responses/messagingNotFoundError'
+ $ref: '#/components/responses/multiChannelNotFoundError'
+ '405':
+ $ref: '#/components/responses/multiChannelMethodNotAllowedError'
'406':
- $ref: '#/components/responses/messagingNotAcceptableError'
+ $ref: '#/components/responses/multiChannelNotAcceptableError'
'415':
- $ref: '#/components/responses/messagingInvalidMediaTypeError'
+ $ref: '#/components/responses/multiChannelInvalidMediaTypeError'
'429':
- $ref: '#/components/responses/messagingTooManyRequestsError'
+ $ref: '#/components/responses/multiChannelTooManyRequestsError'
'500':
- $ref: '#/components/responses/messagingInternalServerError'
+ $ref: '#/components/responses/multiChannelInternalServerError'
callbacks:
- multiChannelCallback:
- $ref: '#/components/callbacks/multiChannelMessageCallback'
+ statusCallback:
+ $ref: '#/components/callbacks/statusCallback'
x-badges:
- name: Beta
color: '#076EA8'
@@ -1471,6 +1475,34 @@ paths:
callbacks:
tfVerificationStatus:
$ref: '#/components/callbacks/tfVerificationStatus'
+ delete:
+ description: Delete a toll-free verification submission for a toll-free number.
+ operationId: deleteVerificationRequest
+ parameters:
+ - $ref: '#/components/parameters/accountId'
+ - $ref: '#/components/parameters/tfPhoneNumberPathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/noContentResponse'
+ '400':
+ $ref: '#/components/responses/tfvBadRequestResponse'
+ '401':
+ $ref: '#/components/responses/tfvUnauthorizedResponse'
+ '403':
+ $ref: '#/components/responses/tfvForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/tfvNotFoundResponse'
+ '405':
+ $ref: '#/components/responses/tfvNotAllowedResponse'
+ '429':
+ $ref: '#/components/responses/tfvTooManyRequestsResponse'
+ '500':
+ $ref: '#/components/responses/tfvServerErrorResponse'
+ '503':
+ $ref: '#/components/responses/tfvServiceUnavailableResponse'
+ summary: Delete a Toll-Free Verification Submission
+ tags:
+ - Toll-Free Verification
servers: *ref_4
/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions:
get:
@@ -1554,7 +1586,7 @@ paths:
- $ref: '#/components/parameters/webhookSubscriptionIdPathParam'
responses:
'204':
- description: No Content
+ $ref: '#/components/responses/noContentResponse'
'400':
$ref: '#/components/responses/tfvBadRequestResponse'
'401':
@@ -1639,24 +1671,12 @@ components:
The ID of the Application your from number or senderId is associated
with in the Bandwidth Phone Number Dashboard.
example: 93de2206-9669-4e07-948d-329f4b722ee2
- callbackTypeEnum:
- type: string
- enum:
- - message-received
- - message-sending
- - message-delivered
- - message-failed
- description: >
- Indicates the type of the callback:
-
- - `message-received` for inbound callbacks.
-
- - One of `message-sending`, `message-delivered`, `message-failed` for
- status callbacks.
- example: message-delivered
priorityEnum:
type: string
- description: The priority specified by the user.
+ description: >-
+ Specifies the message's sending priority with respect to other messages
+ in your account. For best results and optimal throughput, reserve the
+ 'high' priority setting for critical messages only.
enum:
- default
- high
@@ -1753,9 +1773,7 @@ components:
messageType:
$ref: '#/components/schemas/messageTypeEnum'
segmentCount:
- type: integer
- description: The number of segments the message was sent as.
- example: 1
+ $ref: '#/components/schemas/segmentCount'
errorCode:
type: integer
description: The numeric error code of the message.
@@ -1863,6 +1881,12 @@ components:
type: integer
mediaName:
type: string
+ segmentCount:
+ type: integer
+ description: >-
+ The number of segments the user's message is broken into before sending
+ over carrier networks.
+ example: 1
tag:
title: Tag
type: string
@@ -1870,14 +1894,6 @@ components:
A custom string that will be included in callback events of the message.
Max 1024 characters.
example: custom string
- deferredResult:
- title: DeferredResult
- type: object
- properties:
- result:
- type: object
- setOrExpired:
- type: boolean
expiration:
type: string
format: date-time
@@ -1887,6 +1903,16 @@ components:
2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time
in the future.
example: '2021-02-01T11:29:18-05:00'
+ carrierName:
+ type: string
+ 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
message:
title: Message
type: object
@@ -1900,20 +1926,14 @@ components:
description: The Bandwidth phone number associated with the message.
example: '+15554443333'
applicationId:
- type: string
- description: The application ID associated with the message.
- example: 93de2206-9669-4e07-948d-329f4b722ee2
+ $ref: '#/components/schemas/applicationId'
time:
type: string
format: date-time
description: The datetime stamp of the message in ISO 8601
example: 2024-12-02T20:15:57.278Z
segmentCount:
- type: integer
- description: >-
- The number of segments the original message from the user is broken
- into before sending over to carrier networks.
- example: 2
+ $ref: '#/components/schemas/segmentCount'
direction:
$ref: '#/components/schemas/messageDirectionEnum'
to:
@@ -1945,9 +1965,7 @@ components:
description: The contents of the message.
example: Hello world
tag:
- type: string
- description: The custom string set by the user.
- example: custom tag
+ $ref: '#/components/schemas/tag'
priority:
$ref: '#/components/schemas/priorityEnum'
expiration:
@@ -1961,11 +1979,7 @@ components:
- from
properties:
applicationId:
- type: string
- description: >-
- The ID of the Application your from number is associated with in the
- Bandwidth Phone Number Dashboard.
- example: 93de2206-9669-4e07-948d-329f4b722ee2
+ $ref: '#/components/schemas/applicationId'
to:
uniqueItems: true
type: array
@@ -2021,12 +2035,69 @@ components:
type: array
items:
$ref: '#/components/schemas/link'
+ example: []
+ data:
+ $ref: '#/components/schemas/multiChannelMessageResponseData'
+ errors:
+ type: array
+ items:
+ $ref: '#/components/schemas/errorObject'
+ example: []
+ multiChannelError:
+ type: object
+ properties:
+ links:
+ type: array
+ items:
+ $ref: '#/components/schemas/link'
+ example: []
data:
- $ref: '#/components/schemas/multiChannelMessageData'
+ type: object
+ nullable: true
+ example: null
errors:
type: array
items:
$ref: '#/components/schemas/errorObject'
+ link:
+ type: object
+ properties:
+ rel:
+ type: string
+ href:
+ type: string
+ errorObject:
+ type: object
+ properties:
+ type:
+ description: A concise summary of the error used for categorization.
+ type: string
+ description:
+ description: A detailed explanation of the error.
+ type: string
+ source:
+ $ref: '#/components/schemas/errorSource'
+ required:
+ - type
+ - description
+ - source
+ errorSource:
+ title: Error Source
+ type: object
+ description: Specifies relevant sources of the error, if any.
+ properties:
+ parameter:
+ type: string
+ description: The relevant URI query parameter causing the error
+ field:
+ type: string
+ description: The request body field that led to the error
+ header:
+ type: string
+ description: The header field that contributed to the error
+ reference:
+ type: string
+ description: A resource ID or path linked to the error
multiChannelMessageChannelEnum:
description: The channel of the multi-channel message.
type: string
@@ -2035,12 +2106,6 @@ components:
- SMS
- MMS
example: RBM
- multiChannelMessageDirectionEnum:
- type: string
- enum:
- - INBOUND
- - OUTBOUND
- example: OUTBOUND
multiChannelSenderId:
type: string
description: The sender ID of the message. This could be an alphanumeric sender ID.
@@ -2049,6 +2114,14 @@ components:
type: string
description: The phone number the message should be sent to in E164 format.
example: '+15552223333'
+ multiChannelDestinations:
+ uniqueItems: true
+ type: array
+ description: The destination phone number(s) of the message, in E164 format.
+ example:
+ - '+15554443333'
+ items:
+ type: string
rbmMessageContentText:
title: RBM Text
type: object
@@ -2090,6 +2163,26 @@ components:
maxLength: 1000
required:
- fileUrl
+ mmsMessageContentFile:
+ title: MMS Media File
+ type: object
+ properties:
+ fileUrl:
+ type: string
+ format: uri
+ description: >-
+ The URL of a media attachment.
+
+
+ For MMS, the API limits file size to 3.5MB. Specific carriers and
+ channels may have a smaller limit that could cause a large file to
+ fail, see
+ [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits)
+ for more details.
+ example: https://dev.bandwidth.com/images/bandwidth-logo.png
+ maxLength: 1000
+ required:
+ - fileUrl
rbmMessageMedia:
title: RBM Media
type: object
@@ -2198,7 +2291,9 @@ components:
text:
$ref: '#/components/schemas/messageText'
media:
- $ref: '#/components/schemas/messageMedia'
+ type: array
+ items:
+ $ref: '#/components/schemas/mmsMessageContentFile'
rbmMessageContentRichCard:
title: RBM Rich Card
oneOf:
@@ -2220,7 +2315,7 @@ components:
description: Displayed text for user to click
maxLength: 25
example: Hello world
- rbmActionPostBackData:
+ rbmActionPostbackData:
title: Post Back Data
type: string
format: byte
@@ -2234,11 +2329,11 @@ components:
$ref: '#/components/schemas/rbmActionTypeEnum'
text:
$ref: '#/components/schemas/rbmActionText'
- postBackData:
- $ref: '#/components/schemas/rbmActionPostBackData'
+ postbackData:
+ $ref: '#/components/schemas/rbmActionPostbackData'
required:
- text
- - postBackData
+ - postbackData
- type
rbmActionDial:
allOf:
@@ -2342,14 +2437,6 @@ components:
CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent'
OPEN_URL: '#/components/schemas/rbmActionOpenUrl'
REQUEST_LOCATION: '#/components/schemas/rbmActionBase'
- multiChannelStatusEnum:
- type: string
- enum:
- - QUEUED
- - SENDING
- - DELIVERED
- - FAILED
- example: DELIVERED
multiChannelChannelListObject:
type: object
properties:
@@ -2396,141 +2483,250 @@ components:
required:
- to
- channelList
- multiChannelMessageCallbackData:
- type: object
- properties:
- messageId:
- $ref: '#/components/schemas/messageId'
- status:
- $ref: '#/components/schemas/multiChannelStatusEnum'
- direction:
- $ref: '#/components/schemas/multiChannelMessageDirectionEnum'
- from:
- $ref: '#/components/schemas/multiChannelSenderId'
- to:
- $ref: '#/components/schemas/multiChannelDestination'
- applicationId:
- $ref: '#/components/schemas/applicationId'
- channel:
- $ref: '#/components/schemas/multiChannelMessageChannelEnum'
- tag:
- $ref: '#/components/schemas/tag'
- multiChannelMessageData:
+ multiChannelMessageResponseData:
+ description: The data returned in a multichannel message response.
type: object
properties:
messageId:
$ref: '#/components/schemas/messageId'
- status:
- $ref: '#/components/schemas/multiChannelStatusEnum'
time:
description: The time the message was received by the Bandwidth API.
type: string
format: date-time
example: 2025-01-01T18:20:16.000Z
direction:
- $ref: '#/components/schemas/multiChannelMessageDirectionEnum'
- from:
- $ref: '#/components/schemas/multiChannelSenderId'
+ $ref: '#/components/schemas/messageDirectionEnum'
to:
- $ref: '#/components/schemas/multiChannelDestination'
- applicationId:
- $ref: '#/components/schemas/applicationId'
- channel:
- $ref: '#/components/schemas/multiChannelMessageChannelEnum'
+ $ref: '#/components/schemas/multiChannelDestinations'
+ channelList:
+ type: array
+ description: >-
+ A list of message bodies. The messages will be attempted in the
+ order they are listed. Once a message sends successfully, the others
+ will be ignored.
+ items:
+ allOf:
+ - $ref: '#/components/schemas/multiChannelChannelListObject'
+ - type: object
+ properties:
+ owner:
+ type: string
+ description: >-
+ The Bandwidth senderId associated with the message.
+ Identical to 'from'.
+ required:
+ - owner
+ maxItems: 4
tag:
$ref: '#/components/schemas/tag'
- multiChannelCallbackData:
+ priority:
+ $ref: '#/components/schemas/priorityEnum'
+ expiration:
+ $ref: '#/components/schemas/expiration'
+ required:
+ - messageId
+ - time
+ - direction
+ - to
+ - channelList
+ multiChannelMessageContent:
+ description: The structure of the content field of a multichannel message.
type: object
properties:
- time:
- description: The time of the callback event.
- type: string
- format: date-time
- example: 2025-01-01T18:20:16.000Z
- type:
- $ref: '#/components/schemas/multiChannelStatusEnum'
- to:
- $ref: '#/components/schemas/multiChannelDestination'
- description:
+ text:
type: string
- example: Incoming message received
- message:
- $ref: '#/components/schemas/multiChannelMessageCallbackData'
- link:
+ media:
+ $ref: '#/components/schemas/rbmMessageContentFile'
+ rbmSuggestionResponse:
type: object
properties:
- rel:
- type: string
- href:
+ text:
type: string
- errorObject:
+ description: The text associated with the suggestion response.
+ example: Yes, I would like to proceed
+ postbackData:
+ $ref: '#/components/schemas/rbmActionPostbackData'
+ rbmLocationResponse:
type: object
properties:
- code:
+ latitude:
type: string
- message:
+ format: double
+ description: The latitude of the client's location.
+ example: '37.7749'
+ longitude:
type: string
- messageCallback:
- description: Message Callback Schema
+ format: double
+ description: The longitude of the client's location.
+ example: '-122.4194'
+ callback:
+ description: >-
+ Callbacks are divided into two types based on direction of the related
+ message:
+
+ - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM
+ message.
+
+ - `inboundCallback` indicates an inbound MO message or a multichannel
+ message client's response to a suggestion or location request.
+ type: object
+ oneOf:
+ - $ref: '#/components/schemas/statusCallback'
+ - $ref: '#/components/schemas/inboundCallback'
+ discriminator:
+ propertyName: type
+ mapping:
+ message-sent: '#/components/schemas/statusCallback'
+ message-delivered: '#/components/schemas/statusCallback'
+ message-failed: '#/components/schemas/statusCallback'
+ message-read: '#/components/schemas/statusCallback'
+ message-received: '#/components/schemas/inboundCallback'
+ request-location-response: '#/components/schemas/inboundCallback'
+ suggestion-response: '#/components/schemas/inboundCallback'
+ statusCallback:
type: object
+ description: >-
+ Represents a status callback for an outbound MT SMS or MMS or RBM
+ message.
properties:
time:
type: string
format: date-time
example: 2024-12-02T20:15:57.278Z
+ eventTime:
+ type: string
+ description: >-
+ Represents the time at which the message was read, for
+ `message-read` callbacks.
+ format: date-time
+ example: 2024-12-02T20:15:58.278Z
type:
- $ref: '#/components/schemas/callbackTypeEnum'
+ $ref: '#/components/schemas/statusCallbackTypeEnum'
to:
type: string
+ description: >-
+ The destination phone number the message was sent to.
+
+ For status callbacks, this the the Bandwidth user's client phone
+ number.
example: '+15552223333'
description:
type: string
description: A detailed description of the event described by the callback.
- example: rejected-unallocated-from-number
+ example: Message delivered to carrier.
message:
- $ref: '#/components/schemas/messageCallbackMessage'
+ $ref: '#/components/schemas/statusCallbackMessage'
errorCode:
type: integer
description: Optional error code, applicable only when type is `message-failed`.
- nullable: true
example: 4405
carrierName:
+ $ref: '#/components/schemas/carrierName'
+ required:
+ - time
+ - type
+ - to
+ - description
+ - message
+ inboundCallback:
+ type: object
+ description: Represents an inbound callback.
+ properties:
+ time:
type: string
- 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.
- nullable: true
- example: AT&T
+ format: date-time
+ example: 2024-12-02T20:15:57.278Z
+ type:
+ $ref: '#/components/schemas/inboundCallbackTypeEnum'
+ to:
+ type: string
+ 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'
+ description:
+ type: string
+ description: A detailed description of the event described by the callback.
+ example: Incoming message received
+ message:
+ $ref: '#/components/schemas/inboundCallbackMessage'
+ carrierName:
+ $ref: '#/components/schemas/carrierName'
required:
- time
- type
- to
- description
- message
- messageCallbackMessage:
- description: Message payload schema within a MessageCallback
+ statusCallbackTypeEnum:
+ type: string
+ description: >-
+ The possible status callbacks when sending an MT SMS or MMS or RBM
+ message:
+
+ - `message-sending` indicates that Bandwidth is sending the message to
+ the upstream provider.
+
+ - `message-delivered` indicates that the message was successfully sent.
+
+ - `message-failed` indicates that the message could not be sent to the
+ intended recipient.
+
+ - `message-read` indicates that the RBM message was read by the
+ recipient.
+ enum:
+ - message-sending
+ - message-delivered
+ - message-failed
+ - message-read
+ example: message-delivered
+ inboundCallbackTypeEnum:
+ type: string
+ 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
+ - suggestion-response
+ example: message-received
+ statusCallbackMessage:
+ description: Message payload schema within a callback
type: object
properties:
id:
type: string
+ description: A unique identifier of the message.
example: 1661365814859loidf7mcwd4qacn7
owner:
type: string
+ description: >-
+ The Bandwidth phone number or alphanumeric identifier associated
+ with the message.
example: '+15553332222'
applicationId:
- type: string
- example: 93de2206-9669-4e07-948d-329f4b722ee2
+ $ref: '#/components/schemas/applicationId'
time:
type: string
format: date-time
example: 2024-12-02T20:15:57.666Z
segmentCount:
- type: integer
- example: 1
+ $ref: '#/components/schemas/segmentCount'
direction:
$ref: '#/components/schemas/messageDirectionEnum'
to:
+ description: The phone number recipients of the message.
uniqueItems: true
type: array
items:
@@ -2539,17 +2735,18 @@ components:
- '+15552223333'
from:
type: string
+ description: >-
+ The Bandwidth phone number or alphanumeric identifier the message
+ was sent from.
example: '+15553332222'
text:
type: string
example: Hello world
tag:
- type: string
- example: custom string
+ $ref: '#/components/schemas/tag'
media:
type: array
- description: Optional media, applicable only for mms
- nullable: true
+ description: Optional media, not applicable for sms
items:
type: string
format: uri
@@ -2558,6 +2755,28 @@ components:
- https://dev.bandwidth.com/images/github_logo.png
priority:
$ref: '#/components/schemas/priorityEnum'
+ channel:
+ $ref: '#/components/schemas/multiChannelMessageChannelEnum'
+ required:
+ - id
+ - owner
+ - applicationId
+ - time
+ - segmentCount
+ - direction
+ - to
+ - from
+ inboundCallbackMessage:
+ allOf:
+ - $ref: '#/components/schemas/statusCallbackMessage'
+ - type: object
+ properties:
+ content:
+ $ref: '#/components/schemas/multiChannelMessageContent'
+ suggestionResponse:
+ $ref: '#/components/schemas/rbmSuggestionResponse'
+ locationResponse:
+ $ref: '#/components/schemas/rbmLocationResponse'
required:
- id
- owner
@@ -2567,7 +2786,6 @@ components:
- direction
- to
- from
- - text
callbackMethodEnum:
type: string
nullable: true
@@ -5954,6 +6172,12 @@ components:
application/json:
schema:
$ref: '#/components/schemas/messagingRequestError'
+ messagingMethodNotAllowedError:
+ description: Method Not Allowed
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/messagingRequestError'
messagingInvalidMediaTypeError:
description: Unsupported Media Type
content:
@@ -5972,6 +6196,120 @@ components:
application/json:
schema:
$ref: '#/components/schemas/messagingRequestError'
+ multiChannelBadRequestError:
+ description: Bad Request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: request-validation
+ description: >-
+ The 'channelList[0].from' field must contain exactly one
+ telephone number
+ source:
+ field: channelList[0].from
+ multiChannelNotAcceptableError:
+ description: Not Acceptable
+ multiChannelUnauthorizedError:
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: unauthorized
+ description: Authentication Failed
+ source: {}
+ multiChannelForbiddenError:
+ description: Forbidden
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: forbidden
+ description: Access Denied
+ source: {}
+ multiChannelNotFoundError:
+ description: Not Found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: forbidden
+ description: Resource not found.
+ source: {}
+ multiChannelMethodNotAllowedError:
+ description: Method Not Allowed
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: method-not-allowed
+ description: Method 'PUT' not supported for this resource.
+ source: {}
+ multiChannelInvalidMediaTypeError:
+ description: Unsupported Media Type
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: unsupported-content-type
+ description: >-
+ Content-Type 'application/xml;charset=UTF-8' is not supported.
+ Please use 'application/json'
+ source:
+ header: Content-Type
+ multiChannelTooManyRequestsError:
+ description: Too Many Requests
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: rate-limit-exceeded
+ description: >-
+ You have exceeded your rate limit for this endpoint. Please
+ retry later.
+ source: {}
+ multiChannelInternalServerError:
+ description: Internal Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/multiChannelError'
+ example:
+ links: []
+ data: null
+ errors:
+ - type: internal-server-error
+ description: Internal server error. No further information available
+ source: {}
createCallResponse:
description: Created
headers:
@@ -6373,6 +6711,8 @@ components:
example:
description: Cannot process request.
type: bad request
+ noContentResponse:
+ description: No Content
tfvPostBadRequestResponse:
description: Bad Request
content:
@@ -7506,17 +7846,30 @@ components:
post:
requestBody:
required: true
- description: >
-
This Inbound Message Webhook is an envelope containing a
- received (MO) message to your message-enabled Bandwidth telephone
- number. The payload type will always indicate "message-received".
+ 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.
This Outbound Message Webhook is an envelope containing status
- information regarding a message sent (MT) from your
- message-enabled Bandwidth telephone number. The payload type will
- be one of "message-sending", "message-delivered", or
- "message-failed".
+ information regarding a message sent (MT)
+ from your message-enabled Bandwidth telephone number.
+
The payload type will be one of message-sending, message-delivered, message-failed or message-read.
+
Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.
@@ -202,6 +203,7 @@ public CreateMultiChannelMessageResponse createMultiChannelMessage(String accoun
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
+
405
Method Not Allowed
-
406
Not Acceptable
-
415
Unsupported Media Type
-
429
Too Many Requests
-
@@ -231,6 +233,7 @@ public ApiResponse createMultiChannelMessageW
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
+
405
Method Not Allowed
-
406
Not Acceptable
-
415
Unsupported Media Type
-
429
Too Many Requests
-
diff --git a/src/main/java/com/bandwidth/sdk/api/TollFreeVerificationApi.java b/src/main/java/com/bandwidth/sdk/api/TollFreeVerificationApi.java
index dc1a4c7a..d2208831 100644
--- a/src/main/java/com/bandwidth/sdk/api/TollFreeVerificationApi.java
+++ b/src/main/java/com/bandwidth/sdk/api/TollFreeVerificationApi.java
@@ -247,6 +247,171 @@ public okhttp3.Call createWebhookSubscriptionAsync(String accountId, WebhookSubs
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
+ /**
+ * Build call for deleteVerificationRequest
+ * @param accountId Your Bandwidth Account ID. (required)
+ * @param phoneNumber Valid Toll-Free telephone number in E.164 format. (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+
Response Details
+
Status Code
Description
Response Headers
+
204
No Content
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
Forbidden
-
+
404
Cannot find the requested resource.
-
+
405
Method Not Allowed
-
+
429
Too Many Requests
-
+
500
Internal Server Error
-
+
503
Service Unavailable
-
+
+ */
+ public okhttp3.Call deleteVerificationRequestCall(String accountId, String phoneNumber, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { "https://api.bandwidth.com/api/v2" };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification"
+ .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()))
+ .replace("{" + "phoneNumber" + "}", localVarApiClient.escapeString(phoneNumber.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { "Basic" };
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call deleteVerificationRequestValidateBeforeCall(String accountId, String phoneNumber, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException("Missing the required parameter 'accountId' when calling deleteVerificationRequest(Async)");
+ }
+
+ // verify the required parameter 'phoneNumber' is set
+ if (phoneNumber == null) {
+ throw new ApiException("Missing the required parameter 'phoneNumber' when calling deleteVerificationRequest(Async)");
+ }
+
+ return deleteVerificationRequestCall(accountId, phoneNumber, _callback);
+
+ }
+
+ /**
+ * Delete a Toll-Free Verification Submission
+ * Delete a toll-free verification submission for a toll-free number.
+ * @param accountId Your Bandwidth Account ID. (required)
+ * @param phoneNumber Valid Toll-Free telephone number in E.164 format. (required)
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Response Details
+
Status Code
Description
Response Headers
+
204
No Content
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
Forbidden
-
+
404
Cannot find the requested resource.
-
+
405
Method Not Allowed
-
+
429
Too Many Requests
-
+
500
Internal Server Error
-
+
503
Service Unavailable
-
+
+ */
+ public void deleteVerificationRequest(String accountId, String phoneNumber) throws ApiException {
+ deleteVerificationRequestWithHttpInfo(accountId, phoneNumber);
+ }
+
+ /**
+ * Delete a Toll-Free Verification Submission
+ * Delete a toll-free verification submission for a toll-free number.
+ * @param accountId Your Bandwidth Account ID. (required)
+ * @param phoneNumber Valid Toll-Free telephone number in E.164 format. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+
Response Details
+
Status Code
Description
Response Headers
+
204
No Content
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
Forbidden
-
+
404
Cannot find the requested resource.
-
+
405
Method Not Allowed
-
+
429
Too Many Requests
-
+
500
Internal Server Error
-
+
503
Service Unavailable
-
+
+ */
+ public ApiResponse deleteVerificationRequestWithHttpInfo(String accountId, String phoneNumber) throws ApiException {
+ okhttp3.Call localVarCall = deleteVerificationRequestValidateBeforeCall(accountId, phoneNumber, null);
+ return localVarApiClient.execute(localVarCall);
+ }
+
+ /**
+ * Delete a Toll-Free Verification Submission (asynchronously)
+ * Delete a toll-free verification submission for a toll-free number.
+ * @param accountId Your Bandwidth Account ID. (required)
+ * @param phoneNumber Valid Toll-Free telephone number in E.164 format. (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+
Response Details
+
Status Code
Description
Response Headers
+
204
No Content
-
+
400
Bad Request
-
+
401
Unauthorized
-
+
403
Forbidden
-
+
404
Cannot find the requested resource.
-
+
405
Method Not Allowed
-
+
429
Too Many Requests
-
+
500
Internal Server Error
-
+
503
Service Unavailable
-
+
+ */
+ public okhttp3.Call deleteVerificationRequestAsync(String accountId, String phoneNumber, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = deleteVerificationRequestValidateBeforeCall(accountId, phoneNumber, _callback);
+ localVarApiClient.executeAsync(localVarCall, _callback);
+ return localVarCall;
+ }
/**
* Build call for deleteWebhookSubscription
* @param accountId Your Bandwidth Account ID. (required)
diff --git a/src/main/java/com/bandwidth/sdk/model/Callback.java b/src/main/java/com/bandwidth/sdk/model/Callback.java
new file mode 100644
index 00000000..afcf7f15
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/Callback.java
@@ -0,0 +1,278 @@
+/*
+ * 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 com.bandwidth.sdk.model.InboundCallback;
+import com.bandwidth.sdk.model.InboundCallbackMessage;
+import com.bandwidth.sdk.model.InboundCallbackTypeEnum;
+import com.bandwidth.sdk.model.StatusCallback;
+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.Arrays;
+
+
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonParseException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.TypeAdapterFactory;
+import com.google.gson.reflect.TypeToken;
+import com.google.gson.JsonPrimitive;
+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 com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonParseException;
+
+import com.bandwidth.sdk.JSON;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class Callback extends AbstractOpenApiSchema {
+ private static final Logger log = Logger.getLogger(Callback.class.getName());
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!Callback.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'Callback' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter adapterStatusCallback = gson.getDelegateAdapter(this, TypeToken.get(StatusCallback.class));
+ final TypeAdapter adapterInboundCallback = gson.getDelegateAdapter(this, TypeToken.get(InboundCallback.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, Callback value) throws IOException {
+ if (value == null || value.getActualInstance() == null) {
+ elementAdapter.write(out, null);
+ return;
+ }
+
+ // check if the actual instance is of the type `StatusCallback`
+ if (value.getActualInstance() instanceof StatusCallback) {
+ JsonElement element = adapterStatusCallback.toJsonTree((StatusCallback)value.getActualInstance());
+ elementAdapter.write(out, element);
+ return;
+ }
+ // check if the actual instance is of the type `InboundCallback`
+ if (value.getActualInstance() instanceof InboundCallback) {
+ JsonElement element = adapterInboundCallback.toJsonTree((InboundCallback)value.getActualInstance());
+ elementAdapter.write(out, element);
+ return;
+ }
+ throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: InboundCallback, StatusCallback");
+ }
+
+ @Override
+ public Callback read(JsonReader in) throws IOException {
+ Object deserialized = null;
+ JsonElement jsonElement = elementAdapter.read(in);
+
+ int match = 0;
+ ArrayList errorMessages = new ArrayList<>();
+ TypeAdapter actualAdapter = elementAdapter;
+
+ // deserialize StatusCallback
+ try {
+ // validate the JSON object to see if any exception is thrown
+ StatusCallback.validateJsonElement(jsonElement);
+ actualAdapter = adapterStatusCallback;
+ match++;
+ log.log(Level.FINER, "Input data matches schema 'StatusCallback'");
+ } catch (Exception e) {
+ // deserialization failed, continue
+ errorMessages.add(String.format("Deserialization for StatusCallback failed with `%s`.", e.getMessage()));
+ log.log(Level.FINER, "Input data does not match schema 'StatusCallback'", e);
+ }
+ // deserialize InboundCallback
+ try {
+ // validate the JSON object to see if any exception is thrown
+ InboundCallback.validateJsonElement(jsonElement);
+ actualAdapter = adapterInboundCallback;
+ match++;
+ log.log(Level.FINER, "Input data matches schema 'InboundCallback'");
+ } catch (Exception e) {
+ // deserialization failed, continue
+ errorMessages.add(String.format("Deserialization for InboundCallback failed with `%s`.", e.getMessage()));
+ log.log(Level.FINER, "Input data does not match schema 'InboundCallback'", e);
+ }
+
+ if (match == 1) {
+ Callback ret = new Callback();
+ ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement));
+ return ret;
+ }
+
+ throw new IOException(String.format("Failed deserialization for Callback: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString()));
+ }
+ }.nullSafe();
+ }
+ }
+
+ // store a list of schema names defined in oneOf
+ public static final Map> schemas = new HashMap>();
+
+ public Callback() {
+ super("oneOf", Boolean.FALSE);
+ }
+
+ public Callback(Object o) {
+ super("oneOf", Boolean.FALSE);
+ setActualInstance(o);
+ }
+
+ static {
+ schemas.put("StatusCallback", StatusCallback.class);
+ schemas.put("InboundCallback", InboundCallback.class);
+ }
+
+ @Override
+ public Map> getSchemas() {
+ return Callback.schemas;
+ }
+
+ /**
+ * Set the instance that matches the oneOf child schema, check
+ * the instance parameter is valid against the oneOf child schemas:
+ * InboundCallback, StatusCallback
+ *
+ * It could be an instance of the 'oneOf' schemas.
+ */
+ @Override
+ public void setActualInstance(Object instance) {
+ if (instance instanceof StatusCallback) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ if (instance instanceof InboundCallback) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ throw new RuntimeException("Invalid instance type. Must be InboundCallback, StatusCallback");
+ }
+
+ /**
+ * Get the actual instance, which can be the following:
+ * InboundCallback, StatusCallback
+ *
+ * @return The actual instance (InboundCallback, StatusCallback)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object getActualInstance() {
+ return super.getActualInstance();
+ }
+
+ /**
+ * Get the actual instance of `StatusCallback`. If the actual instance is not `StatusCallback`,
+ * the ClassCastException will be thrown.
+ *
+ * @return The actual instance of `StatusCallback`
+ * @throws ClassCastException if the instance is not `StatusCallback`
+ */
+ public StatusCallback getStatusCallback() throws ClassCastException {
+ return (StatusCallback)super.getActualInstance();
+ }
+
+ /**
+ * Get the actual instance of `InboundCallback`. If the actual instance is not `InboundCallback`,
+ * the ClassCastException will be thrown.
+ *
+ * @return The actual instance of `InboundCallback`
+ * @throws ClassCastException if the instance is not `InboundCallback`
+ */
+ public InboundCallback getInboundCallback() throws ClassCastException {
+ return (InboundCallback)super.getActualInstance();
+ }
+
+ /**
+ * 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 Callback
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ // validate oneOf schemas one by one
+ int validCount = 0;
+ ArrayList errorMessages = new ArrayList<>();
+ // validate the json string with StatusCallback
+ try {
+ StatusCallback.validateJsonElement(jsonElement);
+ validCount++;
+ } catch (Exception e) {
+ errorMessages.add(String.format("Deserialization for StatusCallback failed with `%s`.", e.getMessage()));
+ // continue to the next one
+ }
+ // validate the json string with InboundCallback
+ try {
+ InboundCallback.validateJsonElement(jsonElement);
+ validCount++;
+ } catch (Exception e) {
+ errorMessages.add(String.format("Deserialization for InboundCallback failed with `%s`.", e.getMessage()));
+ // continue to the next one
+ }
+ if (validCount != 1) {
+ throw new IOException(String.format("The JSON string is invalid for Callback with oneOf schemas: InboundCallback, StatusCallback. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString()));
+ }
+ }
+
+ /**
+ * Create an instance of Callback given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of Callback
+ * @throws IOException if the JSON string is invalid with respect to Callback
+ */
+ public static Callback fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, Callback.class);
+ }
+
+ /**
+ * Convert an instance of Callback 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/CreateMultiChannelMessageResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateMultiChannelMessageResponse.java
index d8eaba08..b11b43ba 100644
--- a/src/main/java/com/bandwidth/sdk/model/CreateMultiChannelMessageResponse.java
+++ b/src/main/java/com/bandwidth/sdk/model/CreateMultiChannelMessageResponse.java
@@ -16,7 +16,7 @@
import java.util.Objects;
import com.bandwidth.sdk.model.ErrorObject;
import com.bandwidth.sdk.model.Link;
-import com.bandwidth.sdk.model.MultiChannelMessageData;
+import com.bandwidth.sdk.model.MultiChannelMessageResponseData;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -63,7 +63,7 @@ public class CreateMultiChannelMessageResponse {
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@javax.annotation.Nullable
- private MultiChannelMessageData data;
+ private MultiChannelMessageResponseData data;
public static final String SERIALIZED_NAME_ERRORS = "errors";
@SerializedName(SERIALIZED_NAME_ERRORS)
@@ -100,7 +100,7 @@ public void setLinks(@javax.annotation.Nullable List links) {
}
- public CreateMultiChannelMessageResponse data(@javax.annotation.Nullable MultiChannelMessageData data) {
+ public CreateMultiChannelMessageResponse data(@javax.annotation.Nullable MultiChannelMessageResponseData data) {
this.data = data;
return this;
}
@@ -110,11 +110,11 @@ public CreateMultiChannelMessageResponse data(@javax.annotation.Nullable MultiCh
* @return data
*/
@javax.annotation.Nullable
- public MultiChannelMessageData getData() {
+ public MultiChannelMessageResponseData getData() {
return data;
}
- public void setData(@javax.annotation.Nullable MultiChannelMessageData data) {
+ public void setData(@javax.annotation.Nullable MultiChannelMessageResponseData data) {
this.data = data;
}
@@ -278,7 +278,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
// validate the optional field `data`
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
- MultiChannelMessageData.validateJsonElement(jsonObj.get("data"));
+ MultiChannelMessageResponseData.validateJsonElement(jsonObj.get("data"));
}
if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) {
JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors");
diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorObject.java b/src/main/java/com/bandwidth/sdk/model/ErrorObject.java
index 31d3271e..d15af07e 100644
--- a/src/main/java/com/bandwidth/sdk/model/ErrorObject.java
+++ b/src/main/java/com/bandwidth/sdk/model/ErrorObject.java
@@ -14,6 +14,7 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
+import com.bandwidth.sdk.model.ErrorSource;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -50,54 +51,78 @@
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
public class ErrorObject {
- public static final String SERIALIZED_NAME_CODE = "code";
- @SerializedName(SERIALIZED_NAME_CODE)
- @javax.annotation.Nullable
- private String code;
+ public static final String SERIALIZED_NAME_TYPE = "type";
+ @SerializedName(SERIALIZED_NAME_TYPE)
+ @javax.annotation.Nonnull
+ private String type;
- public static final String SERIALIZED_NAME_MESSAGE = "message";
- @SerializedName(SERIALIZED_NAME_MESSAGE)
- @javax.annotation.Nullable
- private String message;
+ public static final String SERIALIZED_NAME_DESCRIPTION = "description";
+ @SerializedName(SERIALIZED_NAME_DESCRIPTION)
+ @javax.annotation.Nonnull
+ private String description;
+
+ public static final String SERIALIZED_NAME_SOURCE = "source";
+ @SerializedName(SERIALIZED_NAME_SOURCE)
+ @javax.annotation.Nonnull
+ private ErrorSource source;
public ErrorObject() {
}
- public ErrorObject code(@javax.annotation.Nullable String code) {
- this.code = code;
+ public ErrorObject type(@javax.annotation.Nonnull String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * A concise summary of the error used for categorization.
+ * @return type
+ */
+ @javax.annotation.Nonnull
+ public String getType() {
+ return type;
+ }
+
+ public void setType(@javax.annotation.Nonnull String type) {
+ this.type = type;
+ }
+
+
+ public ErrorObject description(@javax.annotation.Nonnull String description) {
+ this.description = description;
return this;
}
/**
- * Get code
- * @return code
+ * A detailed explanation of the error.
+ * @return description
*/
- @javax.annotation.Nullable
- public String getCode() {
- return code;
+ @javax.annotation.Nonnull
+ public String getDescription() {
+ return description;
}
- public void setCode(@javax.annotation.Nullable String code) {
- this.code = code;
+ public void setDescription(@javax.annotation.Nonnull String description) {
+ this.description = description;
}
- public ErrorObject message(@javax.annotation.Nullable String message) {
- this.message = message;
+ public ErrorObject source(@javax.annotation.Nonnull ErrorSource source) {
+ this.source = source;
return this;
}
/**
- * Get message
- * @return message
+ * Get source
+ * @return source
*/
- @javax.annotation.Nullable
- public String getMessage() {
- return message;
+ @javax.annotation.Nonnull
+ public ErrorSource getSource() {
+ return source;
}
- public void setMessage(@javax.annotation.Nullable String message) {
- this.message = message;
+ public void setSource(@javax.annotation.Nonnull ErrorSource source) {
+ this.source = source;
}
/**
@@ -155,22 +180,24 @@ public boolean equals(Object o) {
return false;
}
ErrorObject errorObject = (ErrorObject) o;
- return Objects.equals(this.code, errorObject.code) &&
- Objects.equals(this.message, errorObject.message)&&
+ return Objects.equals(this.type, errorObject.type) &&
+ Objects.equals(this.description, errorObject.description) &&
+ Objects.equals(this.source, errorObject.source)&&
Objects.equals(this.additionalProperties, errorObject.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(code, message, additionalProperties);
+ return Objects.hash(type, description, source, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ErrorObject {\n");
- sb.append(" code: ").append(toIndentedString(code)).append("\n");
- sb.append(" message: ").append(toIndentedString(message)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" source: ").append(toIndentedString(source)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -194,11 +221,15 @@ private String toIndentedString(Object o) {
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
- openapiFields.add("code");
- openapiFields.add("message");
+ openapiFields.add("type");
+ openapiFields.add("description");
+ openapiFields.add("source");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("type");
+ openapiRequiredFields.add("description");
+ openapiRequiredFields.add("source");
}
/**
@@ -213,13 +244,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorObject is not found in the empty JSON string", ErrorObject.openapiRequiredFields.toString()));
}
}
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : ErrorObject.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
+ }
+ }
JsonObject jsonObj = jsonElement.getAsJsonObject();
- if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString()));
+ if (!jsonObj.get("type").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
}
- if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
+ if (!jsonObj.get("description").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
+ // validate the required field `source`
+ ErrorSource.validateJsonElement(jsonObj.get("source"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorSource.java b/src/main/java/com/bandwidth/sdk/model/ErrorSource.java
new file mode 100644
index 00000000..dc26c1d4
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/ErrorSource.java
@@ -0,0 +1,377 @@
+/*
+ * 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 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 com.bandwidth.sdk.JSON;
+
+/**
+ * Specifies relevant sources of the error, if any.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class ErrorSource {
+ 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 ErrorSource() {
+ }
+
+ public ErrorSource parameter(@javax.annotation.Nullable String parameter) {
+ this.parameter = parameter;
+ return this;
+ }
+
+ /**
+ * The relevant URI query parameter causing the error
+ * @return parameter
+ */
+ @javax.annotation.Nullable
+ public String getParameter() {
+ return parameter;
+ }
+
+ public void setParameter(@javax.annotation.Nullable String parameter) {
+ this.parameter = parameter;
+ }
+
+
+ public ErrorSource field(@javax.annotation.Nullable String field) {
+ this.field = field;
+ return this;
+ }
+
+ /**
+ * The request body field that led to the error
+ * @return field
+ */
+ @javax.annotation.Nullable
+ public String getField() {
+ return field;
+ }
+
+ public void setField(@javax.annotation.Nullable String field) {
+ this.field = field;
+ }
+
+
+ public ErrorSource header(@javax.annotation.Nullable String header) {
+ this.header = header;
+ return this;
+ }
+
+ /**
+ * The header field that contributed to the error
+ * @return header
+ */
+ @javax.annotation.Nullable
+ public String getHeader() {
+ return header;
+ }
+
+ public void setHeader(@javax.annotation.Nullable String header) {
+ this.header = header;
+ }
+
+
+ public ErrorSource reference(@javax.annotation.Nullable String reference) {
+ this.reference = reference;
+ return this;
+ }
+
+ /**
+ * A resource ID or path linked to 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 ErrorSource instance itself
+ */
+ public ErrorSource 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;
+ }
+ ErrorSource errorSource = (ErrorSource) o;
+ return Objects.equals(this.parameter, errorSource.parameter) &&
+ Objects.equals(this.field, errorSource.field) &&
+ Objects.equals(this.header, errorSource.header) &&
+ Objects.equals(this.reference, errorSource.reference)&&
+ Objects.equals(this.additionalProperties, errorSource.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(parameter, field, header, reference, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ErrorSource {\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();
+ openapiFields.add("parameter");
+ openapiFields.add("field");
+ openapiFields.add("header");
+ openapiFields.add("reference");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ }
+
+ /**
+ * 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 ErrorSource
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!ErrorSource.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorSource is not found in the empty JSON string", ErrorSource.openapiRequiredFields.toString()));
+ }
+ }
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if ((jsonObj.get("parameter") != null && !jsonObj.get("parameter").isJsonNull()) && !jsonObj.get("parameter").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("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("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("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("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 (!ErrorSource.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'ErrorSource' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(ErrorSource.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, ErrorSource 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 ErrorSource read(JsonReader in) throws IOException {
+ JsonElement jsonElement = elementAdapter.read(in);
+ validateJsonElement(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ ErrorSource 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("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 ErrorSource given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of ErrorSource
+ * @throws IOException if the JSON string is invalid with respect to ErrorSource
+ */
+ public static ErrorSource fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, ErrorSource.class);
+ }
+
+ /**
+ * Convert an instance of ErrorSource 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/MessageCallback.java b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java
similarity index 75%
rename from src/main/java/com/bandwidth/sdk/model/MessageCallback.java
rename to src/main/java/com/bandwidth/sdk/model/InboundCallback.java
index 8d44ecb3..e08a089c 100644
--- a/src/main/java/com/bandwidth/sdk/model/MessageCallback.java
+++ b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java
@@ -14,8 +14,8 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
-import com.bandwidth.sdk.model.CallbackTypeEnum;
-import com.bandwidth.sdk.model.MessageCallbackMessage;
+import com.bandwidth.sdk.model.InboundCallbackMessage;
+import com.bandwidth.sdk.model.InboundCallbackTypeEnum;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Arrays;
-import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -50,10 +49,10 @@
import com.bandwidth.sdk.JSON;
/**
- * Message Callback Schema
+ * Represents an inbound callback.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class MessageCallback {
+public class InboundCallback {
public static final String SERIALIZED_NAME_TIME = "time";
@SerializedName(SERIALIZED_NAME_TIME)
@javax.annotation.Nonnull
@@ -62,7 +61,7 @@ public class MessageCallback {
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
@javax.annotation.Nonnull
- private CallbackTypeEnum type;
+ private InboundCallbackTypeEnum type;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
@@ -77,22 +76,17 @@ public class MessageCallback {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nonnull
- private MessageCallbackMessage message;
-
- public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode";
- @SerializedName(SERIALIZED_NAME_ERROR_CODE)
- @javax.annotation.Nullable
- private Integer errorCode;
+ private InboundCallbackMessage message;
public static final String SERIALIZED_NAME_CARRIER_NAME = "carrierName";
@SerializedName(SERIALIZED_NAME_CARRIER_NAME)
@javax.annotation.Nullable
private String carrierName;
- public MessageCallback() {
+ public InboundCallback() {
}
- public MessageCallback time(@javax.annotation.Nonnull OffsetDateTime time) {
+ public InboundCallback time(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
return this;
}
@@ -111,7 +105,7 @@ public void setTime(@javax.annotation.Nonnull OffsetDateTime time) {
}
- public MessageCallback type(@javax.annotation.Nonnull CallbackTypeEnum type) {
+ public InboundCallback type(@javax.annotation.Nonnull InboundCallbackTypeEnum type) {
this.type = type;
return this;
}
@@ -121,22 +115,22 @@ public MessageCallback type(@javax.annotation.Nonnull CallbackTypeEnum type) {
* @return type
*/
@javax.annotation.Nonnull
- public CallbackTypeEnum getType() {
+ public InboundCallbackTypeEnum getType() {
return type;
}
- public void setType(@javax.annotation.Nonnull CallbackTypeEnum type) {
+ public void setType(@javax.annotation.Nonnull InboundCallbackTypeEnum type) {
this.type = type;
}
- public MessageCallback to(@javax.annotation.Nonnull String to) {
+ public InboundCallback to(@javax.annotation.Nonnull String to) {
this.to = to;
return this;
}
/**
- * Get 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.
* @return to
*/
@javax.annotation.Nonnull
@@ -149,7 +143,7 @@ public void setTo(@javax.annotation.Nonnull String to) {
}
- public MessageCallback description(@javax.annotation.Nonnull String description) {
+ public InboundCallback description(@javax.annotation.Nonnull String description) {
this.description = description;
return this;
}
@@ -168,7 +162,7 @@ public void setDescription(@javax.annotation.Nonnull String description) {
}
- public MessageCallback message(@javax.annotation.Nonnull MessageCallbackMessage message) {
+ public InboundCallback message(@javax.annotation.Nonnull InboundCallbackMessage message) {
this.message = message;
return this;
}
@@ -178,41 +172,22 @@ public MessageCallback message(@javax.annotation.Nonnull MessageCallbackMessage
* @return message
*/
@javax.annotation.Nonnull
- public MessageCallbackMessage getMessage() {
+ public InboundCallbackMessage getMessage() {
return message;
}
- public void setMessage(@javax.annotation.Nonnull MessageCallbackMessage message) {
+ public void setMessage(@javax.annotation.Nonnull InboundCallbackMessage message) {
this.message = message;
}
- public MessageCallback errorCode(@javax.annotation.Nullable Integer errorCode) {
- this.errorCode = errorCode;
- return this;
- }
-
- /**
- * Optional error code, applicable only when type is `message-failed`.
- * @return errorCode
- */
- @javax.annotation.Nullable
- public Integer getErrorCode() {
- return errorCode;
- }
-
- public void setErrorCode(@javax.annotation.Nullable Integer errorCode) {
- this.errorCode = errorCode;
- }
-
-
- public MessageCallback carrierName(@javax.annotation.Nullable String carrierName) {
+ public InboundCallback carrierName(@javax.annotation.Nullable String carrierName) {
this.carrierName = carrierName;
return this;
}
/**
- * 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.
+ * 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
@@ -237,9 +212,9 @@ public void setCarrierName(@javax.annotation.Nullable String carrierName) {
*
* @param key name of the property
* @param value value of the property
- * @return the MessageCallback instance itself
+ * @return the InboundCallback instance itself
*/
- public MessageCallback putAdditionalProperty(String key, Object value) {
+ public InboundCallback putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -278,43 +253,30 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- MessageCallback messageCallback = (MessageCallback) o;
- return Objects.equals(this.time, messageCallback.time) &&
- Objects.equals(this.type, messageCallback.type) &&
- Objects.equals(this.to, messageCallback.to) &&
- Objects.equals(this.description, messageCallback.description) &&
- Objects.equals(this.message, messageCallback.message) &&
- Objects.equals(this.errorCode, messageCallback.errorCode) &&
- Objects.equals(this.carrierName, messageCallback.carrierName)&&
- Objects.equals(this.additionalProperties, messageCallback.additionalProperties);
- }
-
- private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
- return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
+ InboundCallback inboundCallback = (InboundCallback) o;
+ return Objects.equals(this.time, inboundCallback.time) &&
+ Objects.equals(this.type, inboundCallback.type) &&
+ Objects.equals(this.to, inboundCallback.to) &&
+ Objects.equals(this.description, inboundCallback.description) &&
+ Objects.equals(this.message, inboundCallback.message) &&
+ Objects.equals(this.carrierName, inboundCallback.carrierName)&&
+ Objects.equals(this.additionalProperties, inboundCallback.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(time, type, to, description, message, errorCode, carrierName, additionalProperties);
- }
-
- private static int hashCodeNullable(JsonNullable a) {
- if (a == null) {
- return 1;
- }
- return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
+ return Objects.hash(time, type, to, description, message, carrierName, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class MessageCallback {\n");
+ sb.append("class InboundCallback {\n");
sb.append(" time: ").append(toIndentedString(time)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
- sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
sb.append(" carrierName: ").append(toIndentedString(carrierName)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
@@ -344,7 +306,6 @@ private String toIndentedString(Object o) {
openapiFields.add("to");
openapiFields.add("description");
openapiFields.add("message");
- openapiFields.add("errorCode");
openapiFields.add("carrierName");
// a set of required properties/fields (JSON key names)
@@ -360,24 +321,24 @@ 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 MessageCallback
+ * @throws IOException if the JSON Element is invalid with respect to InboundCallback
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!MessageCallback.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in MessageCallback is not found in the empty JSON string", MessageCallback.openapiRequiredFields.toString()));
+ if (!InboundCallback.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in InboundCallback is not found in the empty JSON string", InboundCallback.openapiRequiredFields.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
- for (String requiredField : MessageCallback.openapiRequiredFields) {
+ for (String requiredField : InboundCallback.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `type`
- CallbackTypeEnum.validateJsonElement(jsonObj.get("type"));
+ InboundCallbackTypeEnum.validateJsonElement(jsonObj.get("type"));
if (!jsonObj.get("to").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
@@ -385,7 +346,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
// validate the required field `message`
- MessageCallbackMessage.validateJsonElement(jsonObj.get("message"));
+ InboundCallbackMessage.validateJsonElement(jsonObj.get("message"));
if ((jsonObj.get("carrierName") != null && !jsonObj.get("carrierName").isJsonNull()) && !jsonObj.get("carrierName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `carrierName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierName").toString()));
}
@@ -395,16 +356,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!MessageCallback.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'MessageCallback' and its subtypes
+ if (!InboundCallback.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'InboundCallback' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(MessageCallback.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(InboundCallback.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, MessageCallback value) throws IOException {
+ public void write(JsonWriter out, InboundCallback value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -432,12 +393,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public MessageCallback read(JsonReader in) throws IOException {
+ public InboundCallback read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- MessageCallback instance = thisAdapter.fromJsonTree(jsonObj);
+ InboundCallback instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -464,18 +425,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of MessageCallback given an JSON string
+ * Create an instance of InboundCallback given an JSON string
*
* @param jsonString JSON string
- * @return An instance of MessageCallback
- * @throws IOException if the JSON string is invalid with respect to MessageCallback
+ * @return An instance of InboundCallback
+ * @throws IOException if the JSON string is invalid with respect to InboundCallback
*/
- public static MessageCallback fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, MessageCallback.class);
+ public static InboundCallback fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, InboundCallback.class);
}
/**
- * Convert an instance of MessageCallback to an JSON string
+ * Convert an instance of InboundCallback to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackMessage.java
new file mode 100644
index 00000000..09b62d76
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackMessage.java
@@ -0,0 +1,782 @@
+/*
+ * 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 com.bandwidth.sdk.model.MessageDirectionEnum;
+import com.bandwidth.sdk.model.MultiChannelMessageChannelEnum;
+import com.bandwidth.sdk.model.MultiChannelMessageContent;
+import com.bandwidth.sdk.model.PriorityEnum;
+import com.bandwidth.sdk.model.RbmLocationResponse;
+import com.bandwidth.sdk.model.RbmSuggestionResponse;
+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.net.URI;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+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 com.bandwidth.sdk.JSON;
+
+/**
+ * InboundCallbackMessage
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class InboundCallbackMessage {
+ public static final String SERIALIZED_NAME_ID = "id";
+ @SerializedName(SERIALIZED_NAME_ID)
+ @javax.annotation.Nonnull
+ private String id;
+
+ public static final String SERIALIZED_NAME_OWNER = "owner";
+ @SerializedName(SERIALIZED_NAME_OWNER)
+ @javax.annotation.Nonnull
+ private String owner;
+
+ public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId";
+ @SerializedName(SERIALIZED_NAME_APPLICATION_ID)
+ @javax.annotation.Nonnull
+ private String applicationId;
+
+ public static final String SERIALIZED_NAME_TIME = "time";
+ @SerializedName(SERIALIZED_NAME_TIME)
+ @javax.annotation.Nonnull
+ private OffsetDateTime time;
+
+ public static final String SERIALIZED_NAME_SEGMENT_COUNT = "segmentCount";
+ @SerializedName(SERIALIZED_NAME_SEGMENT_COUNT)
+ @javax.annotation.Nonnull
+ private Integer segmentCount;
+
+ public static final String SERIALIZED_NAME_DIRECTION = "direction";
+ @SerializedName(SERIALIZED_NAME_DIRECTION)
+ @javax.annotation.Nonnull
+ private MessageDirectionEnum direction;
+
+ public static final String SERIALIZED_NAME_TO = "to";
+ @SerializedName(SERIALIZED_NAME_TO)
+ @javax.annotation.Nonnull
+ private Set to = new LinkedHashSet<>();
+
+ public static final String SERIALIZED_NAME_FROM = "from";
+ @SerializedName(SERIALIZED_NAME_FROM)
+ @javax.annotation.Nonnull
+ private String from;
+
+ public static final String SERIALIZED_NAME_TEXT = "text";
+ @SerializedName(SERIALIZED_NAME_TEXT)
+ @javax.annotation.Nullable
+ private String text;
+
+ public static final String SERIALIZED_NAME_TAG = "tag";
+ @SerializedName(SERIALIZED_NAME_TAG)
+ @javax.annotation.Nullable
+ private String tag;
+
+ public static final String SERIALIZED_NAME_MEDIA = "media";
+ @SerializedName(SERIALIZED_NAME_MEDIA)
+ @javax.annotation.Nullable
+ private List media = new ArrayList<>();
+
+ public static final String SERIALIZED_NAME_PRIORITY = "priority";
+ @SerializedName(SERIALIZED_NAME_PRIORITY)
+ @javax.annotation.Nullable
+ private PriorityEnum priority;
+
+ public static final String SERIALIZED_NAME_CHANNEL = "channel";
+ @SerializedName(SERIALIZED_NAME_CHANNEL)
+ @javax.annotation.Nullable
+ private MultiChannelMessageChannelEnum channel;
+
+ public static final String SERIALIZED_NAME_CONTENT = "content";
+ @SerializedName(SERIALIZED_NAME_CONTENT)
+ @javax.annotation.Nullable
+ private MultiChannelMessageContent content;
+
+ public static final String SERIALIZED_NAME_SUGGESTION_RESPONSE = "suggestionResponse";
+ @SerializedName(SERIALIZED_NAME_SUGGESTION_RESPONSE)
+ @javax.annotation.Nullable
+ private RbmSuggestionResponse suggestionResponse;
+
+ public static final String SERIALIZED_NAME_LOCATION_RESPONSE = "locationResponse";
+ @SerializedName(SERIALIZED_NAME_LOCATION_RESPONSE)
+ @javax.annotation.Nullable
+ private RbmLocationResponse locationResponse;
+
+ public InboundCallbackMessage() {
+ }
+
+ public InboundCallbackMessage id(@javax.annotation.Nonnull String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * A unique identifier of the message.
+ * @return id
+ */
+ @javax.annotation.Nonnull
+ public String getId() {
+ return id;
+ }
+
+ public void setId(@javax.annotation.Nonnull String id) {
+ this.id = id;
+ }
+
+
+ public InboundCallbackMessage owner(@javax.annotation.Nonnull String owner) {
+ this.owner = owner;
+ return this;
+ }
+
+ /**
+ * The Bandwidth phone number or alphanumeric identifier associated with the message.
+ * @return owner
+ */
+ @javax.annotation.Nonnull
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(@javax.annotation.Nonnull String owner) {
+ this.owner = owner;
+ }
+
+
+ public InboundCallbackMessage applicationId(@javax.annotation.Nonnull String applicationId) {
+ this.applicationId = applicationId;
+ return this;
+ }
+
+ /**
+ * The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
+ * @return applicationId
+ */
+ @javax.annotation.Nonnull
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(@javax.annotation.Nonnull String applicationId) {
+ this.applicationId = applicationId;
+ }
+
+
+ public InboundCallbackMessage time(@javax.annotation.Nonnull OffsetDateTime time) {
+ this.time = time;
+ return this;
+ }
+
+ /**
+ * Get time
+ * @return time
+ */
+ @javax.annotation.Nonnull
+ public OffsetDateTime getTime() {
+ return time;
+ }
+
+ public void setTime(@javax.annotation.Nonnull OffsetDateTime time) {
+ this.time = time;
+ }
+
+
+ public InboundCallbackMessage segmentCount(@javax.annotation.Nonnull Integer segmentCount) {
+ this.segmentCount = segmentCount;
+ return this;
+ }
+
+ /**
+ * The number of segments the user's message is broken into before sending over carrier networks.
+ * @return segmentCount
+ */
+ @javax.annotation.Nonnull
+ public Integer getSegmentCount() {
+ return segmentCount;
+ }
+
+ public void setSegmentCount(@javax.annotation.Nonnull Integer segmentCount) {
+ this.segmentCount = segmentCount;
+ }
+
+
+ public InboundCallbackMessage direction(@javax.annotation.Nonnull MessageDirectionEnum direction) {
+ this.direction = direction;
+ return this;
+ }
+
+ /**
+ * Get direction
+ * @return direction
+ */
+ @javax.annotation.Nonnull
+ public MessageDirectionEnum getDirection() {
+ return direction;
+ }
+
+ public void setDirection(@javax.annotation.Nonnull MessageDirectionEnum direction) {
+ this.direction = direction;
+ }
+
+
+ public InboundCallbackMessage to(@javax.annotation.Nonnull Set to) {
+ this.to = to;
+ return this;
+ }
+
+ public InboundCallbackMessage addToItem(String toItem) {
+ if (this.to == null) {
+ this.to = new LinkedHashSet<>();
+ }
+ this.to.add(toItem);
+ return this;
+ }
+
+ /**
+ * The phone number recipients of the message.
+ * @return to
+ */
+ @javax.annotation.Nonnull
+ public Set getTo() {
+ return to;
+ }
+
+ public void setTo(@javax.annotation.Nonnull Set to) {
+ this.to = to;
+ }
+
+
+ public InboundCallbackMessage from(@javax.annotation.Nonnull String from) {
+ this.from = from;
+ return this;
+ }
+
+ /**
+ * The Bandwidth phone number or alphanumeric identifier the message was sent from.
+ * @return from
+ */
+ @javax.annotation.Nonnull
+ public String getFrom() {
+ return from;
+ }
+
+ public void setFrom(@javax.annotation.Nonnull String from) {
+ this.from = from;
+ }
+
+
+ public InboundCallbackMessage text(@javax.annotation.Nullable String text) {
+ this.text = text;
+ return this;
+ }
+
+ /**
+ * Get text
+ * @return text
+ */
+ @javax.annotation.Nullable
+ public String getText() {
+ return text;
+ }
+
+ public void setText(@javax.annotation.Nullable String text) {
+ this.text = text;
+ }
+
+
+ public InboundCallbackMessage tag(@javax.annotation.Nullable String tag) {
+ this.tag = tag;
+ return this;
+ }
+
+ /**
+ * A custom string that will be included in callback events of the message. Max 1024 characters.
+ * @return tag
+ */
+ @javax.annotation.Nullable
+ public String getTag() {
+ return tag;
+ }
+
+ public void setTag(@javax.annotation.Nullable String tag) {
+ this.tag = tag;
+ }
+
+
+ public InboundCallbackMessage media(@javax.annotation.Nullable List media) {
+ this.media = media;
+ return this;
+ }
+
+ public InboundCallbackMessage addMediaItem(URI mediaItem) {
+ if (this.media == null) {
+ this.media = new ArrayList<>();
+ }
+ this.media.add(mediaItem);
+ return this;
+ }
+
+ /**
+ * Optional media, not applicable for sms
+ * @return media
+ */
+ @javax.annotation.Nullable
+ public List getMedia() {
+ return media;
+ }
+
+ public void setMedia(@javax.annotation.Nullable List media) {
+ this.media = media;
+ }
+
+
+ public InboundCallbackMessage priority(@javax.annotation.Nullable PriorityEnum priority) {
+ this.priority = priority;
+ return this;
+ }
+
+ /**
+ * Get priority
+ * @return priority
+ */
+ @javax.annotation.Nullable
+ public PriorityEnum getPriority() {
+ return priority;
+ }
+
+ public void setPriority(@javax.annotation.Nullable PriorityEnum priority) {
+ this.priority = priority;
+ }
+
+
+ public InboundCallbackMessage channel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ this.channel = channel;
+ return this;
+ }
+
+ /**
+ * Get channel
+ * @return channel
+ */
+ @javax.annotation.Nullable
+ public MultiChannelMessageChannelEnum getChannel() {
+ return channel;
+ }
+
+ public void setChannel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ this.channel = channel;
+ }
+
+
+ public InboundCallbackMessage content(@javax.annotation.Nullable MultiChannelMessageContent content) {
+ this.content = content;
+ return this;
+ }
+
+ /**
+ * Get content
+ * @return content
+ */
+ @javax.annotation.Nullable
+ public MultiChannelMessageContent getContent() {
+ return content;
+ }
+
+ public void setContent(@javax.annotation.Nullable MultiChannelMessageContent content) {
+ this.content = content;
+ }
+
+
+ public InboundCallbackMessage suggestionResponse(@javax.annotation.Nullable RbmSuggestionResponse suggestionResponse) {
+ this.suggestionResponse = suggestionResponse;
+ return this;
+ }
+
+ /**
+ * Get suggestionResponse
+ * @return suggestionResponse
+ */
+ @javax.annotation.Nullable
+ public RbmSuggestionResponse getSuggestionResponse() {
+ return suggestionResponse;
+ }
+
+ public void setSuggestionResponse(@javax.annotation.Nullable RbmSuggestionResponse suggestionResponse) {
+ this.suggestionResponse = suggestionResponse;
+ }
+
+
+ public InboundCallbackMessage locationResponse(@javax.annotation.Nullable RbmLocationResponse locationResponse) {
+ this.locationResponse = locationResponse;
+ return this;
+ }
+
+ /**
+ * Get locationResponse
+ * @return locationResponse
+ */
+ @javax.annotation.Nullable
+ public RbmLocationResponse getLocationResponse() {
+ return locationResponse;
+ }
+
+ public void setLocationResponse(@javax.annotation.Nullable RbmLocationResponse locationResponse) {
+ this.locationResponse = locationResponse;
+ }
+
+ /**
+ * 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 InboundCallbackMessage instance itself
+ */
+ public InboundCallbackMessage 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;
+ }
+ InboundCallbackMessage inboundCallbackMessage = (InboundCallbackMessage) o;
+ return Objects.equals(this.id, inboundCallbackMessage.id) &&
+ Objects.equals(this.owner, inboundCallbackMessage.owner) &&
+ Objects.equals(this.applicationId, inboundCallbackMessage.applicationId) &&
+ Objects.equals(this.time, inboundCallbackMessage.time) &&
+ Objects.equals(this.segmentCount, inboundCallbackMessage.segmentCount) &&
+ Objects.equals(this.direction, inboundCallbackMessage.direction) &&
+ Objects.equals(this.to, inboundCallbackMessage.to) &&
+ Objects.equals(this.from, inboundCallbackMessage.from) &&
+ Objects.equals(this.text, inboundCallbackMessage.text) &&
+ Objects.equals(this.tag, inboundCallbackMessage.tag) &&
+ Objects.equals(this.media, inboundCallbackMessage.media) &&
+ Objects.equals(this.priority, inboundCallbackMessage.priority) &&
+ Objects.equals(this.channel, inboundCallbackMessage.channel) &&
+ Objects.equals(this.content, inboundCallbackMessage.content) &&
+ Objects.equals(this.suggestionResponse, inboundCallbackMessage.suggestionResponse) &&
+ Objects.equals(this.locationResponse, inboundCallbackMessage.locationResponse)&&
+ Objects.equals(this.additionalProperties, inboundCallbackMessage.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, owner, applicationId, time, segmentCount, direction, to, from, text, tag, media, priority, channel, content, suggestionResponse, locationResponse, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class InboundCallbackMessage {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
+ sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
+ sb.append(" time: ").append(toIndentedString(time)).append("\n");
+ sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n");
+ sb.append(" direction: ").append(toIndentedString(direction)).append("\n");
+ sb.append(" to: ").append(toIndentedString(to)).append("\n");
+ sb.append(" from: ").append(toIndentedString(from)).append("\n");
+ sb.append(" text: ").append(toIndentedString(text)).append("\n");
+ sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
+ sb.append(" media: ").append(toIndentedString(media)).append("\n");
+ sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
+ sb.append(" channel: ").append(toIndentedString(channel)).append("\n");
+ sb.append(" content: ").append(toIndentedString(content)).append("\n");
+ sb.append(" suggestionResponse: ").append(toIndentedString(suggestionResponse)).append("\n");
+ sb.append(" locationResponse: ").append(toIndentedString(locationResponse)).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();
+ openapiFields.add("id");
+ openapiFields.add("owner");
+ openapiFields.add("applicationId");
+ openapiFields.add("time");
+ openapiFields.add("segmentCount");
+ openapiFields.add("direction");
+ openapiFields.add("to");
+ openapiFields.add("from");
+ openapiFields.add("text");
+ openapiFields.add("tag");
+ openapiFields.add("media");
+ openapiFields.add("priority");
+ openapiFields.add("channel");
+ openapiFields.add("content");
+ openapiFields.add("suggestionResponse");
+ openapiFields.add("locationResponse");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("id");
+ openapiRequiredFields.add("owner");
+ openapiRequiredFields.add("applicationId");
+ openapiRequiredFields.add("time");
+ openapiRequiredFields.add("segmentCount");
+ openapiRequiredFields.add("direction");
+ openapiRequiredFields.add("to");
+ openapiRequiredFields.add("from");
+ }
+
+ /**
+ * 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 InboundCallbackMessage
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!InboundCallbackMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in InboundCallbackMessage is not found in the empty JSON string", InboundCallbackMessage.openapiRequiredFields.toString()));
+ }
+ }
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : InboundCallbackMessage.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
+ }
+ }
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if (!jsonObj.get("id").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
+ }
+ if (!jsonObj.get("owner").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString()));
+ }
+ if (!jsonObj.get("applicationId").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `applicationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationId").toString()));
+ }
+ // validate the required field `direction`
+ MessageDirectionEnum.validateJsonElement(jsonObj.get("direction"));
+ // ensure the required json array is present
+ if (jsonObj.get("to") == null) {
+ throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
+ } else if (!jsonObj.get("to").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
+ }
+ if (!jsonObj.get("from").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
+ }
+ if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
+ }
+ if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString()));
+ }
+ // ensure the optional json data is an array if present
+ if (jsonObj.get("media") != null && !jsonObj.get("media").isJsonNull() && !jsonObj.get("media").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `media` to be an array in the JSON string but got `%s`", jsonObj.get("media").toString()));
+ }
+ // validate the optional field `priority`
+ if (jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) {
+ PriorityEnum.validateJsonElement(jsonObj.get("priority"));
+ }
+ // validate the optional field `channel`
+ if (jsonObj.get("channel") != null && !jsonObj.get("channel").isJsonNull()) {
+ MultiChannelMessageChannelEnum.validateJsonElement(jsonObj.get("channel"));
+ }
+ // validate the optional field `content`
+ if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
+ MultiChannelMessageContent.validateJsonElement(jsonObj.get("content"));
+ }
+ // validate the optional field `suggestionResponse`
+ if (jsonObj.get("suggestionResponse") != null && !jsonObj.get("suggestionResponse").isJsonNull()) {
+ RbmSuggestionResponse.validateJsonElement(jsonObj.get("suggestionResponse"));
+ }
+ // validate the optional field `locationResponse`
+ if (jsonObj.get("locationResponse") != null && !jsonObj.get("locationResponse").isJsonNull()) {
+ RbmLocationResponse.validateJsonElement(jsonObj.get("locationResponse"));
+ }
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!InboundCallbackMessage.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'InboundCallbackMessage' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(InboundCallbackMessage.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, InboundCallbackMessage 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 InboundCallbackMessage read(JsonReader in) throws IOException {
+ JsonElement jsonElement = elementAdapter.read(in);
+ validateJsonElement(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ InboundCallbackMessage 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("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 InboundCallbackMessage given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of InboundCallbackMessage
+ * @throws IOException if the JSON string is invalid with respect to InboundCallbackMessage
+ */
+ public static InboundCallbackMessage fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, InboundCallbackMessage.class);
+ }
+
+ /**
+ * Convert an instance of InboundCallbackMessage 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/InboundCallbackTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java
new file mode 100644
index 00000000..fa8eeb3c
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java
@@ -0,0 +1,80 @@
+/*
+ * 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 com.google.gson.annotations.SerializedName;
+
+import java.io.IOException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.JsonElement;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.stream.JsonReader;
+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.
+ */
+@JsonAdapter(InboundCallbackTypeEnum.Adapter.class)
+public enum InboundCallbackTypeEnum {
+
+ MESSAGE_RECEIVED("message-received"),
+
+ REQUEST_LOCATION_RESPONSE("request-location-response"),
+
+ SUGGESTION_RESPONSE("suggestion-response");
+
+ private String value;
+
+ InboundCallbackTypeEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static InboundCallbackTypeEnum fromValue(String value) {
+ for (InboundCallbackTypeEnum b : InboundCallbackTypeEnum.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 InboundCallbackTypeEnum enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue());
+ }
+
+ @Override
+ public InboundCallbackTypeEnum read(final JsonReader jsonReader) throws IOException {
+ String value = jsonReader.nextString();
+ return InboundCallbackTypeEnum.fromValue(value);
+ }
+ }
+
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ String value = jsonElement.getAsString();
+ InboundCallbackTypeEnum.fromValue(value);
+ }
+}
+
diff --git a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java
index 8791e5c8..611e2633 100644
--- a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java
+++ b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java
@@ -282,7 +282,7 @@ public ListMessageItem segmentCount(@javax.annotation.Nullable Integer segmentCo
}
/**
- * The number of segments the message was sent as.
+ * The number of segments the user's message is broken into before sending over carrier networks.
* @return segmentCount
*/
@javax.annotation.Nullable
diff --git a/src/main/java/com/bandwidth/sdk/model/Message.java b/src/main/java/com/bandwidth/sdk/model/Message.java
index 6f31b41f..33749830 100644
--- a/src/main/java/com/bandwidth/sdk/model/Message.java
+++ b/src/main/java/com/bandwidth/sdk/model/Message.java
@@ -167,7 +167,7 @@ public Message applicationId(@javax.annotation.Nullable String applicationId) {
}
/**
- * The application ID associated with the message.
+ * The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
* @return applicationId
*/
@javax.annotation.Nullable
@@ -205,7 +205,7 @@ public Message segmentCount(@javax.annotation.Nullable Integer segmentCount) {
}
/**
- * The number of segments the original message from the user is broken into before sending over to carrier networks.
+ * The number of segments the user's message is broken into before sending over carrier networks.
* @return segmentCount
*/
@javax.annotation.Nullable
@@ -335,7 +335,7 @@ public Message tag(@javax.annotation.Nullable String tag) {
}
/**
- * The custom string set by the user.
+ * A custom string that will be included in callback events of the message. Max 1024 characters.
* @return tag
*/
@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 3bdddf49..592eabf5 100644
--- a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java
+++ b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java
@@ -106,7 +106,7 @@ public MessageRequest applicationId(@javax.annotation.Nonnull String application
}
/**
- * The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.
+ * The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
* @return applicationId
*/
@javax.annotation.Nonnull
diff --git a/src/main/java/com/bandwidth/sdk/model/MmsMessageContent.java b/src/main/java/com/bandwidth/sdk/model/MmsMessageContent.java
index 75a7a2f9..cee4d1ae 100644
--- a/src/main/java/com/bandwidth/sdk/model/MmsMessageContent.java
+++ b/src/main/java/com/bandwidth/sdk/model/MmsMessageContent.java
@@ -14,13 +14,13 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
+import com.bandwidth.sdk.model.MmsMessageContentFile;
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.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -61,7 +61,7 @@ public class MmsMessageContent {
public static final String SERIALIZED_NAME_MEDIA = "media";
@SerializedName(SERIALIZED_NAME_MEDIA)
@javax.annotation.Nullable
- private List media = new ArrayList<>();
+ private List media = new ArrayList<>();
public MmsMessageContent() {
}
@@ -85,12 +85,12 @@ public void setText(@javax.annotation.Nullable String text) {
}
- public MmsMessageContent media(@javax.annotation.Nullable List media) {
+ public MmsMessageContent media(@javax.annotation.Nullable List media) {
this.media = media;
return this;
}
- public MmsMessageContent addMediaItem(URI mediaItem) {
+ public MmsMessageContent addMediaItem(MmsMessageContentFile mediaItem) {
if (this.media == null) {
this.media = new ArrayList<>();
}
@@ -99,15 +99,15 @@ public MmsMessageContent addMediaItem(URI mediaItem) {
}
/**
- * A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.
+ * Get media
* @return media
*/
@javax.annotation.Nullable
- public List getMedia() {
+ public List getMedia() {
return media;
}
- public void setMedia(@javax.annotation.Nullable List media) {
+ public void setMedia(@javax.annotation.Nullable List media) {
this.media = media;
}
@@ -228,9 +228,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
}
- // ensure the optional json data is an array if present
- if (jsonObj.get("media") != null && !jsonObj.get("media").isJsonNull() && !jsonObj.get("media").isJsonArray()) {
- throw new IllegalArgumentException(String.format("Expected the field `media` to be an array in the JSON string but got `%s`", jsonObj.get("media").toString()));
+ if (jsonObj.get("media") != null && !jsonObj.get("media").isJsonNull()) {
+ JsonArray jsonArraymedia = jsonObj.getAsJsonArray("media");
+ if (jsonArraymedia != null) {
+ // ensure the json data is an array
+ if (!jsonObj.get("media").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `media` to be an array in the JSON string but got `%s`", jsonObj.get("media").toString()));
+ }
+
+ // validate the optional field `media` (array)
+ for (int i = 0; i < jsonArraymedia.size(); i++) {
+ MmsMessageContentFile.validateJsonElement(jsonArraymedia.get(i));
+ };
+ }
}
}
diff --git a/src/main/java/com/bandwidth/sdk/model/DeferredResult.java b/src/main/java/com/bandwidth/sdk/model/MmsMessageContentFile.java
similarity index 69%
rename from src/main/java/com/bandwidth/sdk/model/DeferredResult.java
rename to src/main/java/com/bandwidth/sdk/model/MmsMessageContentFile.java
index bdd0a817..bbcab5ab 100644
--- a/src/main/java/com/bandwidth/sdk/model/DeferredResult.java
+++ b/src/main/java/com/bandwidth/sdk/model/MmsMessageContentFile.java
@@ -20,6 +20,7 @@
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
+import java.net.URI;
import java.util.Arrays;
import com.google.gson.Gson;
@@ -46,58 +47,34 @@
import com.bandwidth.sdk.JSON;
/**
- * DeferredResult
+ * MmsMessageContentFile
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class DeferredResult {
- public static final String SERIALIZED_NAME_RESULT = "result";
- @SerializedName(SERIALIZED_NAME_RESULT)
- @javax.annotation.Nullable
- private Object result;
-
- public static final String SERIALIZED_NAME_SET_OR_EXPIRED = "setOrExpired";
- @SerializedName(SERIALIZED_NAME_SET_OR_EXPIRED)
- @javax.annotation.Nullable
- private Boolean setOrExpired;
-
- public DeferredResult() {
- }
+public class MmsMessageContentFile {
+ public static final String SERIALIZED_NAME_FILE_URL = "fileUrl";
+ @SerializedName(SERIALIZED_NAME_FILE_URL)
+ @javax.annotation.Nonnull
+ private URI fileUrl;
- public DeferredResult result(@javax.annotation.Nullable Object result) {
- this.result = result;
- return this;
+ public MmsMessageContentFile() {
}
- /**
- * Get result
- * @return result
- */
- @javax.annotation.Nullable
- public Object getResult() {
- return result;
- }
-
- public void setResult(@javax.annotation.Nullable Object result) {
- this.result = result;
- }
-
-
- public DeferredResult setOrExpired(@javax.annotation.Nullable Boolean setOrExpired) {
- this.setOrExpired = setOrExpired;
+ public MmsMessageContentFile fileUrl(@javax.annotation.Nonnull URI fileUrl) {
+ this.fileUrl = fileUrl;
return this;
}
/**
- * Get setOrExpired
- * @return setOrExpired
+ * The URL of a media attachment. For MMS, the API limits file size to 3.5MB. Specific carriers and channels may have a smaller limit that could cause a large file to fail, see [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) for more details.
+ * @return fileUrl
*/
- @javax.annotation.Nullable
- public Boolean getSetOrExpired() {
- return setOrExpired;
+ @javax.annotation.Nonnull
+ public URI getFileUrl() {
+ return fileUrl;
}
- public void setSetOrExpired(@javax.annotation.Nullable Boolean setOrExpired) {
- this.setOrExpired = setOrExpired;
+ public void setFileUrl(@javax.annotation.Nonnull URI fileUrl) {
+ this.fileUrl = fileUrl;
}
/**
@@ -113,9 +90,9 @@ public void setSetOrExpired(@javax.annotation.Nullable Boolean setOrExpired) {
*
* @param key name of the property
* @param value value of the property
- * @return the DeferredResult instance itself
+ * @return the MmsMessageContentFile instance itself
*/
- public DeferredResult putAdditionalProperty(String key, Object value) {
+ public MmsMessageContentFile putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -154,23 +131,21 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- DeferredResult deferredResult = (DeferredResult) o;
- return Objects.equals(this.result, deferredResult.result) &&
- Objects.equals(this.setOrExpired, deferredResult.setOrExpired)&&
- Objects.equals(this.additionalProperties, deferredResult.additionalProperties);
+ MmsMessageContentFile mmsMessageContentFile = (MmsMessageContentFile) o;
+ return Objects.equals(this.fileUrl, mmsMessageContentFile.fileUrl)&&
+ Objects.equals(this.additionalProperties, mmsMessageContentFile.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(result, setOrExpired, additionalProperties);
+ return Objects.hash(fileUrl, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class DeferredResult {\n");
- sb.append(" result: ").append(toIndentedString(result)).append("\n");
- sb.append(" setOrExpired: ").append(toIndentedString(setOrExpired)).append("\n");
+ sb.append("class MmsMessageContentFile {\n");
+ sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -194,42 +169,52 @@ private String toIndentedString(Object o) {
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
- openapiFields.add("result");
- openapiFields.add("setOrExpired");
+ openapiFields.add("fileUrl");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("fileUrl");
}
/**
* 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 DeferredResult
+ * @throws IOException if the JSON Element is invalid with respect to MmsMessageContentFile
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!DeferredResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in DeferredResult is not found in the empty JSON string", DeferredResult.openapiRequiredFields.toString()));
+ if (!MmsMessageContentFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in MmsMessageContentFile is not found in the empty JSON string", MmsMessageContentFile.openapiRequiredFields.toString()));
+ }
+ }
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : MmsMessageContentFile.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if (!jsonObj.get("fileUrl").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `fileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileUrl").toString()));
+ }
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!DeferredResult.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'DeferredResult' and its subtypes
+ if (!MmsMessageContentFile.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'MmsMessageContentFile' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(DeferredResult.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(MmsMessageContentFile.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, DeferredResult value) throws IOException {
+ public void write(JsonWriter out, MmsMessageContentFile value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -257,12 +242,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public DeferredResult read(JsonReader in) throws IOException {
+ public MmsMessageContentFile read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- DeferredResult instance = thisAdapter.fromJsonTree(jsonObj);
+ MmsMessageContentFile instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -289,18 +274,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of DeferredResult given an JSON string
+ * Create an instance of MmsMessageContentFile given an JSON string
*
* @param jsonString JSON string
- * @return An instance of DeferredResult
- * @throws IOException if the JSON string is invalid with respect to DeferredResult
+ * @return An instance of MmsMessageContentFile
+ * @throws IOException if the JSON string is invalid with respect to MmsMessageContentFile
*/
- public static DeferredResult fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, DeferredResult.class);
+ public static MmsMessageContentFile fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, MmsMessageContentFile.class);
}
/**
- * Convert an instance of DeferredResult to an JSON string
+ * Convert an instance of MmsMessageContentFile to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelActionCalendarEvent.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelActionCalendarEvent.java
index 776b958e..58de6e0d 100644
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelActionCalendarEvent.java
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelActionCalendarEvent.java
@@ -62,10 +62,10 @@ public class MultiChannelActionCalendarEvent {
@javax.annotation.Nonnull
private String text;
- public static final String SERIALIZED_NAME_POST_BACK_DATA = "postBackData";
- @SerializedName(SERIALIZED_NAME_POST_BACK_DATA)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nonnull
- private byte[] postBackData;
+ private byte[] postbackData;
public static final String SERIALIZED_NAME_TITLE = "title";
@SerializedName(SERIALIZED_NAME_TITLE)
@@ -128,22 +128,22 @@ public void setText(@javax.annotation.Nonnull String text) {
}
- public MultiChannelActionCalendarEvent postBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public MultiChannelActionCalendarEvent postbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
* Base64 payload the customer receives when the reply is clicked.
- * @return postBackData
+ * @return postbackData
*/
@javax.annotation.Nonnull
- public byte[] getPostBackData() {
- return postBackData;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setPostBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public void setPostbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
}
@@ -279,7 +279,7 @@ public boolean equals(Object o) {
MultiChannelActionCalendarEvent multiChannelActionCalendarEvent = (MultiChannelActionCalendarEvent) o;
return Objects.equals(this.type, multiChannelActionCalendarEvent.type) &&
Objects.equals(this.text, multiChannelActionCalendarEvent.text) &&
- Arrays.equals(this.postBackData, multiChannelActionCalendarEvent.postBackData) &&
+ Arrays.equals(this.postbackData, multiChannelActionCalendarEvent.postbackData) &&
Objects.equals(this.title, multiChannelActionCalendarEvent.title) &&
Objects.equals(this.startTime, multiChannelActionCalendarEvent.startTime) &&
Objects.equals(this.endTime, multiChannelActionCalendarEvent.endTime) &&
@@ -289,7 +289,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
- return Objects.hash(type, text, Arrays.hashCode(postBackData), title, startTime, endTime, description, additionalProperties);
+ return Objects.hash(type, text, Arrays.hashCode(postbackData), title, startTime, endTime, description, additionalProperties);
}
@Override
@@ -298,7 +298,7 @@ public String toString() {
sb.append("class MultiChannelActionCalendarEvent {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
- sb.append(" postBackData: ").append(toIndentedString(postBackData)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n");
sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n");
@@ -328,7 +328,7 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet();
openapiFields.add("type");
openapiFields.add("text");
- openapiFields.add("postBackData");
+ openapiFields.add("postbackData");
openapiFields.add("title");
openapiFields.add("startTime");
openapiFields.add("endTime");
@@ -338,7 +338,7 @@ private String toIndentedString(Object o) {
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("text");
- openapiRequiredFields.add("postBackData");
+ openapiRequiredFields.add("postbackData");
openapiRequiredFields.add("title");
openapiRequiredFields.add("startTime");
openapiRequiredFields.add("endTime");
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelChannelListObjectContent.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelChannelListObjectContent.java
index c7106409..0dfbbcee 100644
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelChannelListObjectContent.java
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelChannelListObjectContent.java
@@ -16,6 +16,7 @@
import java.util.Objects;
import com.bandwidth.sdk.model.CardWidthEnum;
import com.bandwidth.sdk.model.MmsMessageContent;
+import com.bandwidth.sdk.model.MmsMessageContentFile;
import com.bandwidth.sdk.model.MultiChannelAction;
import com.bandwidth.sdk.model.RbmCardContent;
import com.bandwidth.sdk.model.RbmMessageContentRichCard;
@@ -30,7 +31,6 @@
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
-import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelError.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelError.java
new file mode 100644
index 00000000..9104dd19
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelError.java
@@ -0,0 +1,398 @@
+/*
+ * 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 com.bandwidth.sdk.model.ErrorObject;
+import com.bandwidth.sdk.model.Link;
+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.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+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 com.bandwidth.sdk.JSON;
+
+/**
+ * MultiChannelError
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class MultiChannelError {
+ public static final String SERIALIZED_NAME_LINKS = "links";
+ @SerializedName(SERIALIZED_NAME_LINKS)
+ @javax.annotation.Nullable
+ private List links = new ArrayList<>();
+
+ public static final String SERIALIZED_NAME_DATA = "data";
+ @SerializedName(SERIALIZED_NAME_DATA)
+ @javax.annotation.Nullable
+ private Object data;
+
+ public static final String SERIALIZED_NAME_ERRORS = "errors";
+ @SerializedName(SERIALIZED_NAME_ERRORS)
+ @javax.annotation.Nullable
+ private List errors = new ArrayList<>();
+
+ public MultiChannelError() {
+ }
+
+ public MultiChannelError links(@javax.annotation.Nullable List links) {
+ this.links = links;
+ return this;
+ }
+
+ public MultiChannelError addLinksItem(Link linksItem) {
+ if (this.links == null) {
+ this.links = new ArrayList<>();
+ }
+ this.links.add(linksItem);
+ return this;
+ }
+
+ /**
+ * Get links
+ * @return links
+ */
+ @javax.annotation.Nullable
+ public List getLinks() {
+ return links;
+ }
+
+ public void setLinks(@javax.annotation.Nullable List links) {
+ this.links = links;
+ }
+
+
+ public MultiChannelError data(@javax.annotation.Nullable Object data) {
+ this.data = data;
+ return this;
+ }
+
+ /**
+ * Get data
+ * @return data
+ */
+ @javax.annotation.Nullable
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(@javax.annotation.Nullable Object data) {
+ this.data = data;
+ }
+
+
+ public MultiChannelError errors(@javax.annotation.Nullable List errors) {
+ this.errors = errors;
+ return this;
+ }
+
+ public MultiChannelError addErrorsItem(ErrorObject errorsItem) {
+ if (this.errors == null) {
+ this.errors = new ArrayList<>();
+ }
+ this.errors.add(errorsItem);
+ return this;
+ }
+
+ /**
+ * Get errors
+ * @return errors
+ */
+ @javax.annotation.Nullable
+ public List getErrors() {
+ return errors;
+ }
+
+ public void setErrors(@javax.annotation.Nullable List errors) {
+ this.errors = errors;
+ }
+
+ /**
+ * 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 MultiChannelError instance itself
+ */
+ public MultiChannelError 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;
+ }
+ MultiChannelError multiChannelError = (MultiChannelError) o;
+ return Objects.equals(this.links, multiChannelError.links) &&
+ Objects.equals(this.data, multiChannelError.data) &&
+ Objects.equals(this.errors, multiChannelError.errors)&&
+ Objects.equals(this.additionalProperties, multiChannelError.additionalProperties);
+ }
+
+ private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
+ return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(links, data, errors, additionalProperties);
+ }
+
+ private static int hashCodeNullable(JsonNullable a) {
+ if (a == null) {
+ return 1;
+ }
+ return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class MultiChannelError {\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");
+ 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();
+ openapiFields.add("links");
+ openapiFields.add("data");
+ openapiFields.add("errors");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ }
+
+ /**
+ * 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 MultiChannelError
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!MultiChannelError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelError is not found in the empty JSON string", MultiChannelError.openapiRequiredFields.toString()));
+ }
+ }
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull()) {
+ JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links");
+ if (jsonArraylinks != null) {
+ // ensure the json data is an array
+ if (!jsonObj.get("links").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString()));
+ }
+
+ // validate the optional field `links` (array)
+ for (int i = 0; i < jsonArraylinks.size(); i++) {
+ Link.validateJsonElement(jsonArraylinks.get(i));
+ };
+ }
+ }
+ if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull()) {
+ JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors");
+ if (jsonArrayerrors != null) {
+ // ensure the json data is an array
+ if (!jsonObj.get("errors").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString()));
+ }
+
+ // validate the optional field `errors` (array)
+ for (int i = 0; i < jsonArrayerrors.size(); i++) {
+ ErrorObject.validateJsonElement(jsonArrayerrors.get(i));
+ };
+ }
+ }
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!MultiChannelError.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'MultiChannelError' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelError.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, MultiChannelError 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 MultiChannelError read(JsonReader in) throws IOException {
+ JsonElement jsonElement = elementAdapter.read(in);
+ validateJsonElement(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ MultiChannelError 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("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 MultiChannelError given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of MultiChannelError
+ * @throws IOException if the JSON string is invalid with respect to MultiChannelError
+ */
+ public static MultiChannelError fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, MultiChannelError.class);
+ }
+
+ /**
+ * Convert an instance of MultiChannelError 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/MultiChannelMessageContent.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageContent.java
new file mode 100644
index 00000000..2d26e40f
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageContent.java
@@ -0,0 +1,319 @@
+/*
+ * 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 com.bandwidth.sdk.model.RbmMessageContentFile;
+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 com.bandwidth.sdk.JSON;
+
+/**
+ * The structure of the content field of a multichannel message.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class MultiChannelMessageContent {
+ public static final String SERIALIZED_NAME_TEXT = "text";
+ @SerializedName(SERIALIZED_NAME_TEXT)
+ @javax.annotation.Nullable
+ private String text;
+
+ public static final String SERIALIZED_NAME_MEDIA = "media";
+ @SerializedName(SERIALIZED_NAME_MEDIA)
+ @javax.annotation.Nullable
+ private RbmMessageContentFile media;
+
+ public MultiChannelMessageContent() {
+ }
+
+ public MultiChannelMessageContent text(@javax.annotation.Nullable String text) {
+ this.text = text;
+ return this;
+ }
+
+ /**
+ * Get text
+ * @return text
+ */
+ @javax.annotation.Nullable
+ public String getText() {
+ return text;
+ }
+
+ public void setText(@javax.annotation.Nullable String text) {
+ this.text = text;
+ }
+
+
+ public MultiChannelMessageContent media(@javax.annotation.Nullable RbmMessageContentFile media) {
+ this.media = media;
+ return this;
+ }
+
+ /**
+ * Get media
+ * @return media
+ */
+ @javax.annotation.Nullable
+ public RbmMessageContentFile getMedia() {
+ return media;
+ }
+
+ public void setMedia(@javax.annotation.Nullable RbmMessageContentFile media) {
+ this.media = media;
+ }
+
+ /**
+ * 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 MultiChannelMessageContent instance itself
+ */
+ public MultiChannelMessageContent 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;
+ }
+ MultiChannelMessageContent multiChannelMessageContent = (MultiChannelMessageContent) o;
+ return Objects.equals(this.text, multiChannelMessageContent.text) &&
+ Objects.equals(this.media, multiChannelMessageContent.media)&&
+ Objects.equals(this.additionalProperties, multiChannelMessageContent.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(text, media, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class MultiChannelMessageContent {\n");
+ sb.append(" text: ").append(toIndentedString(text)).append("\n");
+ sb.append(" media: ").append(toIndentedString(media)).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();
+ openapiFields.add("text");
+ openapiFields.add("media");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ }
+
+ /**
+ * 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 MultiChannelMessageContent
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!MultiChannelMessageContent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelMessageContent is not found in the empty JSON string", MultiChannelMessageContent.openapiRequiredFields.toString()));
+ }
+ }
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
+ }
+ // validate the optional field `media`
+ if (jsonObj.get("media") != null && !jsonObj.get("media").isJsonNull()) {
+ RbmMessageContentFile.validateJsonElement(jsonObj.get("media"));
+ }
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!MultiChannelMessageContent.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'MultiChannelMessageContent' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelMessageContent.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, MultiChannelMessageContent 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 MultiChannelMessageContent read(JsonReader in) throws IOException {
+ JsonElement jsonElement = elementAdapter.read(in);
+ validateJsonElement(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ MultiChannelMessageContent 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("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 MultiChannelMessageContent given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of MultiChannelMessageContent
+ * @throws IOException if the JSON string is invalid with respect to MultiChannelMessageContent
+ */
+ public static MultiChannelMessageContent fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, MultiChannelMessageContent.class);
+ }
+
+ /**
+ * Convert an instance of MultiChannelMessageContent 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/MultiChannelMessageDirectionEnum.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageDirectionEnum.java
deleted file mode 100644
index f548e871..00000000
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageDirectionEnum.java
+++ /dev/null
@@ -1,78 +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 com.google.gson.annotations.SerializedName;
-
-import java.io.IOException;
-import com.google.gson.TypeAdapter;
-import com.google.gson.JsonElement;
-import com.google.gson.annotations.JsonAdapter;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonWriter;
-
-/**
- * Gets or Sets multiChannelMessageDirectionEnum
- */
-@JsonAdapter(MultiChannelMessageDirectionEnum.Adapter.class)
-public enum MultiChannelMessageDirectionEnum {
-
- INBOUND("INBOUND"),
-
- OUTBOUND("OUTBOUND");
-
- private String value;
-
- MultiChannelMessageDirectionEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- public static MultiChannelMessageDirectionEnum fromValue(String value) {
- for (MultiChannelMessageDirectionEnum b : MultiChannelMessageDirectionEnum.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 MultiChannelMessageDirectionEnum enumeration) throws IOException {
- jsonWriter.value(enumeration.getValue());
- }
-
- @Override
- public MultiChannelMessageDirectionEnum read(final JsonReader jsonReader) throws IOException {
- String value = jsonReader.nextString();
- return MultiChannelMessageDirectionEnum.fromValue(value);
- }
- }
-
- public static void validateJsonElement(JsonElement jsonElement) throws IOException {
- String value = jsonElement.getAsString();
- MultiChannelMessageDirectionEnum.fromValue(value);
- }
-}
-
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageData.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseData.java
similarity index 56%
rename from src/main/java/com/bandwidth/sdk/model/MultiChannelMessageData.java
rename to src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseData.java
index 02184db2..f1684e1c 100644
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageData.java
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseData.java
@@ -14,9 +14,9 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
-import com.bandwidth.sdk.model.MultiChannelMessageChannelEnum;
-import com.bandwidth.sdk.model.MultiChannelMessageDirectionEnum;
-import com.bandwidth.sdk.model.MultiChannelStatusEnum;
+import com.bandwidth.sdk.model.MessageDirectionEnum;
+import com.bandwidth.sdk.model.MultiChannelMessageResponseDataChannelListInner;
+import com.bandwidth.sdk.model.PriorityEnum;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -24,7 +24,11 @@
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.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -50,59 +54,54 @@
import com.bandwidth.sdk.JSON;
/**
- * MultiChannelMessageData
+ * The data returned in a multichannel message response.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class MultiChannelMessageData {
+public class MultiChannelMessageResponseData {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private String messageId;
- public static final String SERIALIZED_NAME_STATUS = "status";
- @SerializedName(SERIALIZED_NAME_STATUS)
- @javax.annotation.Nullable
- private MultiChannelStatusEnum status;
-
public static final String SERIALIZED_NAME_TIME = "time";
@SerializedName(SERIALIZED_NAME_TIME)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private OffsetDateTime time;
public static final String SERIALIZED_NAME_DIRECTION = "direction";
@SerializedName(SERIALIZED_NAME_DIRECTION)
- @javax.annotation.Nullable
- private MultiChannelMessageDirectionEnum direction;
-
- public static final String SERIALIZED_NAME_FROM = "from";
- @SerializedName(SERIALIZED_NAME_FROM)
- @javax.annotation.Nullable
- private String from;
+ @javax.annotation.Nonnull
+ private MessageDirectionEnum direction;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
- @javax.annotation.Nullable
- private String to;
+ @javax.annotation.Nonnull
+ private Set to = new LinkedHashSet<>();
- public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId";
- @SerializedName(SERIALIZED_NAME_APPLICATION_ID)
- @javax.annotation.Nullable
- private String applicationId;
-
- public static final String SERIALIZED_NAME_CHANNEL = "channel";
- @SerializedName(SERIALIZED_NAME_CHANNEL)
- @javax.annotation.Nullable
- private MultiChannelMessageChannelEnum channel;
+ public static final String SERIALIZED_NAME_CHANNEL_LIST = "channelList";
+ @SerializedName(SERIALIZED_NAME_CHANNEL_LIST)
+ @javax.annotation.Nonnull
+ private List channelList = new ArrayList<>();
public static final String SERIALIZED_NAME_TAG = "tag";
@SerializedName(SERIALIZED_NAME_TAG)
@javax.annotation.Nullable
private String tag;
- public MultiChannelMessageData() {
+ public static final String SERIALIZED_NAME_PRIORITY = "priority";
+ @SerializedName(SERIALIZED_NAME_PRIORITY)
+ @javax.annotation.Nullable
+ private PriorityEnum priority;
+
+ public static final String SERIALIZED_NAME_EXPIRATION = "expiration";
+ @SerializedName(SERIALIZED_NAME_EXPIRATION)
+ @javax.annotation.Nullable
+ private OffsetDateTime expiration;
+
+ public MultiChannelMessageResponseData() {
}
- public MultiChannelMessageData messageId(@javax.annotation.Nullable String messageId) {
+ public MultiChannelMessageResponseData messageId(@javax.annotation.Nonnull String messageId) {
this.messageId = messageId;
return this;
}
@@ -111,36 +110,17 @@ public MultiChannelMessageData messageId(@javax.annotation.Nullable String messa
* The ID of the message.
* @return messageId
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public String getMessageId() {
return messageId;
}
- public void setMessageId(@javax.annotation.Nullable String messageId) {
+ public void setMessageId(@javax.annotation.Nonnull String messageId) {
this.messageId = messageId;
}
- public MultiChannelMessageData status(@javax.annotation.Nullable MultiChannelStatusEnum status) {
- this.status = status;
- return this;
- }
-
- /**
- * Get status
- * @return status
- */
- @javax.annotation.Nullable
- public MultiChannelStatusEnum getStatus() {
- return status;
- }
-
- public void setStatus(@javax.annotation.Nullable MultiChannelStatusEnum status) {
- this.status = status;
- }
-
-
- public MultiChannelMessageData time(@javax.annotation.Nullable OffsetDateTime time) {
+ public MultiChannelMessageResponseData time(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
return this;
}
@@ -149,17 +129,17 @@ public MultiChannelMessageData time(@javax.annotation.Nullable OffsetDateTime ti
* The time the message was received by the Bandwidth API.
* @return time
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public OffsetDateTime getTime() {
return time;
}
- public void setTime(@javax.annotation.Nullable OffsetDateTime time) {
+ public void setTime(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
}
- public MultiChannelMessageData direction(@javax.annotation.Nullable MultiChannelMessageDirectionEnum direction) {
+ public MultiChannelMessageResponseData direction(@javax.annotation.Nonnull MessageDirectionEnum direction) {
this.direction = direction;
return this;
}
@@ -168,108 +148,124 @@ public MultiChannelMessageData direction(@javax.annotation.Nullable MultiChannel
* Get direction
* @return direction
*/
- @javax.annotation.Nullable
- public MultiChannelMessageDirectionEnum getDirection() {
+ @javax.annotation.Nonnull
+ public MessageDirectionEnum getDirection() {
return direction;
}
- public void setDirection(@javax.annotation.Nullable MultiChannelMessageDirectionEnum direction) {
+ public void setDirection(@javax.annotation.Nonnull MessageDirectionEnum direction) {
this.direction = direction;
}
- public MultiChannelMessageData from(@javax.annotation.Nullable String from) {
- this.from = from;
+ public MultiChannelMessageResponseData to(@javax.annotation.Nonnull Set to) {
+ this.to = to;
+ return this;
+ }
+
+ public MultiChannelMessageResponseData addToItem(String toItem) {
+ if (this.to == null) {
+ this.to = new LinkedHashSet<>();
+ }
+ this.to.add(toItem);
return this;
}
/**
- * The sender ID of the message. This could be an alphanumeric sender ID.
- * @return from
+ * The destination phone number(s) of the message, in E164 format.
+ * @return to
*/
- @javax.annotation.Nullable
- public String getFrom() {
- return from;
+ @javax.annotation.Nonnull
+ public Set getTo() {
+ return to;
}
- public void setFrom(@javax.annotation.Nullable String from) {
- this.from = from;
+ public void setTo(@javax.annotation.Nonnull Set to) {
+ this.to = to;
}
- public MultiChannelMessageData to(@javax.annotation.Nullable String to) {
- this.to = to;
+ public MultiChannelMessageResponseData channelList(@javax.annotation.Nonnull List channelList) {
+ this.channelList = channelList;
+ return this;
+ }
+
+ public MultiChannelMessageResponseData addChannelListItem(MultiChannelMessageResponseDataChannelListInner channelListItem) {
+ if (this.channelList == null) {
+ this.channelList = new ArrayList<>();
+ }
+ this.channelList.add(channelListItem);
return this;
}
/**
- * The phone number the message should be sent to in E164 format.
- * @return to
+ * A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored.
+ * @return channelList
*/
- @javax.annotation.Nullable
- public String getTo() {
- return to;
+ @javax.annotation.Nonnull
+ public List getChannelList() {
+ return channelList;
}
- public void setTo(@javax.annotation.Nullable String to) {
- this.to = to;
+ public void setChannelList(@javax.annotation.Nonnull List channelList) {
+ this.channelList = channelList;
}
- public MultiChannelMessageData applicationId(@javax.annotation.Nullable String applicationId) {
- this.applicationId = applicationId;
+ public MultiChannelMessageResponseData tag(@javax.annotation.Nullable String tag) {
+ this.tag = tag;
return this;
}
/**
- * The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
- * @return applicationId
+ * A custom string that will be included in callback events of the message. Max 1024 characters.
+ * @return tag
*/
@javax.annotation.Nullable
- public String getApplicationId() {
- return applicationId;
+ public String getTag() {
+ return tag;
}
- public void setApplicationId(@javax.annotation.Nullable String applicationId) {
- this.applicationId = applicationId;
+ public void setTag(@javax.annotation.Nullable String tag) {
+ this.tag = tag;
}
- public MultiChannelMessageData channel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
- this.channel = channel;
+ public MultiChannelMessageResponseData priority(@javax.annotation.Nullable PriorityEnum priority) {
+ this.priority = priority;
return this;
}
/**
- * Get channel
- * @return channel
+ * Get priority
+ * @return priority
*/
@javax.annotation.Nullable
- public MultiChannelMessageChannelEnum getChannel() {
- return channel;
+ public PriorityEnum getPriority() {
+ return priority;
}
- public void setChannel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
- this.channel = channel;
+ public void setPriority(@javax.annotation.Nullable PriorityEnum priority) {
+ this.priority = priority;
}
- public MultiChannelMessageData tag(@javax.annotation.Nullable String tag) {
- this.tag = tag;
+ public MultiChannelMessageResponseData expiration(@javax.annotation.Nullable OffsetDateTime expiration) {
+ this.expiration = expiration;
return this;
}
/**
- * A custom string that will be included in callback events of the message. Max 1024 characters.
- * @return tag
+ * A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future.
+ * @return expiration
*/
@javax.annotation.Nullable
- public String getTag() {
- return tag;
+ public OffsetDateTime getExpiration() {
+ return expiration;
}
- public void setTag(@javax.annotation.Nullable String tag) {
- this.tag = tag;
+ public void setExpiration(@javax.annotation.Nullable OffsetDateTime expiration) {
+ this.expiration = expiration;
}
/**
@@ -285,9 +281,9 @@ public void setTag(@javax.annotation.Nullable String tag) {
*
* @param key name of the property
* @param value value of the property
- * @return the MultiChannelMessageData instance itself
+ * @return the MultiChannelMessageResponseData instance itself
*/
- public MultiChannelMessageData putAdditionalProperty(String key, Object value) {
+ public MultiChannelMessageResponseData putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -326,37 +322,35 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- MultiChannelMessageData multiChannelMessageData = (MultiChannelMessageData) o;
- return Objects.equals(this.messageId, multiChannelMessageData.messageId) &&
- Objects.equals(this.status, multiChannelMessageData.status) &&
- Objects.equals(this.time, multiChannelMessageData.time) &&
- Objects.equals(this.direction, multiChannelMessageData.direction) &&
- Objects.equals(this.from, multiChannelMessageData.from) &&
- Objects.equals(this.to, multiChannelMessageData.to) &&
- Objects.equals(this.applicationId, multiChannelMessageData.applicationId) &&
- Objects.equals(this.channel, multiChannelMessageData.channel) &&
- Objects.equals(this.tag, multiChannelMessageData.tag)&&
- Objects.equals(this.additionalProperties, multiChannelMessageData.additionalProperties);
+ MultiChannelMessageResponseData multiChannelMessageResponseData = (MultiChannelMessageResponseData) o;
+ return Objects.equals(this.messageId, multiChannelMessageResponseData.messageId) &&
+ Objects.equals(this.time, multiChannelMessageResponseData.time) &&
+ Objects.equals(this.direction, multiChannelMessageResponseData.direction) &&
+ Objects.equals(this.to, multiChannelMessageResponseData.to) &&
+ Objects.equals(this.channelList, multiChannelMessageResponseData.channelList) &&
+ Objects.equals(this.tag, multiChannelMessageResponseData.tag) &&
+ Objects.equals(this.priority, multiChannelMessageResponseData.priority) &&
+ Objects.equals(this.expiration, multiChannelMessageResponseData.expiration)&&
+ Objects.equals(this.additionalProperties, multiChannelMessageResponseData.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(messageId, status, time, direction, from, to, applicationId, channel, tag, additionalProperties);
+ return Objects.hash(messageId, time, direction, to, channelList, tag, priority, expiration, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class MultiChannelMessageData {\n");
+ sb.append("class MultiChannelMessageResponseData {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
- sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" time: ").append(toIndentedString(time)).append("\n");
sb.append(" direction: ").append(toIndentedString(direction)).append("\n");
- sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
- sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
- sb.append(" channel: ").append(toIndentedString(channel)).append("\n");
+ sb.append(" channelList: ").append(toIndentedString(channelList)).append("\n");
sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
+ sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
+ sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -381,75 +375,87 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("messageId");
- openapiFields.add("status");
openapiFields.add("time");
openapiFields.add("direction");
- openapiFields.add("from");
openapiFields.add("to");
- openapiFields.add("applicationId");
- openapiFields.add("channel");
+ openapiFields.add("channelList");
openapiFields.add("tag");
+ openapiFields.add("priority");
+ openapiFields.add("expiration");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("messageId");
+ openapiRequiredFields.add("time");
+ openapiRequiredFields.add("direction");
+ openapiRequiredFields.add("to");
+ openapiRequiredFields.add("channelList");
}
/**
* 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 MultiChannelMessageData
+ * @throws IOException if the JSON Element is invalid with respect to MultiChannelMessageResponseData
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!MultiChannelMessageData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelMessageData is not found in the empty JSON string", MultiChannelMessageData.openapiRequiredFields.toString()));
+ if (!MultiChannelMessageResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelMessageResponseData is not found in the empty JSON string", MultiChannelMessageResponseData.openapiRequiredFields.toString()));
+ }
+ }
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : MultiChannelMessageResponseData.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
- if ((jsonObj.get("messageId") != null && !jsonObj.get("messageId").isJsonNull()) && !jsonObj.get("messageId").isJsonPrimitive()) {
+ if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
- // validate the optional field `status`
- if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) {
- MultiChannelStatusEnum.validateJsonElement(jsonObj.get("status"));
- }
- // validate the optional field `direction`
- if (jsonObj.get("direction") != null && !jsonObj.get("direction").isJsonNull()) {
- MultiChannelMessageDirectionEnum.validateJsonElement(jsonObj.get("direction"));
- }
- if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
+ // validate the required field `direction`
+ MessageDirectionEnum.validateJsonElement(jsonObj.get("direction"));
+ // ensure the required json array is present
+ if (jsonObj.get("to") == null) {
+ throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
+ } else if (!jsonObj.get("to").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
- if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
- }
- if ((jsonObj.get("applicationId") != null && !jsonObj.get("applicationId").isJsonNull()) && !jsonObj.get("applicationId").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `applicationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationId").toString()));
- }
- // validate the optional field `channel`
- if (jsonObj.get("channel") != null && !jsonObj.get("channel").isJsonNull()) {
- MultiChannelMessageChannelEnum.validateJsonElement(jsonObj.get("channel"));
+ // ensure the json data is an array
+ if (!jsonObj.get("channelList").isJsonArray()) {
+ throw new IllegalArgumentException(String.format("Expected the field `channelList` to be an array in the JSON string but got `%s`", jsonObj.get("channelList").toString()));
}
+
+ JsonArray jsonArraychannelList = jsonObj.getAsJsonArray("channelList");
+ // validate the required field `channelList` (array)
+ for (int i = 0; i < jsonArraychannelList.size(); i++) {
+ MultiChannelMessageResponseDataChannelListInner.validateJsonElement(jsonArraychannelList.get(i));
+ };
if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString()));
}
+ // validate the optional field `priority`
+ if (jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) {
+ PriorityEnum.validateJsonElement(jsonObj.get("priority"));
+ }
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!MultiChannelMessageData.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'MultiChannelMessageData' and its subtypes
+ if (!MultiChannelMessageResponseData.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'MultiChannelMessageResponseData' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelMessageData.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelMessageResponseData.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, MultiChannelMessageData value) throws IOException {
+ public void write(JsonWriter out, MultiChannelMessageResponseData value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -477,12 +483,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public MultiChannelMessageData read(JsonReader in) throws IOException {
+ public MultiChannelMessageResponseData read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- MultiChannelMessageData instance = thisAdapter.fromJsonTree(jsonObj);
+ MultiChannelMessageResponseData instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -509,18 +515,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of MultiChannelMessageData given an JSON string
+ * Create an instance of MultiChannelMessageResponseData given an JSON string
*
* @param jsonString JSON string
- * @return An instance of MultiChannelMessageData
- * @throws IOException if the JSON string is invalid with respect to MultiChannelMessageData
+ * @return An instance of MultiChannelMessageResponseData
+ * @throws IOException if the JSON string is invalid with respect to MultiChannelMessageResponseData
*/
- public static MultiChannelMessageData fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, MultiChannelMessageData.class);
+ public static MultiChannelMessageResponseData fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, MultiChannelMessageResponseData.class);
}
/**
- * Convert an instance of MultiChannelMessageData to an JSON string
+ * Convert an instance of MultiChannelMessageResponseData to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageCallbackData.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseDataChannelListInner.java
similarity index 54%
rename from src/main/java/com/bandwidth/sdk/model/MultiChannelMessageCallbackData.java
rename to src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseDataChannelListInner.java
index a0019733..7454f1e8 100644
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageCallbackData.java
+++ b/src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseDataChannelListInner.java
@@ -14,9 +14,8 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
+import com.bandwidth.sdk.model.MultiChannelChannelListObjectContent;
import com.bandwidth.sdk.model.MultiChannelMessageChannelEnum;
-import com.bandwidth.sdk.model.MultiChannelMessageDirectionEnum;
-import com.bandwidth.sdk.model.MultiChannelStatusEnum;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -49,111 +48,39 @@
import com.bandwidth.sdk.JSON;
/**
- * MultiChannelMessageCallbackData
+ * MultiChannelMessageResponseDataChannelListInner
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class MultiChannelMessageCallbackData {
- public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
- @SerializedName(SERIALIZED_NAME_MESSAGE_ID)
- @javax.annotation.Nullable
- private String messageId;
-
- public static final String SERIALIZED_NAME_STATUS = "status";
- @SerializedName(SERIALIZED_NAME_STATUS)
- @javax.annotation.Nullable
- private MultiChannelStatusEnum status;
-
- public static final String SERIALIZED_NAME_DIRECTION = "direction";
- @SerializedName(SERIALIZED_NAME_DIRECTION)
- @javax.annotation.Nullable
- private MultiChannelMessageDirectionEnum direction;
-
+public class MultiChannelMessageResponseDataChannelListInner {
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private String from;
- public static final String SERIALIZED_NAME_TO = "to";
- @SerializedName(SERIALIZED_NAME_TO)
- @javax.annotation.Nullable
- private String to;
-
public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId";
@SerializedName(SERIALIZED_NAME_APPLICATION_ID)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private String applicationId;
public static final String SERIALIZED_NAME_CHANNEL = "channel";
@SerializedName(SERIALIZED_NAME_CHANNEL)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private MultiChannelMessageChannelEnum channel;
- public static final String SERIALIZED_NAME_TAG = "tag";
- @SerializedName(SERIALIZED_NAME_TAG)
- @javax.annotation.Nullable
- private String tag;
-
- public MultiChannelMessageCallbackData() {
- }
-
- public MultiChannelMessageCallbackData messageId(@javax.annotation.Nullable String messageId) {
- this.messageId = messageId;
- return this;
- }
-
- /**
- * The ID of the message.
- * @return messageId
- */
- @javax.annotation.Nullable
- public String getMessageId() {
- return messageId;
- }
-
- public void setMessageId(@javax.annotation.Nullable String messageId) {
- this.messageId = messageId;
- }
-
-
- public MultiChannelMessageCallbackData status(@javax.annotation.Nullable MultiChannelStatusEnum status) {
- this.status = status;
- return this;
- }
-
- /**
- * Get status
- * @return status
- */
- @javax.annotation.Nullable
- public MultiChannelStatusEnum getStatus() {
- return status;
- }
-
- public void setStatus(@javax.annotation.Nullable MultiChannelStatusEnum status) {
- this.status = status;
- }
+ public static final String SERIALIZED_NAME_CONTENT = "content";
+ @SerializedName(SERIALIZED_NAME_CONTENT)
+ @javax.annotation.Nonnull
+ private MultiChannelChannelListObjectContent content;
+ public static final String SERIALIZED_NAME_OWNER = "owner";
+ @SerializedName(SERIALIZED_NAME_OWNER)
+ @javax.annotation.Nonnull
+ private String owner;
- public MultiChannelMessageCallbackData direction(@javax.annotation.Nullable MultiChannelMessageDirectionEnum direction) {
- this.direction = direction;
- return this;
- }
-
- /**
- * Get direction
- * @return direction
- */
- @javax.annotation.Nullable
- public MultiChannelMessageDirectionEnum getDirection() {
- return direction;
- }
-
- public void setDirection(@javax.annotation.Nullable MultiChannelMessageDirectionEnum direction) {
- this.direction = direction;
+ public MultiChannelMessageResponseDataChannelListInner() {
}
-
- public MultiChannelMessageCallbackData from(@javax.annotation.Nullable String from) {
+ public MultiChannelMessageResponseDataChannelListInner from(@javax.annotation.Nonnull String from) {
this.from = from;
return this;
}
@@ -162,36 +89,17 @@ public MultiChannelMessageCallbackData from(@javax.annotation.Nullable String fr
* The sender ID of the message. This could be an alphanumeric sender ID.
* @return from
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public String getFrom() {
return from;
}
- public void setFrom(@javax.annotation.Nullable String from) {
+ public void setFrom(@javax.annotation.Nonnull String from) {
this.from = from;
}
- public MultiChannelMessageCallbackData to(@javax.annotation.Nullable String to) {
- this.to = to;
- return this;
- }
-
- /**
- * The phone number the message should be sent to in E164 format.
- * @return to
- */
- @javax.annotation.Nullable
- public String getTo() {
- return to;
- }
-
- public void setTo(@javax.annotation.Nullable String to) {
- this.to = to;
- }
-
-
- public MultiChannelMessageCallbackData applicationId(@javax.annotation.Nullable String applicationId) {
+ public MultiChannelMessageResponseDataChannelListInner applicationId(@javax.annotation.Nonnull String applicationId) {
this.applicationId = applicationId;
return this;
}
@@ -200,17 +108,17 @@ public MultiChannelMessageCallbackData applicationId(@javax.annotation.Nullable
* The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
* @return applicationId
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public String getApplicationId() {
return applicationId;
}
- public void setApplicationId(@javax.annotation.Nullable String applicationId) {
+ public void setApplicationId(@javax.annotation.Nonnull String applicationId) {
this.applicationId = applicationId;
}
- public MultiChannelMessageCallbackData channel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ public MultiChannelMessageResponseDataChannelListInner channel(@javax.annotation.Nonnull MultiChannelMessageChannelEnum channel) {
this.channel = channel;
return this;
}
@@ -219,32 +127,51 @@ public MultiChannelMessageCallbackData channel(@javax.annotation.Nullable MultiC
* Get channel
* @return channel
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public MultiChannelMessageChannelEnum getChannel() {
return channel;
}
- public void setChannel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ public void setChannel(@javax.annotation.Nonnull MultiChannelMessageChannelEnum channel) {
this.channel = channel;
}
- public MultiChannelMessageCallbackData tag(@javax.annotation.Nullable String tag) {
- this.tag = tag;
+ public MultiChannelMessageResponseDataChannelListInner content(@javax.annotation.Nonnull MultiChannelChannelListObjectContent content) {
+ this.content = content;
return this;
}
/**
- * A custom string that will be included in callback events of the message. Max 1024 characters.
- * @return tag
+ * Get content
+ * @return content
*/
- @javax.annotation.Nullable
- public String getTag() {
- return tag;
+ @javax.annotation.Nonnull
+ public MultiChannelChannelListObjectContent getContent() {
+ return content;
}
- public void setTag(@javax.annotation.Nullable String tag) {
- this.tag = tag;
+ public void setContent(@javax.annotation.Nonnull MultiChannelChannelListObjectContent content) {
+ this.content = content;
+ }
+
+
+ public MultiChannelMessageResponseDataChannelListInner owner(@javax.annotation.Nonnull String owner) {
+ this.owner = owner;
+ return this;
+ }
+
+ /**
+ * The Bandwidth senderId associated with the message. Identical to 'from'.
+ * @return owner
+ */
+ @javax.annotation.Nonnull
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(@javax.annotation.Nonnull String owner) {
+ this.owner = owner;
}
/**
@@ -260,9 +187,9 @@ public void setTag(@javax.annotation.Nullable String tag) {
*
* @param key name of the property
* @param value value of the property
- * @return the MultiChannelMessageCallbackData instance itself
+ * @return the MultiChannelMessageResponseDataChannelListInner instance itself
*/
- public MultiChannelMessageCallbackData putAdditionalProperty(String key, Object value) {
+ public MultiChannelMessageResponseDataChannelListInner putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -301,35 +228,29 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- MultiChannelMessageCallbackData multiChannelMessageCallbackData = (MultiChannelMessageCallbackData) o;
- return Objects.equals(this.messageId, multiChannelMessageCallbackData.messageId) &&
- Objects.equals(this.status, multiChannelMessageCallbackData.status) &&
- Objects.equals(this.direction, multiChannelMessageCallbackData.direction) &&
- Objects.equals(this.from, multiChannelMessageCallbackData.from) &&
- Objects.equals(this.to, multiChannelMessageCallbackData.to) &&
- Objects.equals(this.applicationId, multiChannelMessageCallbackData.applicationId) &&
- Objects.equals(this.channel, multiChannelMessageCallbackData.channel) &&
- Objects.equals(this.tag, multiChannelMessageCallbackData.tag)&&
- Objects.equals(this.additionalProperties, multiChannelMessageCallbackData.additionalProperties);
+ MultiChannelMessageResponseDataChannelListInner multiChannelMessageResponseDataChannelListInner = (MultiChannelMessageResponseDataChannelListInner) o;
+ return Objects.equals(this.from, multiChannelMessageResponseDataChannelListInner.from) &&
+ Objects.equals(this.applicationId, multiChannelMessageResponseDataChannelListInner.applicationId) &&
+ Objects.equals(this.channel, multiChannelMessageResponseDataChannelListInner.channel) &&
+ Objects.equals(this.content, multiChannelMessageResponseDataChannelListInner.content) &&
+ Objects.equals(this.owner, multiChannelMessageResponseDataChannelListInner.owner)&&
+ Objects.equals(this.additionalProperties, multiChannelMessageResponseDataChannelListInner.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(messageId, status, direction, from, to, applicationId, channel, tag, additionalProperties);
+ return Objects.hash(from, applicationId, channel, content, owner, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class MultiChannelMessageCallbackData {\n");
- sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
- sb.append(" status: ").append(toIndentedString(status)).append("\n");
- sb.append(" direction: ").append(toIndentedString(direction)).append("\n");
+ sb.append("class MultiChannelMessageResponseDataChannelListInner {\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
- sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n");
sb.append(" channel: ").append(toIndentedString(channel)).append("\n");
- sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
+ sb.append(" content: ").append(toIndentedString(content)).append("\n");
+ sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -353,58 +274,53 @@ private String toIndentedString(Object o) {
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
- openapiFields.add("messageId");
- openapiFields.add("status");
- openapiFields.add("direction");
openapiFields.add("from");
- openapiFields.add("to");
openapiFields.add("applicationId");
openapiFields.add("channel");
- openapiFields.add("tag");
+ openapiFields.add("content");
+ openapiFields.add("owner");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("from");
+ openapiRequiredFields.add("applicationId");
+ openapiRequiredFields.add("channel");
+ openapiRequiredFields.add("content");
+ openapiRequiredFields.add("owner");
}
/**
* 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 MultiChannelMessageCallbackData
+ * @throws IOException if the JSON Element is invalid with respect to MultiChannelMessageResponseDataChannelListInner
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!MultiChannelMessageCallbackData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelMessageCallbackData is not found in the empty JSON string", MultiChannelMessageCallbackData.openapiRequiredFields.toString()));
+ if (!MultiChannelMessageResponseDataChannelListInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelMessageResponseDataChannelListInner is not found in the empty JSON string", MultiChannelMessageResponseDataChannelListInner.openapiRequiredFields.toString()));
}
}
- JsonObject jsonObj = jsonElement.getAsJsonObject();
- if ((jsonObj.get("messageId") != null && !jsonObj.get("messageId").isJsonNull()) && !jsonObj.get("messageId").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
- }
- // validate the optional field `status`
- if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) {
- MultiChannelStatusEnum.validateJsonElement(jsonObj.get("status"));
- }
- // validate the optional field `direction`
- if (jsonObj.get("direction") != null && !jsonObj.get("direction").isJsonNull()) {
- MultiChannelMessageDirectionEnum.validateJsonElement(jsonObj.get("direction"));
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : MultiChannelMessageResponseDataChannelListInner.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
+ }
}
- if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if (!jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
- if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
- }
- if ((jsonObj.get("applicationId") != null && !jsonObj.get("applicationId").isJsonNull()) && !jsonObj.get("applicationId").isJsonPrimitive()) {
+ if (!jsonObj.get("applicationId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `applicationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationId").toString()));
}
- // validate the optional field `channel`
- if (jsonObj.get("channel") != null && !jsonObj.get("channel").isJsonNull()) {
- MultiChannelMessageChannelEnum.validateJsonElement(jsonObj.get("channel"));
- }
- if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString()));
+ // validate the required field `channel`
+ MultiChannelMessageChannelEnum.validateJsonElement(jsonObj.get("channel"));
+ // validate the required field `content`
+ MultiChannelChannelListObjectContent.validateJsonElement(jsonObj.get("content"));
+ if (!jsonObj.get("owner").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString()));
}
}
@@ -412,16 +328,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!MultiChannelMessageCallbackData.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'MultiChannelMessageCallbackData' and its subtypes
+ if (!MultiChannelMessageResponseDataChannelListInner.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'MultiChannelMessageResponseDataChannelListInner' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelMessageCallbackData.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelMessageResponseDataChannelListInner.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, MultiChannelMessageCallbackData value) throws IOException {
+ public void write(JsonWriter out, MultiChannelMessageResponseDataChannelListInner value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -449,12 +365,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public MultiChannelMessageCallbackData read(JsonReader in) throws IOException {
+ public MultiChannelMessageResponseDataChannelListInner read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- MultiChannelMessageCallbackData instance = thisAdapter.fromJsonTree(jsonObj);
+ MultiChannelMessageResponseDataChannelListInner instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -481,18 +397,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of MultiChannelMessageCallbackData given an JSON string
+ * Create an instance of MultiChannelMessageResponseDataChannelListInner given an JSON string
*
* @param jsonString JSON string
- * @return An instance of MultiChannelMessageCallbackData
- * @throws IOException if the JSON string is invalid with respect to MultiChannelMessageCallbackData
+ * @return An instance of MultiChannelMessageResponseDataChannelListInner
+ * @throws IOException if the JSON string is invalid with respect to MultiChannelMessageResponseDataChannelListInner
*/
- public static MultiChannelMessageCallbackData fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, MultiChannelMessageCallbackData.class);
+ public static MultiChannelMessageResponseDataChannelListInner fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, MultiChannelMessageResponseDataChannelListInner.class);
}
/**
- * Convert an instance of MultiChannelMessageCallbackData to an JSON string
+ * Convert an instance of MultiChannelMessageResponseDataChannelListInner to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelStatusEnum.java b/src/main/java/com/bandwidth/sdk/model/MultiChannelStatusEnum.java
deleted file mode 100644
index 8a4eda18..00000000
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelStatusEnum.java
+++ /dev/null
@@ -1,82 +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 com.google.gson.annotations.SerializedName;
-
-import java.io.IOException;
-import com.google.gson.TypeAdapter;
-import com.google.gson.JsonElement;
-import com.google.gson.annotations.JsonAdapter;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonWriter;
-
-/**
- * Gets or Sets multiChannelStatusEnum
- */
-@JsonAdapter(MultiChannelStatusEnum.Adapter.class)
-public enum MultiChannelStatusEnum {
-
- QUEUED("QUEUED"),
-
- SENDING("SENDING"),
-
- DELIVERED("DELIVERED"),
-
- FAILED("FAILED");
-
- private String value;
-
- MultiChannelStatusEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- public static MultiChannelStatusEnum fromValue(String value) {
- for (MultiChannelStatusEnum b : MultiChannelStatusEnum.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 MultiChannelStatusEnum enumeration) throws IOException {
- jsonWriter.value(enumeration.getValue());
- }
-
- @Override
- public MultiChannelStatusEnum read(final JsonReader jsonReader) throws IOException {
- String value = jsonReader.nextString();
- return MultiChannelStatusEnum.fromValue(value);
- }
- }
-
- public static void validateJsonElement(JsonElement jsonElement) throws IOException {
- String value = jsonElement.getAsString();
- MultiChannelStatusEnum.fromValue(value);
- }
-}
-
diff --git a/src/main/java/com/bandwidth/sdk/model/PriorityEnum.java b/src/main/java/com/bandwidth/sdk/model/PriorityEnum.java
index 64cf09ed..26533e2c 100644
--- a/src/main/java/com/bandwidth/sdk/model/PriorityEnum.java
+++ b/src/main/java/com/bandwidth/sdk/model/PriorityEnum.java
@@ -24,7 +24,7 @@
import com.google.gson.stream.JsonWriter;
/**
- * The priority specified by the user.
+ * Specifies the message's sending priority with respect to other messages in your account. For best results and optimal throughput, reserve the 'high' priority setting for critical messages only.
*/
@JsonAdapter(PriorityEnum.Adapter.class)
public enum PriorityEnum {
diff --git a/src/main/java/com/bandwidth/sdk/model/RbmActionBase.java b/src/main/java/com/bandwidth/sdk/model/RbmActionBase.java
index eb52d415..a2f7a6f1 100644
--- a/src/main/java/com/bandwidth/sdk/model/RbmActionBase.java
+++ b/src/main/java/com/bandwidth/sdk/model/RbmActionBase.java
@@ -61,10 +61,10 @@ public class RbmActionBase {
@javax.annotation.Nonnull
private String text;
- public static final String SERIALIZED_NAME_POST_BACK_DATA = "postBackData";
- @SerializedName(SERIALIZED_NAME_POST_BACK_DATA)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nonnull
- private byte[] postBackData;
+ private byte[] postbackData;
public RbmActionBase() {
}
@@ -107,22 +107,22 @@ public void setText(@javax.annotation.Nonnull String text) {
}
- public RbmActionBase postBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public RbmActionBase postbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
* Base64 payload the customer receives when the reply is clicked.
- * @return postBackData
+ * @return postbackData
*/
@javax.annotation.Nonnull
- public byte[] getPostBackData() {
- return postBackData;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setPostBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public void setPostbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
}
/**
@@ -182,13 +182,13 @@ public boolean equals(Object o) {
RbmActionBase rbmActionBase = (RbmActionBase) o;
return Objects.equals(this.type, rbmActionBase.type) &&
Objects.equals(this.text, rbmActionBase.text) &&
- Arrays.equals(this.postBackData, rbmActionBase.postBackData)&&
+ Arrays.equals(this.postbackData, rbmActionBase.postbackData)&&
Objects.equals(this.additionalProperties, rbmActionBase.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(type, text, Arrays.hashCode(postBackData), additionalProperties);
+ return Objects.hash(type, text, Arrays.hashCode(postbackData), additionalProperties);
}
@Override
@@ -197,7 +197,7 @@ public String toString() {
sb.append("class RbmActionBase {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
- sb.append(" postBackData: ").append(toIndentedString(postBackData)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -223,13 +223,13 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet();
openapiFields.add("type");
openapiFields.add("text");
- openapiFields.add("postBackData");
+ openapiFields.add("postbackData");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("text");
- openapiRequiredFields.add("postBackData");
+ openapiRequiredFields.add("postbackData");
}
/**
diff --git a/src/main/java/com/bandwidth/sdk/model/RbmActionDial.java b/src/main/java/com/bandwidth/sdk/model/RbmActionDial.java
index 744191b4..4928d8ba 100644
--- a/src/main/java/com/bandwidth/sdk/model/RbmActionDial.java
+++ b/src/main/java/com/bandwidth/sdk/model/RbmActionDial.java
@@ -61,10 +61,10 @@ public class RbmActionDial {
@javax.annotation.Nonnull
private String text;
- public static final String SERIALIZED_NAME_POST_BACK_DATA = "postBackData";
- @SerializedName(SERIALIZED_NAME_POST_BACK_DATA)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nonnull
- private byte[] postBackData;
+ private byte[] postbackData;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
@@ -112,22 +112,22 @@ public void setText(@javax.annotation.Nonnull String text) {
}
- public RbmActionDial postBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public RbmActionDial postbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
* Base64 payload the customer receives when the reply is clicked.
- * @return postBackData
+ * @return postbackData
*/
@javax.annotation.Nonnull
- public byte[] getPostBackData() {
- return postBackData;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setPostBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public void setPostbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
}
@@ -206,14 +206,14 @@ public boolean equals(Object o) {
RbmActionDial rbmActionDial = (RbmActionDial) o;
return Objects.equals(this.type, rbmActionDial.type) &&
Objects.equals(this.text, rbmActionDial.text) &&
- Arrays.equals(this.postBackData, rbmActionDial.postBackData) &&
+ Arrays.equals(this.postbackData, rbmActionDial.postbackData) &&
Objects.equals(this.phoneNumber, rbmActionDial.phoneNumber)&&
Objects.equals(this.additionalProperties, rbmActionDial.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(type, text, Arrays.hashCode(postBackData), phoneNumber, additionalProperties);
+ return Objects.hash(type, text, Arrays.hashCode(postbackData), phoneNumber, additionalProperties);
}
@Override
@@ -222,7 +222,7 @@ public String toString() {
sb.append("class RbmActionDial {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
- sb.append(" postBackData: ").append(toIndentedString(postBackData)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
@@ -249,14 +249,14 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet();
openapiFields.add("type");
openapiFields.add("text");
- openapiFields.add("postBackData");
+ openapiFields.add("postbackData");
openapiFields.add("phoneNumber");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("text");
- openapiRequiredFields.add("postBackData");
+ openapiRequiredFields.add("postbackData");
openapiRequiredFields.add("phoneNumber");
}
diff --git a/src/main/java/com/bandwidth/sdk/model/RbmActionOpenUrl.java b/src/main/java/com/bandwidth/sdk/model/RbmActionOpenUrl.java
index 72875e55..6e9b7fe1 100644
--- a/src/main/java/com/bandwidth/sdk/model/RbmActionOpenUrl.java
+++ b/src/main/java/com/bandwidth/sdk/model/RbmActionOpenUrl.java
@@ -62,10 +62,10 @@ public class RbmActionOpenUrl {
@javax.annotation.Nonnull
private String text;
- public static final String SERIALIZED_NAME_POST_BACK_DATA = "postBackData";
- @SerializedName(SERIALIZED_NAME_POST_BACK_DATA)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nonnull
- private byte[] postBackData;
+ private byte[] postbackData;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
@@ -113,22 +113,22 @@ public void setText(@javax.annotation.Nonnull String text) {
}
- public RbmActionOpenUrl postBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public RbmActionOpenUrl postbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
* Base64 payload the customer receives when the reply is clicked.
- * @return postBackData
+ * @return postbackData
*/
@javax.annotation.Nonnull
- public byte[] getPostBackData() {
- return postBackData;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setPostBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public void setPostbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
}
@@ -207,14 +207,14 @@ public boolean equals(Object o) {
RbmActionOpenUrl rbmActionOpenUrl = (RbmActionOpenUrl) o;
return Objects.equals(this.type, rbmActionOpenUrl.type) &&
Objects.equals(this.text, rbmActionOpenUrl.text) &&
- Arrays.equals(this.postBackData, rbmActionOpenUrl.postBackData) &&
+ Arrays.equals(this.postbackData, rbmActionOpenUrl.postbackData) &&
Objects.equals(this.url, rbmActionOpenUrl.url)&&
Objects.equals(this.additionalProperties, rbmActionOpenUrl.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(type, text, Arrays.hashCode(postBackData), url, additionalProperties);
+ return Objects.hash(type, text, Arrays.hashCode(postbackData), url, additionalProperties);
}
@Override
@@ -223,7 +223,7 @@ public String toString() {
sb.append("class RbmActionOpenUrl {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
- sb.append(" postBackData: ").append(toIndentedString(postBackData)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
@@ -250,14 +250,14 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet();
openapiFields.add("type");
openapiFields.add("text");
- openapiFields.add("postBackData");
+ openapiFields.add("postbackData");
openapiFields.add("url");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("text");
- openapiRequiredFields.add("postBackData");
+ openapiRequiredFields.add("postbackData");
openapiRequiredFields.add("url");
}
diff --git a/src/main/java/com/bandwidth/sdk/model/RbmActionViewLocation.java b/src/main/java/com/bandwidth/sdk/model/RbmActionViewLocation.java
index fba28d2e..97bf52a5 100644
--- a/src/main/java/com/bandwidth/sdk/model/RbmActionViewLocation.java
+++ b/src/main/java/com/bandwidth/sdk/model/RbmActionViewLocation.java
@@ -61,10 +61,10 @@ public class RbmActionViewLocation {
@javax.annotation.Nonnull
private String text;
- public static final String SERIALIZED_NAME_POST_BACK_DATA = "postBackData";
- @SerializedName(SERIALIZED_NAME_POST_BACK_DATA)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nonnull
- private byte[] postBackData;
+ private byte[] postbackData;
public static final String SERIALIZED_NAME_LATITUDE = "latitude";
@SerializedName(SERIALIZED_NAME_LATITUDE)
@@ -122,22 +122,22 @@ public void setText(@javax.annotation.Nonnull String text) {
}
- public RbmActionViewLocation postBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public RbmActionViewLocation postbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
* Base64 payload the customer receives when the reply is clicked.
- * @return postBackData
+ * @return postbackData
*/
@javax.annotation.Nonnull
- public byte[] getPostBackData() {
- return postBackData;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setPostBackData(@javax.annotation.Nonnull byte[] postBackData) {
- this.postBackData = postBackData;
+ public void setPostbackData(@javax.annotation.Nonnull byte[] postbackData) {
+ this.postbackData = postbackData;
}
@@ -254,7 +254,7 @@ public boolean equals(Object o) {
RbmActionViewLocation rbmActionViewLocation = (RbmActionViewLocation) o;
return Objects.equals(this.type, rbmActionViewLocation.type) &&
Objects.equals(this.text, rbmActionViewLocation.text) &&
- Arrays.equals(this.postBackData, rbmActionViewLocation.postBackData) &&
+ Arrays.equals(this.postbackData, rbmActionViewLocation.postbackData) &&
Objects.equals(this.latitude, rbmActionViewLocation.latitude) &&
Objects.equals(this.longitude, rbmActionViewLocation.longitude) &&
Objects.equals(this.label, rbmActionViewLocation.label)&&
@@ -263,7 +263,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
- return Objects.hash(type, text, Arrays.hashCode(postBackData), latitude, longitude, label, additionalProperties);
+ return Objects.hash(type, text, Arrays.hashCode(postbackData), latitude, longitude, label, additionalProperties);
}
@Override
@@ -272,7 +272,7 @@ public String toString() {
sb.append("class RbmActionViewLocation {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
- sb.append(" postBackData: ").append(toIndentedString(postBackData)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n");
sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
@@ -301,7 +301,7 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet();
openapiFields.add("type");
openapiFields.add("text");
- openapiFields.add("postBackData");
+ openapiFields.add("postbackData");
openapiFields.add("latitude");
openapiFields.add("longitude");
openapiFields.add("label");
@@ -310,7 +310,7 @@ private String toIndentedString(Object o) {
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("type");
openapiRequiredFields.add("text");
- openapiRequiredFields.add("postBackData");
+ openapiRequiredFields.add("postbackData");
openapiRequiredFields.add("latitude");
openapiRequiredFields.add("longitude");
}
diff --git a/src/main/java/com/bandwidth/sdk/model/RbmLocationResponse.java b/src/main/java/com/bandwidth/sdk/model/RbmLocationResponse.java
new file mode 100644
index 00000000..250175fa
--- /dev/null
+++ b/src/main/java/com/bandwidth/sdk/model/RbmLocationResponse.java
@@ -0,0 +1,317 @@
+/*
+ * 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 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 com.bandwidth.sdk.JSON;
+
+/**
+ * RbmLocationResponse
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
+public class RbmLocationResponse {
+ public static final String SERIALIZED_NAME_LATITUDE = "latitude";
+ @SerializedName(SERIALIZED_NAME_LATITUDE)
+ @javax.annotation.Nullable
+ private Double latitude;
+
+ public static final String SERIALIZED_NAME_LONGITUDE = "longitude";
+ @SerializedName(SERIALIZED_NAME_LONGITUDE)
+ @javax.annotation.Nullable
+ private Double longitude;
+
+ public RbmLocationResponse() {
+ }
+
+ public RbmLocationResponse latitude(@javax.annotation.Nullable Double latitude) {
+ this.latitude = latitude;
+ return this;
+ }
+
+ /**
+ * The latitude of the client's location.
+ * @return latitude
+ */
+ @javax.annotation.Nullable
+ public Double getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(@javax.annotation.Nullable Double latitude) {
+ this.latitude = latitude;
+ }
+
+
+ public RbmLocationResponse longitude(@javax.annotation.Nullable Double longitude) {
+ this.longitude = longitude;
+ return this;
+ }
+
+ /**
+ * The longitude of the client's location.
+ * @return longitude
+ */
+ @javax.annotation.Nullable
+ public Double getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitude(@javax.annotation.Nullable Double longitude) {
+ this.longitude = longitude;
+ }
+
+ /**
+ * 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 RbmLocationResponse instance itself
+ */
+ public RbmLocationResponse 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;
+ }
+ RbmLocationResponse rbmLocationResponse = (RbmLocationResponse) o;
+ return Objects.equals(this.latitude, rbmLocationResponse.latitude) &&
+ Objects.equals(this.longitude, rbmLocationResponse.longitude)&&
+ Objects.equals(this.additionalProperties, rbmLocationResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(latitude, longitude, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class RbmLocationResponse {\n");
+ sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n");
+ sb.append(" longitude: ").append(toIndentedString(longitude)).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();
+ openapiFields.add("latitude");
+ openapiFields.add("longitude");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ }
+
+ /**
+ * 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 RbmLocationResponse
+ */
+ public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+ if (jsonElement == null) {
+ if (!RbmLocationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in RbmLocationResponse is not found in the empty JSON string", RbmLocationResponse.openapiRequiredFields.toString()));
+ }
+ }
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ if ((jsonObj.get("latitude") != null && !jsonObj.get("latitude").isJsonNull()) && !jsonObj.get("latitude").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `latitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latitude").toString()));
+ }
+ if ((jsonObj.get("longitude") != null && !jsonObj.get("longitude").isJsonNull()) && !jsonObj.get("longitude").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `longitude` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longitude").toString()));
+ }
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!RbmLocationResponse.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'RbmLocationResponse' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(RbmLocationResponse.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, RbmLocationResponse 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 RbmLocationResponse read(JsonReader in) throws IOException {
+ JsonElement jsonElement = elementAdapter.read(in);
+ validateJsonElement(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ RbmLocationResponse 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("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 RbmLocationResponse given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of RbmLocationResponse
+ * @throws IOException if the JSON string is invalid with respect to RbmLocationResponse
+ */
+ public static RbmLocationResponse fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, RbmLocationResponse.class);
+ }
+
+ /**
+ * Convert an instance of RbmLocationResponse 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/Tag.java b/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java
similarity index 70%
rename from src/main/java/com/bandwidth/sdk/model/Tag.java
rename to src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java
index f5d89d64..b5fd0185 100644
--- a/src/main/java/com/bandwidth/sdk/model/Tag.java
+++ b/src/main/java/com/bandwidth/sdk/model/RbmSuggestionResponse.java
@@ -46,58 +46,58 @@
import com.bandwidth.sdk.JSON;
/**
- * Tag
+ * RbmSuggestionResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class Tag {
- public static final String SERIALIZED_NAME_KEY = "key";
- @SerializedName(SERIALIZED_NAME_KEY)
+public class RbmSuggestionResponse {
+ public static final String SERIALIZED_NAME_TEXT = "text";
+ @SerializedName(SERIALIZED_NAME_TEXT)
@javax.annotation.Nullable
- private String key;
+ private String text;
- public static final String SERIALIZED_NAME_VALUE = "value";
- @SerializedName(SERIALIZED_NAME_VALUE)
+ public static final String SERIALIZED_NAME_POSTBACK_DATA = "postbackData";
+ @SerializedName(SERIALIZED_NAME_POSTBACK_DATA)
@javax.annotation.Nullable
- private String value;
+ private byte[] postbackData;
- public Tag() {
+ public RbmSuggestionResponse() {
}
- public Tag key(@javax.annotation.Nullable String key) {
- this.key = key;
+ public RbmSuggestionResponse text(@javax.annotation.Nullable String text) {
+ this.text = text;
return this;
}
/**
- * Get key
- * @return key
+ * The text associated with the suggestion response.
+ * @return text
*/
@javax.annotation.Nullable
- public String getKey() {
- return key;
+ public String getText() {
+ return text;
}
- public void setKey(@javax.annotation.Nullable String key) {
- this.key = key;
+ public void setText(@javax.annotation.Nullable String text) {
+ this.text = text;
}
- public Tag value(@javax.annotation.Nullable String value) {
- this.value = value;
+ public RbmSuggestionResponse postbackData(@javax.annotation.Nullable byte[] postbackData) {
+ this.postbackData = postbackData;
return this;
}
/**
- * Get value
- * @return value
+ * Base64 payload the customer receives when the reply is clicked.
+ * @return postbackData
*/
@javax.annotation.Nullable
- public String getValue() {
- return value;
+ public byte[] getPostbackData() {
+ return postbackData;
}
- public void setValue(@javax.annotation.Nullable String value) {
- this.value = value;
+ public void setPostbackData(@javax.annotation.Nullable byte[] postbackData) {
+ this.postbackData = postbackData;
}
/**
@@ -113,9 +113,9 @@ public void setValue(@javax.annotation.Nullable String value) {
*
* @param key name of the property
* @param value value of the property
- * @return the Tag instance itself
+ * @return the RbmSuggestionResponse instance itself
*/
- public Tag putAdditionalProperty(String key, Object value) {
+ public RbmSuggestionResponse putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -154,23 +154,23 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- Tag tag = (Tag) o;
- return Objects.equals(this.key, tag.key) &&
- Objects.equals(this.value, tag.value)&&
- Objects.equals(this.additionalProperties, tag.additionalProperties);
+ RbmSuggestionResponse rbmSuggestionResponse = (RbmSuggestionResponse) o;
+ return Objects.equals(this.text, rbmSuggestionResponse.text) &&
+ Arrays.equals(this.postbackData, rbmSuggestionResponse.postbackData)&&
+ Objects.equals(this.additionalProperties, rbmSuggestionResponse.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(key, value, additionalProperties);
+ return Objects.hash(text, Arrays.hashCode(postbackData), additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class Tag {\n");
- sb.append(" key: ").append(toIndentedString(key)).append("\n");
- sb.append(" value: ").append(toIndentedString(value)).append("\n");
+ sb.append("class RbmSuggestionResponse {\n");
+ sb.append(" text: ").append(toIndentedString(text)).append("\n");
+ sb.append(" postbackData: ").append(toIndentedString(postbackData)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -194,8 +194,8 @@ private String toIndentedString(Object o) {
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
- openapiFields.add("key");
- openapiFields.add("value");
+ openapiFields.add("text");
+ openapiFields.add("postbackData");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
@@ -205,20 +205,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 Tag
+ * @throws IOException if the JSON Element is invalid with respect to RbmSuggestionResponse
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString()));
+ if (!RbmSuggestionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in RbmSuggestionResponse is not found in the empty JSON string", RbmSuggestionResponse.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
- if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString()));
- }
- if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) {
- throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
+ if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString()));
}
}
@@ -226,16 +223,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!Tag.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'Tag' and its subtypes
+ if (!RbmSuggestionResponse.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'RbmSuggestionResponse' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(Tag.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(RbmSuggestionResponse.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, Tag value) throws IOException {
+ public void write(JsonWriter out, RbmSuggestionResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -263,12 +260,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public Tag read(JsonReader in) throws IOException {
+ public RbmSuggestionResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- Tag instance = thisAdapter.fromJsonTree(jsonObj);
+ RbmSuggestionResponse instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -295,18 +292,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of Tag given an JSON string
+ * Create an instance of RbmSuggestionResponse given an JSON string
*
* @param jsonString JSON string
- * @return An instance of Tag
- * @throws IOException if the JSON string is invalid with respect to Tag
+ * @return An instance of RbmSuggestionResponse
+ * @throws IOException if the JSON string is invalid with respect to RbmSuggestionResponse
*/
- public static Tag fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, Tag.class);
+ public static RbmSuggestionResponse fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, RbmSuggestionResponse.class);
}
/**
- * Convert an instance of Tag to an JSON string
+ * Convert an instance of RbmSuggestionResponse to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/MultiChannelCallbackData.java b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java
similarity index 58%
rename from src/main/java/com/bandwidth/sdk/model/MultiChannelCallbackData.java
rename to src/main/java/com/bandwidth/sdk/model/StatusCallback.java
index 208dc46b..64a57657 100644
--- a/src/main/java/com/bandwidth/sdk/model/MultiChannelCallbackData.java
+++ b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java
@@ -14,8 +14,8 @@
package com.bandwidth.sdk.model;
import java.util.Objects;
-import com.bandwidth.sdk.model.MultiChannelMessageCallbackData;
-import com.bandwidth.sdk.model.MultiChannelStatusEnum;
+import com.bandwidth.sdk.model.StatusCallbackMessage;
+import com.bandwidth.sdk.model.StatusCallbackTypeEnum;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
@@ -49,58 +49,92 @@
import com.bandwidth.sdk.JSON;
/**
- * MultiChannelCallbackData
+ * Represents a status callback for an outbound MT SMS or MMS or RBM message.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class MultiChannelCallbackData {
+public class StatusCallback {
public static final String SERIALIZED_NAME_TIME = "time";
@SerializedName(SERIALIZED_NAME_TIME)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private OffsetDateTime time;
+ public static final String SERIALIZED_NAME_EVENT_TIME = "eventTime";
+ @SerializedName(SERIALIZED_NAME_EVENT_TIME)
+ @javax.annotation.Nullable
+ private OffsetDateTime eventTime;
+
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
- @javax.annotation.Nullable
- private MultiChannelStatusEnum type;
+ @javax.annotation.Nonnull
+ private StatusCallbackTypeEnum type;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private String to;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
private String description;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
+ @javax.annotation.Nonnull
+ private StatusCallbackMessage message;
+
+ public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode";
+ @SerializedName(SERIALIZED_NAME_ERROR_CODE)
@javax.annotation.Nullable
- private MultiChannelMessageCallbackData message;
+ private Integer errorCode;
- public MultiChannelCallbackData() {
+ public static final String SERIALIZED_NAME_CARRIER_NAME = "carrierName";
+ @SerializedName(SERIALIZED_NAME_CARRIER_NAME)
+ @javax.annotation.Nullable
+ private String carrierName;
+
+ public StatusCallback() {
}
- public MultiChannelCallbackData time(@javax.annotation.Nullable OffsetDateTime time) {
+ public StatusCallback time(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
return this;
}
/**
- * The time of the callback event.
+ * Get time
* @return time
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public OffsetDateTime getTime() {
return time;
}
- public void setTime(@javax.annotation.Nullable OffsetDateTime time) {
+ public void setTime(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
}
- public MultiChannelCallbackData type(@javax.annotation.Nullable MultiChannelStatusEnum type) {
+ public StatusCallback eventTime(@javax.annotation.Nullable OffsetDateTime eventTime) {
+ this.eventTime = eventTime;
+ return this;
+ }
+
+ /**
+ * Represents the time at which the message was read, for `message-read` callbacks.
+ * @return eventTime
+ */
+ @javax.annotation.Nullable
+ public OffsetDateTime getEventTime() {
+ return eventTime;
+ }
+
+ public void setEventTime(@javax.annotation.Nullable OffsetDateTime eventTime) {
+ this.eventTime = eventTime;
+ }
+
+
+ public StatusCallback type(@javax.annotation.Nonnull StatusCallbackTypeEnum type) {
this.type = type;
return this;
}
@@ -109,55 +143,55 @@ public MultiChannelCallbackData type(@javax.annotation.Nullable MultiChannelStat
* Get type
* @return type
*/
- @javax.annotation.Nullable
- public MultiChannelStatusEnum getType() {
+ @javax.annotation.Nonnull
+ public StatusCallbackTypeEnum getType() {
return type;
}
- public void setType(@javax.annotation.Nullable MultiChannelStatusEnum type) {
+ public void setType(@javax.annotation.Nonnull StatusCallbackTypeEnum type) {
this.type = type;
}
- public MultiChannelCallbackData to(@javax.annotation.Nullable String to) {
+ public StatusCallback to(@javax.annotation.Nonnull String to) {
this.to = to;
return this;
}
/**
- * The phone number the message should be sent to in E164 format.
+ * The destination phone number the message was sent to. For status callbacks, this the the Bandwidth user's client phone number.
* @return to
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public String getTo() {
return to;
}
- public void setTo(@javax.annotation.Nullable String to) {
+ public void setTo(@javax.annotation.Nonnull String to) {
this.to = to;
}
- public MultiChannelCallbackData description(@javax.annotation.Nullable String description) {
+ public StatusCallback description(@javax.annotation.Nonnull String description) {
this.description = description;
return this;
}
/**
- * Get description
+ * A detailed description of the event described by the callback.
* @return description
*/
- @javax.annotation.Nullable
+ @javax.annotation.Nonnull
public String getDescription() {
return description;
}
- public void setDescription(@javax.annotation.Nullable String description) {
+ public void setDescription(@javax.annotation.Nonnull String description) {
this.description = description;
}
- public MultiChannelCallbackData message(@javax.annotation.Nullable MultiChannelMessageCallbackData message) {
+ public StatusCallback message(@javax.annotation.Nonnull StatusCallbackMessage message) {
this.message = message;
return this;
}
@@ -166,15 +200,53 @@ public MultiChannelCallbackData message(@javax.annotation.Nullable MultiChannelM
* Get message
* @return message
*/
- @javax.annotation.Nullable
- public MultiChannelMessageCallbackData getMessage() {
+ @javax.annotation.Nonnull
+ public StatusCallbackMessage getMessage() {
return message;
}
- public void setMessage(@javax.annotation.Nullable MultiChannelMessageCallbackData message) {
+ public void setMessage(@javax.annotation.Nonnull StatusCallbackMessage message) {
this.message = message;
}
+
+ public StatusCallback errorCode(@javax.annotation.Nullable Integer errorCode) {
+ this.errorCode = errorCode;
+ return this;
+ }
+
+ /**
+ * Optional error code, applicable only when type is `message-failed`.
+ * @return errorCode
+ */
+ @javax.annotation.Nullable
+ public Integer getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(@javax.annotation.Nullable Integer errorCode) {
+ this.errorCode = errorCode;
+ }
+
+
+ public StatusCallback carrierName(@javax.annotation.Nullable String carrierName) {
+ this.carrierName = carrierName;
+ return this;
+ }
+
+ /**
+ * 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
+ public String getCarrierName() {
+ return carrierName;
+ }
+
+ public void setCarrierName(@javax.annotation.Nullable String carrierName) {
+ this.carrierName = carrierName;
+ }
+
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
@@ -188,9 +260,9 @@ public void setMessage(@javax.annotation.Nullable MultiChannelMessageCallbackDat
*
* @param key name of the property
* @param value value of the property
- * @return the MultiChannelCallbackData instance itself
+ * @return the StatusCallback instance itself
*/
- public MultiChannelCallbackData putAdditionalProperty(String key, Object value) {
+ public StatusCallback putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -229,29 +301,35 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- MultiChannelCallbackData multiChannelCallbackData = (MultiChannelCallbackData) o;
- return Objects.equals(this.time, multiChannelCallbackData.time) &&
- Objects.equals(this.type, multiChannelCallbackData.type) &&
- Objects.equals(this.to, multiChannelCallbackData.to) &&
- Objects.equals(this.description, multiChannelCallbackData.description) &&
- Objects.equals(this.message, multiChannelCallbackData.message)&&
- Objects.equals(this.additionalProperties, multiChannelCallbackData.additionalProperties);
+ StatusCallback statusCallback = (StatusCallback) o;
+ return Objects.equals(this.time, statusCallback.time) &&
+ Objects.equals(this.eventTime, statusCallback.eventTime) &&
+ Objects.equals(this.type, statusCallback.type) &&
+ Objects.equals(this.to, statusCallback.to) &&
+ Objects.equals(this.description, statusCallback.description) &&
+ Objects.equals(this.message, statusCallback.message) &&
+ Objects.equals(this.errorCode, statusCallback.errorCode) &&
+ Objects.equals(this.carrierName, statusCallback.carrierName)&&
+ Objects.equals(this.additionalProperties, statusCallback.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(time, type, to, description, message, additionalProperties);
+ return Objects.hash(time, eventTime, type, to, description, message, errorCode, carrierName, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("class MultiChannelCallbackData {\n");
+ sb.append("class StatusCallback {\n");
sb.append(" time: ").append(toIndentedString(time)).append("\n");
+ sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
+ sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
+ sb.append(" carrierName: ").append(toIndentedString(carrierName)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
@@ -276,41 +354,55 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("time");
+ openapiFields.add("eventTime");
openapiFields.add("type");
openapiFields.add("to");
openapiFields.add("description");
openapiFields.add("message");
+ openapiFields.add("errorCode");
+ openapiFields.add("carrierName");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("time");
+ openapiRequiredFields.add("type");
+ openapiRequiredFields.add("to");
+ openapiRequiredFields.add("description");
+ openapiRequiredFields.add("message");
}
/**
* 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 MultiChannelCallbackData
+ * @throws IOException if the JSON Element is invalid with respect to StatusCallback
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
- if (!MultiChannelCallbackData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
- throw new IllegalArgumentException(String.format("The required field(s) %s in MultiChannelCallbackData is not found in the empty JSON string", MultiChannelCallbackData.openapiRequiredFields.toString()));
+ if (!StatusCallback.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
+ throw new IllegalArgumentException(String.format("The required field(s) %s in StatusCallback is not found in the empty JSON string", StatusCallback.openapiRequiredFields.toString()));
}
}
- JsonObject jsonObj = jsonElement.getAsJsonObject();
- // validate the optional field `type`
- if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) {
- MultiChannelStatusEnum.validateJsonElement(jsonObj.get("type"));
+
+ // check to make sure all required properties/fields are present in the JSON string
+ for (String requiredField : StatusCallback.openapiRequiredFields) {
+ if (jsonElement.getAsJsonObject().get(requiredField) == null) {
+ throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
+ }
}
- if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) {
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // validate the required field `type`
+ StatusCallbackTypeEnum.validateJsonElement(jsonObj.get("type"));
+ if (!jsonObj.get("to").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
- if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
+ if (!jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
- // validate the optional field `message`
- if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) {
- MultiChannelMessageCallbackData.validateJsonElement(jsonObj.get("message"));
+ // validate the required field `message`
+ StatusCallbackMessage.validateJsonElement(jsonObj.get("message"));
+ if ((jsonObj.get("carrierName") != null && !jsonObj.get("carrierName").isJsonNull()) && !jsonObj.get("carrierName").isJsonPrimitive()) {
+ throw new IllegalArgumentException(String.format("Expected the field `carrierName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierName").toString()));
}
}
@@ -318,16 +410,16 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
- if (!MultiChannelCallbackData.class.isAssignableFrom(type.getRawType())) {
- return null; // this class only serializes 'MultiChannelCallbackData' and its subtypes
+ if (!StatusCallback.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'StatusCallback' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
- final TypeAdapter thisAdapter
- = gson.getDelegateAdapter(this, TypeToken.get(MultiChannelCallbackData.class));
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(StatusCallback.class));
- return (TypeAdapter) new TypeAdapter() {
+ return (TypeAdapter) new TypeAdapter() {
@Override
- public void write(JsonWriter out, MultiChannelCallbackData value) throws IOException {
+ public void write(JsonWriter out, StatusCallback value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional properties
@@ -355,12 +447,12 @@ else if (entry.getValue() instanceof Character)
}
@Override
- public MultiChannelCallbackData read(JsonReader in) throws IOException {
+ public StatusCallback read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
- MultiChannelCallbackData instance = thisAdapter.fromJsonTree(jsonObj);
+ StatusCallback instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
@@ -387,18 +479,18 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
}
/**
- * Create an instance of MultiChannelCallbackData given an JSON string
+ * Create an instance of StatusCallback given an JSON string
*
* @param jsonString JSON string
- * @return An instance of MultiChannelCallbackData
- * @throws IOException if the JSON string is invalid with respect to MultiChannelCallbackData
+ * @return An instance of StatusCallback
+ * @throws IOException if the JSON string is invalid with respect to StatusCallback
*/
- public static MultiChannelCallbackData fromJson(String jsonString) throws IOException {
- return JSON.getGson().fromJson(jsonString, MultiChannelCallbackData.class);
+ public static StatusCallback fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, StatusCallback.class);
}
/**
- * Convert an instance of MultiChannelCallbackData to an JSON string
+ * Convert an instance of StatusCallback to an JSON string
*
* @return JSON string
*/
diff --git a/src/main/java/com/bandwidth/sdk/model/MessageCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/StatusCallbackMessage.java
similarity index 75%
rename from src/main/java/com/bandwidth/sdk/model/MessageCallbackMessage.java
rename to src/main/java/com/bandwidth/sdk/model/StatusCallbackMessage.java
index 0ea1c1e3..a983981f 100644
--- a/src/main/java/com/bandwidth/sdk/model/MessageCallbackMessage.java
+++ b/src/main/java/com/bandwidth/sdk/model/StatusCallbackMessage.java
@@ -15,6 +15,7 @@
import java.util.Objects;
import com.bandwidth.sdk.model.MessageDirectionEnum;
+import com.bandwidth.sdk.model.MultiChannelMessageChannelEnum;
import com.bandwidth.sdk.model.PriorityEnum;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
@@ -29,7 +30,6 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -55,10 +55,10 @@
import com.bandwidth.sdk.JSON;
/**
- * Message payload schema within a MessageCallback
+ * Message payload schema within a callback
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0")
-public class MessageCallbackMessage {
+public class StatusCallbackMessage {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
@@ -101,7 +101,7 @@ public class MessageCallbackMessage {
public static final String SERIALIZED_NAME_TEXT = "text";
@SerializedName(SERIALIZED_NAME_TEXT)
- @javax.annotation.Nonnull
+ @javax.annotation.Nullable
private String text;
public static final String SERIALIZED_NAME_TAG = "tag";
@@ -112,23 +112,28 @@ public class MessageCallbackMessage {
public static final String SERIALIZED_NAME_MEDIA = "media";
@SerializedName(SERIALIZED_NAME_MEDIA)
@javax.annotation.Nullable
- private List media;
+ private List media = new ArrayList<>();
public static final String SERIALIZED_NAME_PRIORITY = "priority";
@SerializedName(SERIALIZED_NAME_PRIORITY)
@javax.annotation.Nullable
private PriorityEnum priority;
- public MessageCallbackMessage() {
+ public static final String SERIALIZED_NAME_CHANNEL = "channel";
+ @SerializedName(SERIALIZED_NAME_CHANNEL)
+ @javax.annotation.Nullable
+ private MultiChannelMessageChannelEnum channel;
+
+ public StatusCallbackMessage() {
}
- public MessageCallbackMessage id(@javax.annotation.Nonnull String id) {
+ public StatusCallbackMessage id(@javax.annotation.Nonnull String id) {
this.id = id;
return this;
}
/**
- * Get id
+ * A unique identifier of the message.
* @return id
*/
@javax.annotation.Nonnull
@@ -141,13 +146,13 @@ public void setId(@javax.annotation.Nonnull String id) {
}
- public MessageCallbackMessage owner(@javax.annotation.Nonnull String owner) {
+ public StatusCallbackMessage owner(@javax.annotation.Nonnull String owner) {
this.owner = owner;
return this;
}
/**
- * Get owner
+ * The Bandwidth phone number or alphanumeric identifier associated with the message.
* @return owner
*/
@javax.annotation.Nonnull
@@ -160,13 +165,13 @@ public void setOwner(@javax.annotation.Nonnull String owner) {
}
- public MessageCallbackMessage applicationId(@javax.annotation.Nonnull String applicationId) {
+ public StatusCallbackMessage applicationId(@javax.annotation.Nonnull String applicationId) {
this.applicationId = applicationId;
return this;
}
/**
- * Get applicationId
+ * The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
* @return applicationId
*/
@javax.annotation.Nonnull
@@ -179,7 +184,7 @@ public void setApplicationId(@javax.annotation.Nonnull String applicationId) {
}
- public MessageCallbackMessage time(@javax.annotation.Nonnull OffsetDateTime time) {
+ public StatusCallbackMessage time(@javax.annotation.Nonnull OffsetDateTime time) {
this.time = time;
return this;
}
@@ -198,13 +203,13 @@ public void setTime(@javax.annotation.Nonnull OffsetDateTime time) {
}
- public MessageCallbackMessage segmentCount(@javax.annotation.Nonnull Integer segmentCount) {
+ public StatusCallbackMessage segmentCount(@javax.annotation.Nonnull Integer segmentCount) {
this.segmentCount = segmentCount;
return this;
}
/**
- * Get segmentCount
+ * The number of segments the user's message is broken into before sending over carrier networks.
* @return segmentCount
*/
@javax.annotation.Nonnull
@@ -217,7 +222,7 @@ public void setSegmentCount(@javax.annotation.Nonnull Integer segmentCount) {
}
- public MessageCallbackMessage direction(@javax.annotation.Nonnull MessageDirectionEnum direction) {
+ public StatusCallbackMessage direction(@javax.annotation.Nonnull MessageDirectionEnum direction) {
this.direction = direction;
return this;
}
@@ -236,12 +241,12 @@ public void setDirection(@javax.annotation.Nonnull MessageDirectionEnum directio
}
- public MessageCallbackMessage to(@javax.annotation.Nonnull Set to) {
+ public StatusCallbackMessage to(@javax.annotation.Nonnull Set to) {
this.to = to;
return this;
}
- public MessageCallbackMessage addToItem(String toItem) {
+ public StatusCallbackMessage addToItem(String toItem) {
if (this.to == null) {
this.to = new LinkedHashSet<>();
}
@@ -250,7 +255,7 @@ public MessageCallbackMessage addToItem(String toItem) {
}
/**
- * Get to
+ * The phone number recipients of the message.
* @return to
*/
@javax.annotation.Nonnull
@@ -263,13 +268,13 @@ public void setTo(@javax.annotation.Nonnull Set to) {
}
- public MessageCallbackMessage from(@javax.annotation.Nonnull String from) {
+ public StatusCallbackMessage from(@javax.annotation.Nonnull String from) {
this.from = from;
return this;
}
/**
- * Get from
+ * The Bandwidth phone number or alphanumeric identifier the message was sent from.
* @return from
*/
@javax.annotation.Nonnull
@@ -282,7 +287,7 @@ public void setFrom(@javax.annotation.Nonnull String from) {
}
- public MessageCallbackMessage text(@javax.annotation.Nonnull String text) {
+ public StatusCallbackMessage text(@javax.annotation.Nullable String text) {
this.text = text;
return this;
}
@@ -291,23 +296,23 @@ public MessageCallbackMessage text(@javax.annotation.Nonnull String text) {
* Get text
* @return text
*/
- @javax.annotation.Nonnull
+ @javax.annotation.Nullable
public String getText() {
return text;
}
- public void setText(@javax.annotation.Nonnull String text) {
+ public void setText(@javax.annotation.Nullable String text) {
this.text = text;
}
- public MessageCallbackMessage tag(@javax.annotation.Nullable String tag) {
+ public StatusCallbackMessage tag(@javax.annotation.Nullable String tag) {
this.tag = tag;
return this;
}
/**
- * Get tag
+ * A custom string that will be included in callback events of the message. Max 1024 characters.
* @return tag
*/
@javax.annotation.Nullable
@@ -320,12 +325,12 @@ public void setTag(@javax.annotation.Nullable String tag) {
}
- public MessageCallbackMessage media(@javax.annotation.Nullable List media) {
+ public StatusCallbackMessage media(@javax.annotation.Nullable List media) {
this.media = media;
return this;
}
- public MessageCallbackMessage addMediaItem(URI mediaItem) {
+ public StatusCallbackMessage addMediaItem(URI mediaItem) {
if (this.media == null) {
this.media = new ArrayList<>();
}
@@ -334,7 +339,7 @@ public MessageCallbackMessage addMediaItem(URI mediaItem) {
}
/**
- * Optional media, applicable only for mms
+ * Optional media, not applicable for sms
* @return media
*/
@javax.annotation.Nullable
@@ -347,7 +352,7 @@ public void setMedia(@javax.annotation.Nullable List media) {
}
- public MessageCallbackMessage priority(@javax.annotation.Nullable PriorityEnum priority) {
+ public StatusCallbackMessage priority(@javax.annotation.Nullable PriorityEnum priority) {
this.priority = priority;
return this;
}
@@ -365,6 +370,25 @@ public void setPriority(@javax.annotation.Nullable PriorityEnum priority) {
this.priority = priority;
}
+
+ public StatusCallbackMessage channel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ this.channel = channel;
+ return this;
+ }
+
+ /**
+ * Get channel
+ * @return channel
+ */
+ @javax.annotation.Nullable
+ public MultiChannelMessageChannelEnum getChannel() {
+ return channel;
+ }
+
+ public void setChannel(@javax.annotation.Nullable MultiChannelMessageChannelEnum channel) {
+ this.channel = channel;
+ }
+
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
@@ -378,9 +402,9 @@ public void setPriority(@javax.annotation.Nullable PriorityEnum priority) {
*
* @param key name of the property
* @param value value of the property
- * @return the MessageCallbackMessage instance itself
+ * @return the StatusCallbackMessage instance itself
*/
- public MessageCallbackMessage putAdditionalProperty(String key, Object value) {
+ public StatusCallbackMessage putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
@@ -419,42 +443,32 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
- MessageCallbackMessage messageCallbackMessage = (MessageCallbackMessage) o;
- return Objects.equals(this.id, messageCallbackMessage.id) &&
- Objects.equals(this.owner, messageCallbackMessage.owner) &&
- Objects.equals(this.applicationId, messageCallbackMessage.applicationId) &&
- Objects.equals(this.time, messageCallbackMessage.time) &&
- Objects.equals(this.segmentCount, messageCallbackMessage.segmentCount) &&
- Objects.equals(this.direction, messageCallbackMessage.direction) &&
- Objects.equals(this.to, messageCallbackMessage.to) &&
- Objects.equals(this.from, messageCallbackMessage.from) &&
- Objects.equals(this.text, messageCallbackMessage.text) &&
- Objects.equals(this.tag, messageCallbackMessage.tag) &&
- Objects.equals(this.media, messageCallbackMessage.media) &&
- Objects.equals(this.priority, messageCallbackMessage.priority)&&
- Objects.equals(this.additionalProperties, messageCallbackMessage.additionalProperties);
- }
-
- private static