From 39fff5cd3d49759c4970fc60773bbed941729f29 Mon Sep 17 00:00:00 2001 From: Dan Tolbert Date: Wed, 21 Oct 2020 17:04:56 -0400 Subject: [PATCH] remove the basemessage from the spec to clean up messagerequetss --- README.md | 7 +- api/openapi.yaml | 231 ++++++++--- build.gradle | 2 +- build.sbt | 2 +- docs/BaseMessageRequest.md | 28 -- docs/CreateLongCodeMessageRequest.md | 17 + docs/CreateMessageRequest.md | 17 + docs/CreateNumberPoolMessageRequest.md | 17 + docs/CreateShortCodeMessageRequest.md | 17 + .../open-api_java_sdk_config.json | 2 +- openapi-configuration/spec3.json | 245 ++++++++---- pom.xml | 2 +- .../telnyx/sdk/model/BaseMessageRequest.java | 364 ------------------ .../model/CreateLongCodeMessageRequest.java | 292 +++++++++++++- .../sdk/model/CreateMessageRequest.java | 292 +++++++++++++- .../model/CreateNumberPoolMessageRequest.java | 292 +++++++++++++- .../model/CreateShortCodeMessageRequest.java | 292 +++++++++++++- .../sdk/model/BaseMessageRequestTest.java | 108 ------ .../CreateLongCodeMessageRequestTest.java | 17 +- .../sdk/model/CreateMessageRequestTest.java | 25 +- .../CreateNumberPoolMessageRequestTest.java | 17 +- .../CreateShortCodeMessageRequestTest.java | 17 +- 22 files changed, 1643 insertions(+), 660 deletions(-) delete mode 100644 docs/BaseMessageRequest.md delete mode 100644 src/main/java/com/telnyx/sdk/model/BaseMessageRequest.java delete mode 100644 src/test/java/com/telnyx/sdk/model/BaseMessageRequestTest.java diff --git a/README.md b/README.md index 464b8aa0..7d5888f6 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Add this dependency to your project's POM: com.telnyx.sdk telnyx - 2.0.7-beta + 2.0.8-beta compile ``` @@ -50,7 +50,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.telnyx.sdk:telnyx:2.0.7-beta" +compile "com.telnyx.sdk:telnyx:2.0.8-beta" ``` ### Others @@ -63,7 +63,7 @@ mvn clean package Then manually install the following JARs: -- `target/telnyx-2.0.7-beta.jar` +- `target/telnyx-2.0.8-beta.jar` - `target/lib/*.jar` ## Getting Started @@ -211,7 +211,6 @@ Class | Method | HTTP request | Description - [AnswerRequest](docs/AnswerRequest.md) - [AvailablePhoneNumber](docs/AvailablePhoneNumber.md) - [AvailablePhoneNumbersMetadata](docs/AvailablePhoneNumbersMetadata.md) - - [BaseMessageRequest](docs/BaseMessageRequest.md) - [BridgeRequest](docs/BridgeRequest.md) - [CSVDownloadResponse](docs/CSVDownloadResponse.md) - [Call](docs/Call.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index ec0fbcb6..c191cb70 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5907,53 +5907,6 @@ components: example: 0 type: integer type: object - BaseMessageRequest: - properties: - text: - description: |- - Message body (i.e., content) as a non-empty string. - - **Required for SMS** - type: string - subject: - description: Subject of multimedia message - type: string - media_urls: - description: |- - A list of media URLs. The total media size must be less than 1 MB. - - **Required for MMS** - items: - format: url - type: string - type: array - webhook_url: - description: The URL where webhooks related to this message will be sent. - format: url - type: string - webhook_failover_url: - description: The failover URL where webhooks related to this message will - be sent if sending to the primary URL fails. - format: url - type: string - use_profile_webhooks: - default: true - description: If the profile this number is associated with has webhooks, - use them for delivery notifications. If webhooks are also specified on - the message itself, they will be attempted first, then those on the profile. - type: boolean - type: - description: The protocol for sending the message, either SMS or MMS. - enum: - - SMS - - MMS - type: string - auto_detect: - default: false - description: Automatically detect if an SMS message is unusually long and - exceeds a recommended limit of message parts. - type: boolean - type: object BridgeRequest: example: call_control_id: v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQ @@ -8604,8 +8557,6 @@ components: title: Create Conference Request type: object CreateLongCodeMessageRequest: - allOf: - - $ref: '#/components/schemas/BaseMessageRequest' example: from: +18445550001 to: +13125550002 @@ -8627,13 +8578,55 @@ components: example: +E.164 format: address type: string + text: + description: |- + Message body (i.e., content) as a non-empty string. + + **Required for SMS** + type: string + subject: + description: Subject of multimedia message + type: string + media_urls: + description: |- + A list of media URLs. The total media size must be less than 1 MB. + + **Required for MMS** + items: + format: url + type: string + type: array + webhook_url: + description: The URL where webhooks related to this message will be sent. + format: url + type: string + webhook_failover_url: + description: The failover URL where webhooks related to this message will + be sent if sending to the primary URL fails. + format: url + type: string + use_profile_webhooks: + default: true + description: If the profile this number is associated with has webhooks, + use them for delivery notifications. If webhooks are also specified on + the message itself, they will be attempted first, then those on the profile. + type: boolean + type: + description: The protocol for sending the message, either SMS or MMS. + enum: + - SMS + - MMS + type: string + auto_detect: + default: false + description: Automatically detect if an SMS message is unusually long and + exceeds a recommended limit of message parts. + type: boolean required: - from - to type: object CreateMessageRequest: - allOf: - - $ref: '#/components/schemas/BaseMessageRequest' example: from: +18445550001 messaging_profile_id: abc85f64-5717-4562-b3fc-2c9600000000 @@ -8665,6 +8658,50 @@ components: example: +E.164 format: address type: string + text: + description: |- + Message body (i.e., content) as a non-empty string. + + **Required for SMS** + type: string + subject: + description: Subject of multimedia message + type: string + media_urls: + description: |- + A list of media URLs. The total media size must be less than 1 MB. + + **Required for MMS** + items: + format: url + type: string + type: array + webhook_url: + description: The URL where webhooks related to this message will be sent. + format: url + type: string + webhook_failover_url: + description: The failover URL where webhooks related to this message will + be sent if sending to the primary URL fails. + format: url + type: string + use_profile_webhooks: + default: true + description: If the profile this number is associated with has webhooks, + use them for delivery notifications. If webhooks are also specified on + the message itself, they will be attempted first, then those on the profile. + type: boolean + type: + description: The protocol for sending the message, either SMS or MMS. + enum: + - SMS + - MMS + type: string + auto_detect: + default: false + description: Automatically detect if an SMS message is unusually long and + exceeds a recommended limit of message parts. + type: boolean required: - to type: object @@ -8872,8 +8909,6 @@ components: readOnly: true type: boolean CreateNumberPoolMessageRequest: - allOf: - - $ref: '#/components/schemas/BaseMessageRequest' example: from: +18445550001 messaging_profile_id: abc85f64-5717-4562-b3fc-2c9600000000 @@ -8896,6 +8931,50 @@ components: example: +E.164 format: address type: string + text: + description: |- + Message body (i.e., content) as a non-empty string. + + **Required for SMS** + type: string + subject: + description: Subject of multimedia message + type: string + media_urls: + description: |- + A list of media URLs. The total media size must be less than 1 MB. + + **Required for MMS** + items: + format: url + type: string + type: array + webhook_url: + description: The URL where webhooks related to this message will be sent. + format: url + type: string + webhook_failover_url: + description: The failover URL where webhooks related to this message will + be sent if sending to the primary URL fails. + format: url + type: string + use_profile_webhooks: + default: true + description: If the profile this number is associated with has webhooks, + use them for delivery notifications. If webhooks are also specified on + the message itself, they will be attempted first, then those on the profile. + type: boolean + type: + description: The protocol for sending the message, either SMS or MMS. + enum: + - SMS + - MMS + type: string + auto_detect: + default: false + description: Automatically detect if an SMS message is unusually long and + exceeds a recommended limit of message parts. + type: boolean required: - messaging_profile_id - to @@ -8957,8 +9036,6 @@ components: readOnly: true type: string CreateShortCodeMessageRequest: - allOf: - - $ref: '#/components/schemas/BaseMessageRequest' example: from: +18445550001 to: +18445550001 @@ -8980,6 +9057,50 @@ components: example: +E.164 format: address type: string + text: + description: |- + Message body (i.e., content) as a non-empty string. + + **Required for SMS** + type: string + subject: + description: Subject of multimedia message + type: string + media_urls: + description: |- + A list of media URLs. The total media size must be less than 1 MB. + + **Required for MMS** + items: + format: url + type: string + type: array + webhook_url: + description: The URL where webhooks related to this message will be sent. + format: url + type: string + webhook_failover_url: + description: The failover URL where webhooks related to this message will + be sent if sending to the primary URL fails. + format: url + type: string + use_profile_webhooks: + default: true + description: If the profile this number is associated with has webhooks, + use them for delivery notifications. If webhooks are also specified on + the message itself, they will be attempted first, then those on the profile. + type: boolean + type: + description: The protocol for sending the message, either SMS or MMS. + enum: + - SMS + - MMS + type: string + auto_detect: + default: false + description: Automatically detect if an SMS message is unusually long and + exceeds a recommended limit of message parts. + type: boolean required: - from - to diff --git a/build.gradle b/build.gradle index 1eec73c4..ee59aef1 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.telnyx.sdk' -version = '2.0.7-beta' +version = '2.0.8-beta' buildscript { repositories { diff --git a/build.sbt b/build.sbt index 5a5a8907..0f9c2f1e 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.telnyx.sdk", name := "telnyx", - version := "2.0.7-beta", + version := "2.0.8-beta", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/BaseMessageRequest.md b/docs/BaseMessageRequest.md deleted file mode 100644 index dc25ba99..00000000 --- a/docs/BaseMessageRequest.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# BaseMessageRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text** | **String** | Message body (i.e., content) as a non-empty string. **Required for SMS** | [optional] -**subject** | **String** | Subject of multimedia message | [optional] -**mediaUrls** | **List<String>** | A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** | [optional] -**webhookUrl** | **String** | The URL where webhooks related to this message will be sent. | [optional] -**webhookFailoverUrl** | **String** | The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. | [optional] -**useProfileWebhooks** | **Boolean** | If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. | [optional] -**type** | [**TypeEnum**](#TypeEnum) | The protocol for sending the message, either SMS or MMS. | [optional] -**autoDetect** | **Boolean** | Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. | [optional] - - - -## Enum: TypeEnum - -Name | Value ----- | ----- -SMS | "SMS" -MMS | "MMS" - - - diff --git a/docs/CreateLongCodeMessageRequest.md b/docs/CreateLongCodeMessageRequest.md index 4a63269e..69af7995 100644 --- a/docs/CreateLongCodeMessageRequest.md +++ b/docs/CreateLongCodeMessageRequest.md @@ -8,6 +8,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **from** | **String** | Phone number, in +E.164 format, used to send the message. | **to** | **String** | Receiving address (+E.164 formatted phone number or short code). | +**text** | **String** | Message body (i.e., content) as a non-empty string. **Required for SMS** | [optional] +**subject** | **String** | Subject of multimedia message | [optional] +**mediaUrls** | **List<String>** | A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** | [optional] +**webhookUrl** | **String** | The URL where webhooks related to this message will be sent. | [optional] +**webhookFailoverUrl** | **String** | The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. | [optional] +**useProfileWebhooks** | **Boolean** | If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. | [optional] +**type** | [**TypeEnum**](#TypeEnum) | The protocol for sending the message, either SMS or MMS. | [optional] +**autoDetect** | **Boolean** | Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +SMS | "SMS" +MMS | "MMS" diff --git a/docs/CreateMessageRequest.md b/docs/CreateMessageRequest.md index ccb7ab4d..b5c41717 100644 --- a/docs/CreateMessageRequest.md +++ b/docs/CreateMessageRequest.md @@ -9,6 +9,23 @@ Name | Type | Description | Notes **from** | **String** | Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short code). **Required if sending with a phone number, short code, or alphanumeric sender ID.** | [optional] **messagingProfileId** | **String** | Unique identifier for a messaging profile. **Required if sending via number pool or with an alphanumeric sender ID.** | [optional] **to** | **String** | Receiving address (+E.164 formatted phone number or short code). | +**text** | **String** | Message body (i.e., content) as a non-empty string. **Required for SMS** | [optional] +**subject** | **String** | Subject of multimedia message | [optional] +**mediaUrls** | **List<String>** | A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** | [optional] +**webhookUrl** | **String** | The URL where webhooks related to this message will be sent. | [optional] +**webhookFailoverUrl** | **String** | The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. | [optional] +**useProfileWebhooks** | **Boolean** | If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. | [optional] +**type** | [**TypeEnum**](#TypeEnum) | The protocol for sending the message, either SMS or MMS. | [optional] +**autoDetect** | **Boolean** | Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +SMS | "SMS" +MMS | "MMS" diff --git a/docs/CreateNumberPoolMessageRequest.md b/docs/CreateNumberPoolMessageRequest.md index 96cbb5a8..38319877 100644 --- a/docs/CreateNumberPoolMessageRequest.md +++ b/docs/CreateNumberPoolMessageRequest.md @@ -8,6 +8,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **messagingProfileId** | **String** | Unique identifier for a messaging profile. | **to** | **String** | Receiving address (+E.164 formatted phone number or short code). | +**text** | **String** | Message body (i.e., content) as a non-empty string. **Required for SMS** | [optional] +**subject** | **String** | Subject of multimedia message | [optional] +**mediaUrls** | **List<String>** | A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** | [optional] +**webhookUrl** | **String** | The URL where webhooks related to this message will be sent. | [optional] +**webhookFailoverUrl** | **String** | The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. | [optional] +**useProfileWebhooks** | **Boolean** | If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. | [optional] +**type** | [**TypeEnum**](#TypeEnum) | The protocol for sending the message, either SMS or MMS. | [optional] +**autoDetect** | **Boolean** | Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +SMS | "SMS" +MMS | "MMS" diff --git a/docs/CreateShortCodeMessageRequest.md b/docs/CreateShortCodeMessageRequest.md index ba92a785..c09b0c29 100644 --- a/docs/CreateShortCodeMessageRequest.md +++ b/docs/CreateShortCodeMessageRequest.md @@ -8,6 +8,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **from** | **String** | Phone number, in +E.164 format, used to send the message. | **to** | **String** | Receiving address (+E.164 formatted phone number or short code). | +**text** | **String** | Message body (i.e., content) as a non-empty string. **Required for SMS** | [optional] +**subject** | **String** | Subject of multimedia message | [optional] +**mediaUrls** | **List<String>** | A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** | [optional] +**webhookUrl** | **String** | The URL where webhooks related to this message will be sent. | [optional] +**webhookFailoverUrl** | **String** | The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. | [optional] +**useProfileWebhooks** | **Boolean** | If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. | [optional] +**type** | [**TypeEnum**](#TypeEnum) | The protocol for sending the message, either SMS or MMS. | [optional] +**autoDetect** | **Boolean** | Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +SMS | "SMS" +MMS | "MMS" diff --git a/openapi-configuration/open-api_java_sdk_config.json b/openapi-configuration/open-api_java_sdk_config.json index f2a6df5d..c1180bdd 100644 --- a/openapi-configuration/open-api_java_sdk_config.json +++ b/openapi-configuration/open-api_java_sdk_config.json @@ -1,5 +1,5 @@ { - "artifactVersion" : "2.0.7-beta", + "artifactVersion" : "2.0.8-beta", "java8" : true, "dateLibrary" : "java8", "groupId" : "com.telnyx.sdk", diff --git a/openapi-configuration/spec3.json b/openapi-configuration/spec3.json index a0f7cf69..c2c9f75f 100644 --- a/openapi-configuration/spec3.json +++ b/openapi-configuration/spec3.json @@ -6162,55 +6162,6 @@ } } }, - "BaseMessageRequest": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Message body (i.e., content) as a non-empty string.\n\n**Required for SMS**" - }, - "subject": { - "type": "string", - "description": "Subject of multimedia message" - }, - "media_urls": { - "description": "A list of media URLs. The total media size must be less than 1 MB.\n\n**Required for MMS**", - "type": "array", - "items": { - "type": "string", - "format": "url" - } - }, - "webhook_url": { - "description": "The URL where webhooks related to this message will be sent.", - "type": "string", - "format": "url" - }, - "webhook_failover_url": { - "description": "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.", - "type": "string", - "format": "url" - }, - "use_profile_webhooks": { - "type": "boolean", - "description": "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.", - "default": true - }, - "type": { - "description": "The protocol for sending the message, either SMS or MMS.", - "type": "string", - "enum": [ - "SMS", - "MMS" - ] - }, - "auto_detect": { - "description": "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.", - "type": "boolean", - "default": false - } - } - }, "BridgeRequest": { "type": "object", "title": "Bridge Request", @@ -10200,11 +10151,6 @@ "from", "to" ], - "allOf": [ - { - "$ref": "#/components/schemas/BaseMessageRequest" - } - ], "properties": { "from": { "type": "string", @@ -10213,6 +10159,50 @@ }, "to": { "$ref": "#/components/schemas/ToNumber" + }, + "text": { + "type": "string", + "description": "Message body (i.e., content) as a non-empty string.\n\n**Required for SMS**" + }, + "subject": { + "type": "string", + "description": "Subject of multimedia message" + }, + "media_urls": { + "description": "A list of media URLs. The total media size must be less than 1 MB.\n\n**Required for MMS**", + "type": "array", + "items": { + "type": "string", + "format": "url" + } + }, + "webhook_url": { + "description": "The URL where webhooks related to this message will be sent.", + "type": "string", + "format": "url" + }, + "webhook_failover_url": { + "description": "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.", + "type": "string", + "format": "url" + }, + "use_profile_webhooks": { + "type": "boolean", + "description": "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.", + "default": true + }, + "type": { + "description": "The protocol for sending the message, either SMS or MMS.", + "type": "string", + "enum": [ + "SMS", + "MMS" + ] + }, + "auto_detect": { + "description": "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.", + "type": "boolean", + "default": false } }, "example": { @@ -10234,11 +10224,6 @@ "required": [ "to" ], - "allOf": [ - { - "$ref": "#/components/schemas/BaseMessageRequest" - } - ], "properties": { "from": { "type": "string", @@ -10251,6 +10236,50 @@ }, "to": { "$ref": "#/components/schemas/ToNumber" + }, + "text": { + "type": "string", + "description": "Message body (i.e., content) as a non-empty string.\n\n**Required for SMS**" + }, + "subject": { + "type": "string", + "description": "Subject of multimedia message" + }, + "media_urls": { + "description": "A list of media URLs. The total media size must be less than 1 MB.\n\n**Required for MMS**", + "type": "array", + "items": { + "type": "string", + "format": "url" + } + }, + "webhook_url": { + "description": "The URL where webhooks related to this message will be sent.", + "type": "string", + "format": "url" + }, + "webhook_failover_url": { + "description": "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.", + "type": "string", + "format": "url" + }, + "use_profile_webhooks": { + "type": "boolean", + "description": "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.", + "default": true + }, + "type": { + "description": "The protocol for sending the message, either SMS or MMS.", + "type": "string", + "enum": [ + "SMS", + "MMS" + ] + }, + "auto_detect": { + "description": "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.", + "type": "boolean", + "default": false } }, "example": { @@ -10523,11 +10552,6 @@ "to", "messaging_profile_id" ], - "allOf": [ - { - "$ref": "#/components/schemas/BaseMessageRequest" - } - ], "properties": { "messaging_profile_id": { "type": "string", @@ -10535,6 +10559,50 @@ }, "to": { "$ref": "#/components/schemas/ToNumber" + }, + "text": { + "type": "string", + "description": "Message body (i.e., content) as a non-empty string.\n\n**Required for SMS**" + }, + "subject": { + "type": "string", + "description": "Subject of multimedia message" + }, + "media_urls": { + "description": "A list of media URLs. The total media size must be less than 1 MB.\n\n**Required for MMS**", + "type": "array", + "items": { + "type": "string", + "format": "url" + } + }, + "webhook_url": { + "description": "The URL where webhooks related to this message will be sent.", + "type": "string", + "format": "url" + }, + "webhook_failover_url": { + "description": "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.", + "type": "string", + "format": "url" + }, + "use_profile_webhooks": { + "type": "boolean", + "description": "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.", + "default": true + }, + "type": { + "description": "The protocol for sending the message, either SMS or MMS.", + "type": "string", + "enum": [ + "SMS", + "MMS" + ] + }, + "auto_detect": { + "description": "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.", + "type": "boolean", + "default": false } }, "example": { @@ -10629,11 +10697,6 @@ "from", "to" ], - "allOf": [ - { - "$ref": "#/components/schemas/BaseMessageRequest" - } - ], "properties": { "from": { "type": "string", @@ -10642,6 +10705,50 @@ }, "to": { "$ref": "#/components/schemas/ToNumber" + }, + "text": { + "type": "string", + "description": "Message body (i.e., content) as a non-empty string.\n\n**Required for SMS**" + }, + "subject": { + "type": "string", + "description": "Subject of multimedia message" + }, + "media_urls": { + "description": "A list of media URLs. The total media size must be less than 1 MB.\n\n**Required for MMS**", + "type": "array", + "items": { + "type": "string", + "format": "url" + } + }, + "webhook_url": { + "description": "The URL where webhooks related to this message will be sent.", + "type": "string", + "format": "url" + }, + "webhook_failover_url": { + "description": "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.", + "type": "string", + "format": "url" + }, + "use_profile_webhooks": { + "type": "boolean", + "description": "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.", + "default": true + }, + "type": { + "description": "The protocol for sending the message, either SMS or MMS.", + "type": "string", + "enum": [ + "SMS", + "MMS" + ] + }, + "auto_detect": { + "description": "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.", + "type": "boolean", + "default": false } }, "example": { diff --git a/pom.xml b/pom.xml index 27fe6be1..45f08ece 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ telnyx jar telnyx - 2.0.7-beta + 2.0.8-beta https://github.com/team-telnyx/telnyx-java/ Telnyx Java SDK diff --git a/src/main/java/com/telnyx/sdk/model/BaseMessageRequest.java b/src/main/java/com/telnyx/sdk/model/BaseMessageRequest.java deleted file mode 100644 index 7b61008f..00000000 --- a/src/main/java/com/telnyx/sdk/model/BaseMessageRequest.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Telnyx API - * SIP trunking, SMS, MMS, Call Control and Telephony Data Services. - * - * The version of the OpenAPI document: 2.0.0 - * Contact: support@telnyx.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.telnyx.sdk.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.telnyx.sdk.JSON; - - -/** - * BaseMessageRequest - */ -@JsonPropertyOrder({ - BaseMessageRequest.JSON_PROPERTY_TEXT, - BaseMessageRequest.JSON_PROPERTY_SUBJECT, - BaseMessageRequest.JSON_PROPERTY_MEDIA_URLS, - BaseMessageRequest.JSON_PROPERTY_WEBHOOK_URL, - BaseMessageRequest.JSON_PROPERTY_WEBHOOK_FAILOVER_URL, - BaseMessageRequest.JSON_PROPERTY_USE_PROFILE_WEBHOOKS, - BaseMessageRequest.JSON_PROPERTY_TYPE, - BaseMessageRequest.JSON_PROPERTY_AUTO_DETECT -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BaseMessageRequest { - public static final String JSON_PROPERTY_TEXT = "text"; - private String text; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; - - public static final String JSON_PROPERTY_MEDIA_URLS = "media_urls"; - private List mediaUrls = null; - - public static final String JSON_PROPERTY_WEBHOOK_URL = "webhook_url"; - private String webhookUrl; - - public static final String JSON_PROPERTY_WEBHOOK_FAILOVER_URL = "webhook_failover_url"; - private String webhookFailoverUrl; - - public static final String JSON_PROPERTY_USE_PROFILE_WEBHOOKS = "use_profile_webhooks"; - private Boolean useProfileWebhooks = true; - - /** - * The protocol for sending the message, either SMS or MMS. - */ - public enum TypeEnum { - SMS("SMS"), - - MMS("MMS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; - - public static final String JSON_PROPERTY_AUTO_DETECT = "auto_detect"; - private Boolean autoDetect = false; - - - public BaseMessageRequest text(String text) { - this.text = text; - return this; - } - - /** - * Message body (i.e., content) as a non-empty string. **Required for SMS** - * @return text - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Message body (i.e., content) as a non-empty string. **Required for SMS**") - @JsonProperty(JSON_PROPERTY_TEXT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getText() { - return text; - } - - - public void setText(String text) { - this.text = text; - } - - - public BaseMessageRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * Subject of multimedia message - * @return subject - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Subject of multimedia message") - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - public void setSubject(String subject) { - this.subject = subject; - } - - - public BaseMessageRequest mediaUrls(List mediaUrls) { - this.mediaUrls = mediaUrls; - return this; - } - - public BaseMessageRequest addMediaUrlsItem(String mediaUrlsItem) { - if (this.mediaUrls == null) { - this.mediaUrls = new ArrayList<>(); - } - this.mediaUrls.add(mediaUrlsItem); - return this; - } - - /** - * A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** - * @return mediaUrls - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**") - @JsonProperty(JSON_PROPERTY_MEDIA_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getMediaUrls() { - return mediaUrls; - } - - - public void setMediaUrls(List mediaUrls) { - this.mediaUrls = mediaUrls; - } - - - public BaseMessageRequest webhookUrl(String webhookUrl) { - this.webhookUrl = webhookUrl; - return this; - } - - /** - * The URL where webhooks related to this message will be sent. - * @return webhookUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where webhooks related to this message will be sent.") - @JsonProperty(JSON_PROPERTY_WEBHOOK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getWebhookUrl() { - return webhookUrl; - } - - - public void setWebhookUrl(String webhookUrl) { - this.webhookUrl = webhookUrl; - } - - - public BaseMessageRequest webhookFailoverUrl(String webhookFailoverUrl) { - this.webhookFailoverUrl = webhookFailoverUrl; - return this; - } - - /** - * The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. - * @return webhookFailoverUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.") - @JsonProperty(JSON_PROPERTY_WEBHOOK_FAILOVER_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getWebhookFailoverUrl() { - return webhookFailoverUrl; - } - - - public void setWebhookFailoverUrl(String webhookFailoverUrl) { - this.webhookFailoverUrl = webhookFailoverUrl; - } - - - public BaseMessageRequest useProfileWebhooks(Boolean useProfileWebhooks) { - this.useProfileWebhooks = useProfileWebhooks; - return this; - } - - /** - * If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. - * @return useProfileWebhooks - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.") - @JsonProperty(JSON_PROPERTY_USE_PROFILE_WEBHOOKS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUseProfileWebhooks() { - return useProfileWebhooks; - } - - - public void setUseProfileWebhooks(Boolean useProfileWebhooks) { - this.useProfileWebhooks = useProfileWebhooks; - } - - - public BaseMessageRequest type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * The protocol for sending the message, either SMS or MMS. - * @return type - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The protocol for sending the message, either SMS or MMS.") - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - - public BaseMessageRequest autoDetect(Boolean autoDetect) { - this.autoDetect = autoDetect; - return this; - } - - /** - * Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. - * @return autoDetect - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.") - @JsonProperty(JSON_PROPERTY_AUTO_DETECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAutoDetect() { - return autoDetect; - } - - - public void setAutoDetect(Boolean autoDetect) { - this.autoDetect = autoDetect; - } - - - /** - * Return true if this BaseMessageRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseMessageRequest baseMessageRequest = (BaseMessageRequest) o; - return Objects.equals(this.text, baseMessageRequest.text) && - Objects.equals(this.subject, baseMessageRequest.subject) && - Objects.equals(this.mediaUrls, baseMessageRequest.mediaUrls) && - Objects.equals(this.webhookUrl, baseMessageRequest.webhookUrl) && - Objects.equals(this.webhookFailoverUrl, baseMessageRequest.webhookFailoverUrl) && - Objects.equals(this.useProfileWebhooks, baseMessageRequest.useProfileWebhooks) && - Objects.equals(this.type, baseMessageRequest.type) && - Objects.equals(this.autoDetect, baseMessageRequest.autoDetect); - } - - @Override - public int hashCode() { - return Objects.hash(text, subject, mediaUrls, webhookUrl, webhookFailoverUrl, useProfileWebhooks, type, autoDetect); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseMessageRequest {\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" mediaUrls: ").append(toIndentedString(mediaUrls)).append("\n"); - sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); - sb.append(" webhookFailoverUrl: ").append(toIndentedString(webhookFailoverUrl)).append("\n"); - sb.append(" useProfileWebhooks: ").append(toIndentedString(useProfileWebhooks)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" autoDetect: ").append(toIndentedString(autoDetect)).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 "); - } - -} - diff --git a/src/main/java/com/telnyx/sdk/model/CreateLongCodeMessageRequest.java b/src/main/java/com/telnyx/sdk/model/CreateLongCodeMessageRequest.java index 13612d86..6ae479cd 100644 --- a/src/main/java/com/telnyx/sdk/model/CreateLongCodeMessageRequest.java +++ b/src/main/java/com/telnyx/sdk/model/CreateLongCodeMessageRequest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -36,16 +35,83 @@ */ @JsonPropertyOrder({ CreateLongCodeMessageRequest.JSON_PROPERTY_FROM, - CreateLongCodeMessageRequest.JSON_PROPERTY_TO + CreateLongCodeMessageRequest.JSON_PROPERTY_TO, + CreateLongCodeMessageRequest.JSON_PROPERTY_TEXT, + CreateLongCodeMessageRequest.JSON_PROPERTY_SUBJECT, + CreateLongCodeMessageRequest.JSON_PROPERTY_MEDIA_URLS, + CreateLongCodeMessageRequest.JSON_PROPERTY_WEBHOOK_URL, + CreateLongCodeMessageRequest.JSON_PROPERTY_WEBHOOK_FAILOVER_URL, + CreateLongCodeMessageRequest.JSON_PROPERTY_USE_PROFILE_WEBHOOKS, + CreateLongCodeMessageRequest.JSON_PROPERTY_TYPE, + CreateLongCodeMessageRequest.JSON_PROPERTY_AUTO_DETECT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CreateLongCodeMessageRequest extends BaseMessageRequest { +public class CreateLongCodeMessageRequest { public static final String JSON_PROPERTY_FROM = "from"; private String from; public static final String JSON_PROPERTY_TO = "to"; private String to; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MEDIA_URLS = "media_urls"; + private List mediaUrls = null; + + public static final String JSON_PROPERTY_WEBHOOK_URL = "webhook_url"; + private String webhookUrl; + + public static final String JSON_PROPERTY_WEBHOOK_FAILOVER_URL = "webhook_failover_url"; + private String webhookFailoverUrl; + + public static final String JSON_PROPERTY_USE_PROFILE_WEBHOOKS = "use_profile_webhooks"; + private Boolean useProfileWebhooks = true; + + /** + * The protocol for sending the message, either SMS or MMS. + */ + public enum TypeEnum { + SMS("SMS"), + + MMS("MMS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_AUTO_DETECT = "auto_detect"; + private Boolean autoDetect = false; + public CreateLongCodeMessageRequest from(String from) { this.from = from; @@ -93,6 +159,206 @@ public void setTo(String to) { } + public CreateLongCodeMessageRequest text(String text) { + this.text = text; + return this; + } + + /** + * Message body (i.e., content) as a non-empty string. **Required for SMS** + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message body (i.e., content) as a non-empty string. **Required for SMS**") + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public CreateLongCodeMessageRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Subject of multimedia message + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of multimedia message") + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateLongCodeMessageRequest mediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + return this; + } + + public CreateLongCodeMessageRequest addMediaUrlsItem(String mediaUrlsItem) { + if (this.mediaUrls == null) { + this.mediaUrls = new ArrayList<>(); + } + this.mediaUrls.add(mediaUrlsItem); + return this; + } + + /** + * A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** + * @return mediaUrls + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**") + @JsonProperty(JSON_PROPERTY_MEDIA_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMediaUrls() { + return mediaUrls; + } + + + public void setMediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + } + + + public CreateLongCodeMessageRequest webhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * The URL where webhooks related to this message will be sent. + * @return webhookUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL where webhooks related to this message will be sent.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookUrl() { + return webhookUrl; + } + + + public void setWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + } + + + public CreateLongCodeMessageRequest webhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + return this; + } + + /** + * The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. + * @return webhookFailoverUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_FAILOVER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookFailoverUrl() { + return webhookFailoverUrl; + } + + + public void setWebhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + } + + + public CreateLongCodeMessageRequest useProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + return this; + } + + /** + * If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. + * @return useProfileWebhooks + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.") + @JsonProperty(JSON_PROPERTY_USE_PROFILE_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseProfileWebhooks() { + return useProfileWebhooks; + } + + + public void setUseProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + } + + + public CreateLongCodeMessageRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The protocol for sending the message, either SMS or MMS. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol for sending the message, either SMS or MMS.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public CreateLongCodeMessageRequest autoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + return this; + } + + /** + * Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. + * @return autoDetect + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.") + @JsonProperty(JSON_PROPERTY_AUTO_DETECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAutoDetect() { + return autoDetect; + } + + + public void setAutoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + } + + /** * Return true if this CreateLongCodeMessageRequest object is equal to o. */ @@ -107,12 +373,19 @@ public boolean equals(Object o) { CreateLongCodeMessageRequest createLongCodeMessageRequest = (CreateLongCodeMessageRequest) o; return Objects.equals(this.from, createLongCodeMessageRequest.from) && Objects.equals(this.to, createLongCodeMessageRequest.to) && - super.equals(o); + Objects.equals(this.text, createLongCodeMessageRequest.text) && + Objects.equals(this.subject, createLongCodeMessageRequest.subject) && + Objects.equals(this.mediaUrls, createLongCodeMessageRequest.mediaUrls) && + Objects.equals(this.webhookUrl, createLongCodeMessageRequest.webhookUrl) && + Objects.equals(this.webhookFailoverUrl, createLongCodeMessageRequest.webhookFailoverUrl) && + Objects.equals(this.useProfileWebhooks, createLongCodeMessageRequest.useProfileWebhooks) && + Objects.equals(this.type, createLongCodeMessageRequest.type) && + Objects.equals(this.autoDetect, createLongCodeMessageRequest.autoDetect); } @Override public int hashCode() { - return Objects.hash(from, to, super.hashCode()); + return Objects.hash(from, to, text, subject, mediaUrls, webhookUrl, webhookFailoverUrl, useProfileWebhooks, type, autoDetect); } @@ -120,9 +393,16 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateLongCodeMessageRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" from: ").append(toIndentedString(from)).append("\n"); sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" mediaUrls: ").append(toIndentedString(mediaUrls)).append("\n"); + sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); + sb.append(" webhookFailoverUrl: ").append(toIndentedString(webhookFailoverUrl)).append("\n"); + sb.append(" useProfileWebhooks: ").append(toIndentedString(useProfileWebhooks)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" autoDetect: ").append(toIndentedString(autoDetect)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/telnyx/sdk/model/CreateMessageRequest.java b/src/main/java/com/telnyx/sdk/model/CreateMessageRequest.java index 8ab91a68..316647b2 100644 --- a/src/main/java/com/telnyx/sdk/model/CreateMessageRequest.java +++ b/src/main/java/com/telnyx/sdk/model/CreateMessageRequest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -37,10 +36,18 @@ @JsonPropertyOrder({ CreateMessageRequest.JSON_PROPERTY_FROM, CreateMessageRequest.JSON_PROPERTY_MESSAGING_PROFILE_ID, - CreateMessageRequest.JSON_PROPERTY_TO + CreateMessageRequest.JSON_PROPERTY_TO, + CreateMessageRequest.JSON_PROPERTY_TEXT, + CreateMessageRequest.JSON_PROPERTY_SUBJECT, + CreateMessageRequest.JSON_PROPERTY_MEDIA_URLS, + CreateMessageRequest.JSON_PROPERTY_WEBHOOK_URL, + CreateMessageRequest.JSON_PROPERTY_WEBHOOK_FAILOVER_URL, + CreateMessageRequest.JSON_PROPERTY_USE_PROFILE_WEBHOOKS, + CreateMessageRequest.JSON_PROPERTY_TYPE, + CreateMessageRequest.JSON_PROPERTY_AUTO_DETECT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CreateMessageRequest extends BaseMessageRequest { +public class CreateMessageRequest { public static final String JSON_PROPERTY_FROM = "from"; private String from; @@ -50,6 +57,65 @@ public class CreateMessageRequest extends BaseMessageRequest { public static final String JSON_PROPERTY_TO = "to"; private String to; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MEDIA_URLS = "media_urls"; + private List mediaUrls = null; + + public static final String JSON_PROPERTY_WEBHOOK_URL = "webhook_url"; + private String webhookUrl; + + public static final String JSON_PROPERTY_WEBHOOK_FAILOVER_URL = "webhook_failover_url"; + private String webhookFailoverUrl; + + public static final String JSON_PROPERTY_USE_PROFILE_WEBHOOKS = "use_profile_webhooks"; + private Boolean useProfileWebhooks = true; + + /** + * The protocol for sending the message, either SMS or MMS. + */ + public enum TypeEnum { + SMS("SMS"), + + MMS("MMS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_AUTO_DETECT = "auto_detect"; + private Boolean autoDetect = false; + public CreateMessageRequest from(String from) { this.from = from; @@ -122,6 +188,206 @@ public void setTo(String to) { } + public CreateMessageRequest text(String text) { + this.text = text; + return this; + } + + /** + * Message body (i.e., content) as a non-empty string. **Required for SMS** + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message body (i.e., content) as a non-empty string. **Required for SMS**") + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public CreateMessageRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Subject of multimedia message + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of multimedia message") + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateMessageRequest mediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + return this; + } + + public CreateMessageRequest addMediaUrlsItem(String mediaUrlsItem) { + if (this.mediaUrls == null) { + this.mediaUrls = new ArrayList<>(); + } + this.mediaUrls.add(mediaUrlsItem); + return this; + } + + /** + * A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** + * @return mediaUrls + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**") + @JsonProperty(JSON_PROPERTY_MEDIA_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMediaUrls() { + return mediaUrls; + } + + + public void setMediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + } + + + public CreateMessageRequest webhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * The URL where webhooks related to this message will be sent. + * @return webhookUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL where webhooks related to this message will be sent.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookUrl() { + return webhookUrl; + } + + + public void setWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + } + + + public CreateMessageRequest webhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + return this; + } + + /** + * The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. + * @return webhookFailoverUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_FAILOVER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookFailoverUrl() { + return webhookFailoverUrl; + } + + + public void setWebhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + } + + + public CreateMessageRequest useProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + return this; + } + + /** + * If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. + * @return useProfileWebhooks + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.") + @JsonProperty(JSON_PROPERTY_USE_PROFILE_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseProfileWebhooks() { + return useProfileWebhooks; + } + + + public void setUseProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + } + + + public CreateMessageRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The protocol for sending the message, either SMS or MMS. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol for sending the message, either SMS or MMS.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public CreateMessageRequest autoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + return this; + } + + /** + * Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. + * @return autoDetect + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.") + @JsonProperty(JSON_PROPERTY_AUTO_DETECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAutoDetect() { + return autoDetect; + } + + + public void setAutoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + } + + /** * Return true if this CreateMessageRequest object is equal to o. */ @@ -137,12 +403,19 @@ public boolean equals(Object o) { return Objects.equals(this.from, createMessageRequest.from) && Objects.equals(this.messagingProfileId, createMessageRequest.messagingProfileId) && Objects.equals(this.to, createMessageRequest.to) && - super.equals(o); + Objects.equals(this.text, createMessageRequest.text) && + Objects.equals(this.subject, createMessageRequest.subject) && + Objects.equals(this.mediaUrls, createMessageRequest.mediaUrls) && + Objects.equals(this.webhookUrl, createMessageRequest.webhookUrl) && + Objects.equals(this.webhookFailoverUrl, createMessageRequest.webhookFailoverUrl) && + Objects.equals(this.useProfileWebhooks, createMessageRequest.useProfileWebhooks) && + Objects.equals(this.type, createMessageRequest.type) && + Objects.equals(this.autoDetect, createMessageRequest.autoDetect); } @Override public int hashCode() { - return Objects.hash(from, messagingProfileId, to, super.hashCode()); + return Objects.hash(from, messagingProfileId, to, text, subject, mediaUrls, webhookUrl, webhookFailoverUrl, useProfileWebhooks, type, autoDetect); } @@ -150,10 +423,17 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateMessageRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" from: ").append(toIndentedString(from)).append("\n"); sb.append(" messagingProfileId: ").append(toIndentedString(messagingProfileId)).append("\n"); sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" mediaUrls: ").append(toIndentedString(mediaUrls)).append("\n"); + sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); + sb.append(" webhookFailoverUrl: ").append(toIndentedString(webhookFailoverUrl)).append("\n"); + sb.append(" useProfileWebhooks: ").append(toIndentedString(useProfileWebhooks)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" autoDetect: ").append(toIndentedString(autoDetect)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequest.java b/src/main/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequest.java index f0f4709d..401082d8 100644 --- a/src/main/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequest.java +++ b/src/main/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -36,16 +35,83 @@ */ @JsonPropertyOrder({ CreateNumberPoolMessageRequest.JSON_PROPERTY_MESSAGING_PROFILE_ID, - CreateNumberPoolMessageRequest.JSON_PROPERTY_TO + CreateNumberPoolMessageRequest.JSON_PROPERTY_TO, + CreateNumberPoolMessageRequest.JSON_PROPERTY_TEXT, + CreateNumberPoolMessageRequest.JSON_PROPERTY_SUBJECT, + CreateNumberPoolMessageRequest.JSON_PROPERTY_MEDIA_URLS, + CreateNumberPoolMessageRequest.JSON_PROPERTY_WEBHOOK_URL, + CreateNumberPoolMessageRequest.JSON_PROPERTY_WEBHOOK_FAILOVER_URL, + CreateNumberPoolMessageRequest.JSON_PROPERTY_USE_PROFILE_WEBHOOKS, + CreateNumberPoolMessageRequest.JSON_PROPERTY_TYPE, + CreateNumberPoolMessageRequest.JSON_PROPERTY_AUTO_DETECT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CreateNumberPoolMessageRequest extends BaseMessageRequest { +public class CreateNumberPoolMessageRequest { public static final String JSON_PROPERTY_MESSAGING_PROFILE_ID = "messaging_profile_id"; private String messagingProfileId; public static final String JSON_PROPERTY_TO = "to"; private String to; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MEDIA_URLS = "media_urls"; + private List mediaUrls = null; + + public static final String JSON_PROPERTY_WEBHOOK_URL = "webhook_url"; + private String webhookUrl; + + public static final String JSON_PROPERTY_WEBHOOK_FAILOVER_URL = "webhook_failover_url"; + private String webhookFailoverUrl; + + public static final String JSON_PROPERTY_USE_PROFILE_WEBHOOKS = "use_profile_webhooks"; + private Boolean useProfileWebhooks = true; + + /** + * The protocol for sending the message, either SMS or MMS. + */ + public enum TypeEnum { + SMS("SMS"), + + MMS("MMS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_AUTO_DETECT = "auto_detect"; + private Boolean autoDetect = false; + public CreateNumberPoolMessageRequest messagingProfileId(String messagingProfileId) { this.messagingProfileId = messagingProfileId; @@ -93,6 +159,206 @@ public void setTo(String to) { } + public CreateNumberPoolMessageRequest text(String text) { + this.text = text; + return this; + } + + /** + * Message body (i.e., content) as a non-empty string. **Required for SMS** + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message body (i.e., content) as a non-empty string. **Required for SMS**") + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public CreateNumberPoolMessageRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Subject of multimedia message + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of multimedia message") + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateNumberPoolMessageRequest mediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + return this; + } + + public CreateNumberPoolMessageRequest addMediaUrlsItem(String mediaUrlsItem) { + if (this.mediaUrls == null) { + this.mediaUrls = new ArrayList<>(); + } + this.mediaUrls.add(mediaUrlsItem); + return this; + } + + /** + * A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** + * @return mediaUrls + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**") + @JsonProperty(JSON_PROPERTY_MEDIA_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMediaUrls() { + return mediaUrls; + } + + + public void setMediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + } + + + public CreateNumberPoolMessageRequest webhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * The URL where webhooks related to this message will be sent. + * @return webhookUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL where webhooks related to this message will be sent.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookUrl() { + return webhookUrl; + } + + + public void setWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + } + + + public CreateNumberPoolMessageRequest webhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + return this; + } + + /** + * The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. + * @return webhookFailoverUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_FAILOVER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookFailoverUrl() { + return webhookFailoverUrl; + } + + + public void setWebhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + } + + + public CreateNumberPoolMessageRequest useProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + return this; + } + + /** + * If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. + * @return useProfileWebhooks + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.") + @JsonProperty(JSON_PROPERTY_USE_PROFILE_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseProfileWebhooks() { + return useProfileWebhooks; + } + + + public void setUseProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + } + + + public CreateNumberPoolMessageRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The protocol for sending the message, either SMS or MMS. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol for sending the message, either SMS or MMS.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public CreateNumberPoolMessageRequest autoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + return this; + } + + /** + * Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. + * @return autoDetect + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.") + @JsonProperty(JSON_PROPERTY_AUTO_DETECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAutoDetect() { + return autoDetect; + } + + + public void setAutoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + } + + /** * Return true if this CreateNumberPoolMessageRequest object is equal to o. */ @@ -107,12 +373,19 @@ public boolean equals(Object o) { CreateNumberPoolMessageRequest createNumberPoolMessageRequest = (CreateNumberPoolMessageRequest) o; return Objects.equals(this.messagingProfileId, createNumberPoolMessageRequest.messagingProfileId) && Objects.equals(this.to, createNumberPoolMessageRequest.to) && - super.equals(o); + Objects.equals(this.text, createNumberPoolMessageRequest.text) && + Objects.equals(this.subject, createNumberPoolMessageRequest.subject) && + Objects.equals(this.mediaUrls, createNumberPoolMessageRequest.mediaUrls) && + Objects.equals(this.webhookUrl, createNumberPoolMessageRequest.webhookUrl) && + Objects.equals(this.webhookFailoverUrl, createNumberPoolMessageRequest.webhookFailoverUrl) && + Objects.equals(this.useProfileWebhooks, createNumberPoolMessageRequest.useProfileWebhooks) && + Objects.equals(this.type, createNumberPoolMessageRequest.type) && + Objects.equals(this.autoDetect, createNumberPoolMessageRequest.autoDetect); } @Override public int hashCode() { - return Objects.hash(messagingProfileId, to, super.hashCode()); + return Objects.hash(messagingProfileId, to, text, subject, mediaUrls, webhookUrl, webhookFailoverUrl, useProfileWebhooks, type, autoDetect); } @@ -120,9 +393,16 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNumberPoolMessageRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" messagingProfileId: ").append(toIndentedString(messagingProfileId)).append("\n"); sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" mediaUrls: ").append(toIndentedString(mediaUrls)).append("\n"); + sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); + sb.append(" webhookFailoverUrl: ").append(toIndentedString(webhookFailoverUrl)).append("\n"); + sb.append(" useProfileWebhooks: ").append(toIndentedString(useProfileWebhooks)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" autoDetect: ").append(toIndentedString(autoDetect)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/telnyx/sdk/model/CreateShortCodeMessageRequest.java b/src/main/java/com/telnyx/sdk/model/CreateShortCodeMessageRequest.java index 7357b8fb..aca9fef3 100644 --- a/src/main/java/com/telnyx/sdk/model/CreateShortCodeMessageRequest.java +++ b/src/main/java/com/telnyx/sdk/model/CreateShortCodeMessageRequest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -36,16 +35,83 @@ */ @JsonPropertyOrder({ CreateShortCodeMessageRequest.JSON_PROPERTY_FROM, - CreateShortCodeMessageRequest.JSON_PROPERTY_TO + CreateShortCodeMessageRequest.JSON_PROPERTY_TO, + CreateShortCodeMessageRequest.JSON_PROPERTY_TEXT, + CreateShortCodeMessageRequest.JSON_PROPERTY_SUBJECT, + CreateShortCodeMessageRequest.JSON_PROPERTY_MEDIA_URLS, + CreateShortCodeMessageRequest.JSON_PROPERTY_WEBHOOK_URL, + CreateShortCodeMessageRequest.JSON_PROPERTY_WEBHOOK_FAILOVER_URL, + CreateShortCodeMessageRequest.JSON_PROPERTY_USE_PROFILE_WEBHOOKS, + CreateShortCodeMessageRequest.JSON_PROPERTY_TYPE, + CreateShortCodeMessageRequest.JSON_PROPERTY_AUTO_DETECT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CreateShortCodeMessageRequest extends BaseMessageRequest { +public class CreateShortCodeMessageRequest { public static final String JSON_PROPERTY_FROM = "from"; private String from; public static final String JSON_PROPERTY_TO = "to"; private String to; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MEDIA_URLS = "media_urls"; + private List mediaUrls = null; + + public static final String JSON_PROPERTY_WEBHOOK_URL = "webhook_url"; + private String webhookUrl; + + public static final String JSON_PROPERTY_WEBHOOK_FAILOVER_URL = "webhook_failover_url"; + private String webhookFailoverUrl; + + public static final String JSON_PROPERTY_USE_PROFILE_WEBHOOKS = "use_profile_webhooks"; + private Boolean useProfileWebhooks = true; + + /** + * The protocol for sending the message, either SMS or MMS. + */ + public enum TypeEnum { + SMS("SMS"), + + MMS("MMS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_AUTO_DETECT = "auto_detect"; + private Boolean autoDetect = false; + public CreateShortCodeMessageRequest from(String from) { this.from = from; @@ -93,6 +159,206 @@ public void setTo(String to) { } + public CreateShortCodeMessageRequest text(String text) { + this.text = text; + return this; + } + + /** + * Message body (i.e., content) as a non-empty string. **Required for SMS** + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message body (i.e., content) as a non-empty string. **Required for SMS**") + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public CreateShortCodeMessageRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Subject of multimedia message + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of multimedia message") + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public CreateShortCodeMessageRequest mediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + return this; + } + + public CreateShortCodeMessageRequest addMediaUrlsItem(String mediaUrlsItem) { + if (this.mediaUrls == null) { + this.mediaUrls = new ArrayList<>(); + } + this.mediaUrls.add(mediaUrlsItem); + return this; + } + + /** + * A list of media URLs. The total media size must be less than 1 MB. **Required for MMS** + * @return mediaUrls + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**") + @JsonProperty(JSON_PROPERTY_MEDIA_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMediaUrls() { + return mediaUrls; + } + + + public void setMediaUrls(List mediaUrls) { + this.mediaUrls = mediaUrls; + } + + + public CreateShortCodeMessageRequest webhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * The URL where webhooks related to this message will be sent. + * @return webhookUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL where webhooks related to this message will be sent.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookUrl() { + return webhookUrl; + } + + + public void setWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + } + + + public CreateShortCodeMessageRequest webhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + return this; + } + + /** + * The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. + * @return webhookFailoverUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.") + @JsonProperty(JSON_PROPERTY_WEBHOOK_FAILOVER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getWebhookFailoverUrl() { + return webhookFailoverUrl; + } + + + public void setWebhookFailoverUrl(String webhookFailoverUrl) { + this.webhookFailoverUrl = webhookFailoverUrl; + } + + + public CreateShortCodeMessageRequest useProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + return this; + } + + /** + * If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile. + * @return useProfileWebhooks + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.") + @JsonProperty(JSON_PROPERTY_USE_PROFILE_WEBHOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseProfileWebhooks() { + return useProfileWebhooks; + } + + + public void setUseProfileWebhooks(Boolean useProfileWebhooks) { + this.useProfileWebhooks = useProfileWebhooks; + } + + + public CreateShortCodeMessageRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The protocol for sending the message, either SMS or MMS. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol for sending the message, either SMS or MMS.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public CreateShortCodeMessageRequest autoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + return this; + } + + /** + * Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. + * @return autoDetect + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts.") + @JsonProperty(JSON_PROPERTY_AUTO_DETECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAutoDetect() { + return autoDetect; + } + + + public void setAutoDetect(Boolean autoDetect) { + this.autoDetect = autoDetect; + } + + /** * Return true if this CreateShortCodeMessageRequest object is equal to o. */ @@ -107,12 +373,19 @@ public boolean equals(Object o) { CreateShortCodeMessageRequest createShortCodeMessageRequest = (CreateShortCodeMessageRequest) o; return Objects.equals(this.from, createShortCodeMessageRequest.from) && Objects.equals(this.to, createShortCodeMessageRequest.to) && - super.equals(o); + Objects.equals(this.text, createShortCodeMessageRequest.text) && + Objects.equals(this.subject, createShortCodeMessageRequest.subject) && + Objects.equals(this.mediaUrls, createShortCodeMessageRequest.mediaUrls) && + Objects.equals(this.webhookUrl, createShortCodeMessageRequest.webhookUrl) && + Objects.equals(this.webhookFailoverUrl, createShortCodeMessageRequest.webhookFailoverUrl) && + Objects.equals(this.useProfileWebhooks, createShortCodeMessageRequest.useProfileWebhooks) && + Objects.equals(this.type, createShortCodeMessageRequest.type) && + Objects.equals(this.autoDetect, createShortCodeMessageRequest.autoDetect); } @Override public int hashCode() { - return Objects.hash(from, to, super.hashCode()); + return Objects.hash(from, to, text, subject, mediaUrls, webhookUrl, webhookFailoverUrl, useProfileWebhooks, type, autoDetect); } @@ -120,9 +393,16 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateShortCodeMessageRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" from: ").append(toIndentedString(from)).append("\n"); sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" mediaUrls: ").append(toIndentedString(mediaUrls)).append("\n"); + sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); + sb.append(" webhookFailoverUrl: ").append(toIndentedString(webhookFailoverUrl)).append("\n"); + sb.append(" useProfileWebhooks: ").append(toIndentedString(useProfileWebhooks)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" autoDetect: ").append(toIndentedString(autoDetect)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/test/java/com/telnyx/sdk/model/BaseMessageRequestTest.java b/src/test/java/com/telnyx/sdk/model/BaseMessageRequestTest.java deleted file mode 100644 index 9b316685..00000000 --- a/src/test/java/com/telnyx/sdk/model/BaseMessageRequestTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Telnyx API - * SIP trunking, SMS, MMS, Call Control and Telephony Data Services. - * - * The version of the OpenAPI document: 2.0.0 - * Contact: support@telnyx.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.telnyx.sdk.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for BaseMessageRequest - */ -public class BaseMessageRequestTest { - private final BaseMessageRequest model = new BaseMessageRequest(); - - /** - * Model tests for BaseMessageRequest - */ - @Test - public void testBaseMessageRequest() { - // TODO: test BaseMessageRequest - } - - /** - * Test the property 'text' - */ - @Test - public void textTest() { - // TODO: test text - } - - /** - * Test the property 'subject' - */ - @Test - public void subjectTest() { - // TODO: test subject - } - - /** - * Test the property 'mediaUrls' - */ - @Test - public void mediaUrlsTest() { - // TODO: test mediaUrls - } - - /** - * Test the property 'webhookUrl' - */ - @Test - public void webhookUrlTest() { - // TODO: test webhookUrl - } - - /** - * Test the property 'webhookFailoverUrl' - */ - @Test - public void webhookFailoverUrlTest() { - // TODO: test webhookFailoverUrl - } - - /** - * Test the property 'useProfileWebhooks' - */ - @Test - public void useProfileWebhooksTest() { - // TODO: test useProfileWebhooks - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'autoDetect' - */ - @Test - public void autoDetectTest() { - // TODO: test autoDetect - } - -} diff --git a/src/test/java/com/telnyx/sdk/model/CreateLongCodeMessageRequestTest.java b/src/test/java/com/telnyx/sdk/model/CreateLongCodeMessageRequestTest.java index 50519c46..4ad5c1ba 100644 --- a/src/test/java/com/telnyx/sdk/model/CreateLongCodeMessageRequestTest.java +++ b/src/test/java/com/telnyx/sdk/model/CreateLongCodeMessageRequestTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -42,6 +41,22 @@ public void testCreateLongCodeMessageRequest() { // TODO: test CreateLongCodeMessageRequest } + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + /** * Test the property 'text' */ diff --git a/src/test/java/com/telnyx/sdk/model/CreateMessageRequestTest.java b/src/test/java/com/telnyx/sdk/model/CreateMessageRequestTest.java index c51c8914..f39e5fdc 100644 --- a/src/test/java/com/telnyx/sdk/model/CreateMessageRequestTest.java +++ b/src/test/java/com/telnyx/sdk/model/CreateMessageRequestTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -42,6 +41,30 @@ public void testCreateMessageRequest() { // TODO: test CreateMessageRequest } + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'messagingProfileId' + */ + @Test + public void messagingProfileIdTest() { + // TODO: test messagingProfileId + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + /** * Test the property 'text' */ diff --git a/src/test/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequestTest.java b/src/test/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequestTest.java index 466ac32c..448d1801 100644 --- a/src/test/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequestTest.java +++ b/src/test/java/com/telnyx/sdk/model/CreateNumberPoolMessageRequestTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -42,6 +41,22 @@ public void testCreateNumberPoolMessageRequest() { // TODO: test CreateNumberPoolMessageRequest } + /** + * Test the property 'messagingProfileId' + */ + @Test + public void messagingProfileIdTest() { + // TODO: test messagingProfileId + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + /** * Test the property 'text' */ diff --git a/src/test/java/com/telnyx/sdk/model/CreateShortCodeMessageRequestTest.java b/src/test/java/com/telnyx/sdk/model/CreateShortCodeMessageRequestTest.java index d099dcf5..9dbf6aab 100644 --- a/src/test/java/com/telnyx/sdk/model/CreateShortCodeMessageRequestTest.java +++ b/src/test/java/com/telnyx/sdk/model/CreateShortCodeMessageRequestTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.telnyx.sdk.model.BaseMessageRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -42,6 +41,22 @@ public void testCreateShortCodeMessageRequest() { // TODO: test CreateShortCodeMessageRequest } + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + /** * Test the property 'text' */