From 512d2eca0d099c328278953f412c383906e93087 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Thu, 27 Aug 2026 22:27:12 +0000 Subject: [PATCH] feat: add v5.14.0 package updates --- README.md | 6 +- api/openapi.yaml | 115 +++++- build.gradle | 2 +- build.sbt | 2 +- docs/BasicNotification.md | 12 +- docs/BasicNotificationAllOf.md | 12 +- docs/EmailWarmUp.md | 38 ++ docs/EmailWarmUpRequest.md | 24 ++ docs/EmailWarmUpStage.md | 17 + docs/Notification.md | 12 +- docs/NotificationWithMeta.md | 12 +- docs/NotificationWithMetaAllOf.md | 1 + pom.xml | 2 +- .../java/com/onesignal/client/ApiClient.java | 2 +- src/main/java/com/onesignal/client/JSON.java | 3 + .../com/onesignal/client/api/DefaultApi.java | 108 ++--- .../client/model/BasicNotification.java | 112 ++++- .../client/model/BasicNotificationAllOf.java | 112 ++++- .../onesignal/client/model/EmailWarmUp.java | 386 ++++++++++++++++++ .../client/model/EmailWarmUpRequest.java | 283 +++++++++++++ .../client/model/EmailWarmUpStage.java | 279 +++++++++++++ .../onesignal/client/model/Notification.java | 112 ++++- .../client/model/NotificationWithMeta.java | 112 ++++- .../model/NotificationWithMetaAllOf.java | 35 +- 24 files changed, 1718 insertions(+), 81 deletions(-) create mode 100644 docs/EmailWarmUp.md create mode 100644 docs/EmailWarmUpRequest.md create mode 100644 docs/EmailWarmUpStage.md create mode 100644 src/main/java/com/onesignal/client/model/EmailWarmUp.java create mode 100644 src/main/java/com/onesignal/client/model/EmailWarmUpRequest.java create mode 100644 src/main/java/com/onesignal/client/model/EmailWarmUpStage.java diff --git a/README.md b/README.md index 494b4f3..9bce7ed 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > **Building with an AI agent or LLM?** See [AGENTS.md](https://github.com/OneSignal/onesignal-java-api/blob/main/AGENTS.md) for an agent-oriented integration guide — authentication, calling conventions, idempotent retries, and the full API reference. OneSignal -- API version: 5.13.0 +- API version: 5.14.0 A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com @@ -21,14 +21,14 @@ Building the API client library requires: com.onesignal onesignal-java-client - 5.13.0 + 5.14.0 ``` ### Gradle ```groovy -implementation "com.onesignal:onesignal-java-client:5.13.0" +implementation "com.onesignal:onesignal-java-client:5.14.0" ``` ## Configuration diff --git a/api/openapi.yaml b/api/openapi.yaml index 24b97e8..e0dc964 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 5.13.0 + version: 5.14.0 servers: - url: https://api.onesignal.com paths: @@ -3869,6 +3869,98 @@ components: - $ref: '#/components/schemas/BasicNotification_allOf' - required: - app_id + EmailWarmUpStage: + description: "Channel: Email\nOne stage of an Auto Warm Up campaign's sending\ + \ schedule." + properties: + start: + description: ISO 8601 timestamp for the start of this stage. Sending for + this stage will not begin before this time. + format: date-time + type: string + end: + description: ISO 8601 timestamp for the end of this stage. This stage's + quota is expected to be sent by this time. + format: date-time + type: string + quota: + description: Number of emails to send during this stage. + minimum: 0 + type: integer + acked: + description: Whether this stage has been picked up and acknowledged by the + warm-up scheduler. Not accepted on create. This is only present when reading + back a campaign. + readOnly: true + type: boolean + required: + - end + - quota + - start + type: object + EmailWarmUpRequest: + description: "Channel: Email\nRequired when `kind` is \"warmup\". The gradual\ + \ sending schedule for the Auto Warm Up campaign." + nullable: true + properties: + stages: + description: Required. The ordered stages that make up the campaign's sending + schedule. + items: + $ref: '#/components/schemas/EmailWarmUpStage' + type: array + strategy: + description: "How the stage schedule should be treated:\n * `recommended`\ + \ - (Default) OneSignal may adjust the provided stages based on past delivery\ + \ volumes, scheduled Auto Warm Up emails, and the size of the current\ + \ audience.\n * `custom` - The stages provided are sent as-is.\n" + enum: + - recommended + - custom + nullable: true + type: string + required: + - stages + type: object + EmailWarmUp: + description: "Channel: Email\nPresent only when this notification's `kind` is\ + \ \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy,\ + \ and live status." + properties: + stages: + description: "The campaign's sending schedule, stage by stage." + items: + $ref: '#/components/schemas/EmailWarmUpStage' + type: array + strategy: + description: "How the stage schedule was produced:\n * `recommended` -\ + \ OneSignal generated (and may still adjust) the schedule based on past\ + \ delivery volumes, scheduled Auto Warm Up emails, and the size of the\ + \ current audience.\n * `custom` - The stages were provided as-is in\ + \ the create request.\n" + enum: + - recommended + - custom + type: string + status: + description: | + Current status of the campaign: + * `initializing` - The stages have been submitted and the schedule is being set up. + * `draft` - The campaign has been created but has not started sending. + * `active` - The campaign is currently working through its stages. + * `finished` - All stages have completed. + * `canceled` - The campaign was canceled before finishing. + enum: + - initializing + - draft + - active + - finished + - canceled + type: string + is_live: + description: Whether the campaign is currently live (actively sending). + type: boolean + type: object Notification: allOf: - $ref: '#/components/schemas/BasicNotification' @@ -8743,7 +8835,7 @@ components: type: string writeOnly: true email_subject: - description: "Channel: Email\nRequired. The subject of the email.\n" + description: "Channel: Email\nRequired. The subject of the email.\n" nullable: true type: string writeOnly: true @@ -8816,6 +8908,23 @@ components: nullable: true type: string writeOnly: true + kind: + description: "Channel: Email\nSet to \"warmup\" to send this as an Auto\ + \ Warm Up campaign: a single campaign delivered gradually to your audience\ + \ over several days, so you don't have to pace sends manually. OneSignal\ + \ generates a sending schedule based on your past delivery volumes, scheduled\ + \ Auto Warm Up emails, and the size of your current audience.\nWhen set,\ + \ `email_warm_up` is required and describes the campaign's stages and\ + \ (optionally) its scheduling strategy. `send_after` cannot be combined\ + \ with `kind: \"warmup\"`. The campaign will be scheduled to begin at\ + \ its first stage's `start` time.\nOnly supported for Email notifications.\n" + enum: + - warmup + nullable: true + type: string + writeOnly: true + email_warm_up: + $ref: '#/components/schemas/EmailWarmUpRequest' sms_from: description: "Channel: SMS\nPhone Number used to send SMS. Should be a registered\ \ Twilio phone number in E.164 format.\n" @@ -8969,6 +9078,8 @@ components: description: Number of BCC copies successfully sent for this notification. nullable: true type: integer + email_warm_up: + $ref: '#/components/schemas/EmailWarmUp' type: object PlatformDeliveryData_sms_allOf: properties: diff --git a/build.gradle b/build.gradle index 533f7fd..b756aec 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'com.vanniktech.maven.publish' group = 'com.onesignal' -version = '5.13.0' +version = '5.14.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index a43c93e..5917c23 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.onesignal", name := "onesignal-java-client", - version := "5.13.0", + version := "5.14.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index 0b8389e..e3ba1ea 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -106,7 +106,7 @@ |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | |**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | |**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | -|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | |**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -116,6 +116,8 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**emailBcc** | **List<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] | |**emailSenderDomain** | **String** | Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email. | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. | [optional] | +|**emailWarmUp** | [**EmailWarmUpRequest**](EmailWarmUpRequest.md) | | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | |**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | @@ -147,6 +149,14 @@ +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WARMUP | "warmup" | + + + ## Enum: HuaweiCategoryEnum | Name | Value | diff --git a/docs/BasicNotificationAllOf.md b/docs/BasicNotificationAllOf.md index e3b406e..041d866 100644 --- a/docs/BasicNotificationAllOf.md +++ b/docs/BasicNotificationAllOf.md @@ -92,7 +92,7 @@ |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | |**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | |**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | -|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | |**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -102,6 +102,8 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**emailBcc** | **List<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] | |**emailSenderDomain** | **String** | Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email. | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. | [optional] | +|**emailWarmUp** | [**EmailWarmUpRequest**](EmailWarmUpRequest.md) | | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | |**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | @@ -123,6 +125,14 @@ +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WARMUP | "warmup" | + + + ## Enum: HuaweiCategoryEnum | Name | Value | diff --git a/docs/EmailWarmUp.md b/docs/EmailWarmUp.md new file mode 100644 index 0000000..fd9749f --- /dev/null +++ b/docs/EmailWarmUp.md @@ -0,0 +1,38 @@ + + +# EmailWarmUp + +Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stages** | [**List<EmailWarmUpStage>**](EmailWarmUpStage.md) | The campaign's sending schedule, stage by stage. | [optional] | +|**strategy** | [**StrategyEnum**](#StrategyEnum) | How the stage schedule was produced: * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages were provided as-is in the create request. | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Current status of the campaign: * `initializing` - The stages have been submitted and the schedule is being set up. * `draft` - The campaign has been created but has not started sending. * `active` - The campaign is currently working through its stages. * `finished` - All stages have completed. * `canceled` - The campaign was canceled before finishing. | [optional] | +|**isLive** | **Boolean** | Whether the campaign is currently live (actively sending). | [optional] | + + + +## Enum: StrategyEnum + +| Name | Value | +|---- | -----| +| RECOMMENDED | "recommended" | +| CUSTOM | "custom" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| INITIALIZING | "initializing" | +| DRAFT | "draft" | +| ACTIVE | "active" | +| FINISHED | "finished" | +| CANCELED | "canceled" | + + + diff --git a/docs/EmailWarmUpRequest.md b/docs/EmailWarmUpRequest.md new file mode 100644 index 0000000..e187fe5 --- /dev/null +++ b/docs/EmailWarmUpRequest.md @@ -0,0 +1,24 @@ + + +# EmailWarmUpRequest + +Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**stages** | [**List<EmailWarmUpStage>**](EmailWarmUpStage.md) | Required. The ordered stages that make up the campaign's sending schedule. | | +|**strategy** | [**StrategyEnum**](#StrategyEnum) | How the stage schedule should be treated: * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages provided are sent as-is. | [optional] | + + + +## Enum: StrategyEnum + +| Name | Value | +|---- | -----| +| RECOMMENDED | "recommended" | +| CUSTOM | "custom" | + + + diff --git a/docs/EmailWarmUpStage.md b/docs/EmailWarmUpStage.md new file mode 100644 index 0000000..505b119 --- /dev/null +++ b/docs/EmailWarmUpStage.md @@ -0,0 +1,17 @@ + + +# EmailWarmUpStage + +Channel: Email One stage of an Auto Warm Up campaign's sending schedule. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**start** | **OffsetDateTime** | ISO 8601 timestamp for the start of this stage. Sending for this stage will not begin before this time. | | +|**end** | **OffsetDateTime** | ISO 8601 timestamp for the end of this stage. This stage's quota is expected to be sent by this time. | | +|**quota** | **Integer** | Number of emails to send during this stage. | | +|**acked** | **Boolean** | Whether this stage has been picked up and acknowledged by the warm-up scheduler. Not accepted on create. This is only present when reading back a campaign. | [optional] [readonly] | + + + diff --git a/docs/Notification.md b/docs/Notification.md index bf9988f..49c003e 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -106,7 +106,7 @@ |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | |**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | |**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | -|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | |**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -116,6 +116,8 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**emailBcc** | **List<String>** | Channel: Email BCC recipients for the email. Maximum 5 addresses. Only supported when the email service provider is OneSignal Email. | [optional] | |**emailSenderDomain** | **String** | Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email. | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. | [optional] | +|**emailWarmUp** | [**EmailWarmUpRequest**](EmailWarmUpRequest.md) | | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | |**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | @@ -148,6 +150,14 @@ +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WARMUP | "warmup" | + + + ## Enum: HuaweiCategoryEnum | Name | Value | diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index 53f43ed..51b71de 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -106,7 +106,7 @@ |**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | |**iosRelevanceScore** | **BigDecimal** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] | |**iosInterruptionLevel** | **String** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] | -|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailSubject** | **String** | Channel: Email Required. The subject of the email. | [optional] | |**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | |**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | |**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -116,6 +116,8 @@ |**includeUnsubscribed** | **Boolean** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] | |**emailBcc** | **List<String>** | BCC recipients that were set on this email notification. | [optional] | |**emailSenderDomain** | **String** | Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email. | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. | [optional] | +|**emailWarmUp** | [**EmailWarmUp**](EmailWarmUp.md) | | [optional] | |**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | |**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | |**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | @@ -160,6 +162,14 @@ +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| WARMUP | "warmup" | + + + ## Enum: HuaweiCategoryEnum | Name | Value | diff --git a/docs/NotificationWithMetaAllOf.md b/docs/NotificationWithMetaAllOf.md index 6cccb61..906d82a 100644 --- a/docs/NotificationWithMetaAllOf.md +++ b/docs/NotificationWithMetaAllOf.md @@ -21,6 +21,7 @@ |**canceled** | **Boolean** | Indicates whether the notification was canceled before it could be sent. | [optional] | |**emailBcc** | **List<String>** | BCC recipients that were set on this email notification. | [optional] | |**bccSent** | **Integer** | Number of BCC copies successfully sent for this notification. | [optional] | +|**emailWarmUp** | [**EmailWarmUp**](EmailWarmUp.md) | | [optional] | diff --git a/pom.xml b/pom.xml index 2307ede..f9f1340 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ onesignal-java-client jar onesignal-java-client - 5.13.0 + 5.14.0 https://github.com/OneSignal/onesignal-java-api OneSignal Java API Client diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java index a2a03d8..9fc642a 100644 --- a/src/main/java/com/onesignal/client/ApiClient.java +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -132,7 +132,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/5.13.0/java"); + setUserAgent("OpenAPI-Generator/5.14.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index 002b2d1..7755a66 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -117,6 +117,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.CustomEvent.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CustomEventsRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUp.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUpStage.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportEventsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportSubscriptionsRequestBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportSubscriptionsSuccessResponse.CustomTypeAdapterFactory()) diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index 136b0a8..047163e 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -164,7 +164,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -322,7 +322,7 @@ public okhttp3.Call copyTemplateToAppCall(String templateId, String appId, CopyT Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -488,7 +488,7 @@ public okhttp3.Call createAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -665,7 +665,7 @@ public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscript Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -829,7 +829,7 @@ public okhttp3.Call createApiKeyCall(String appId, CreateApiKeyRequest createApi Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -975,7 +975,7 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1119,7 +1119,7 @@ public okhttp3.Call createCustomEventsCall(String appId, CustomEventsRequest cus Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1274,7 +1274,7 @@ public okhttp3.Call createJourneyCall(String appId, CreateJourneyRequest createJ Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1426,7 +1426,7 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1570,7 +1570,7 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1726,7 +1726,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -1900,7 +1900,7 @@ public okhttp3.Call createTemplateCall(CreateTemplateRequest createTemplateReque Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2046,7 +2046,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2213,7 +2213,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2386,7 +2386,7 @@ public okhttp3.Call deleteApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2536,7 +2536,7 @@ public okhttp3.Call deleteJourneyCall(String appId, String journeyId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2692,7 +2692,7 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -2849,7 +2849,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -3002,7 +3002,7 @@ public okhttp3.Call deleteTemplateCall(String templateId, String appId, final Ap Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -3161,7 +3161,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -3320,7 +3320,7 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -3478,7 +3478,7 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -3628,7 +3628,7 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -3791,7 +3791,7 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -3941,7 +3941,7 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -4081,7 +4081,7 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -4217,7 +4217,7 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4376,7 +4376,7 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -4532,7 +4532,7 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4711,7 +4711,7 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (outcomeNames != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); @@ -4897,7 +4897,7 @@ public okhttp3.Call getSegmentCall(String appId, String segmentId, Boolean inclu Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (includeSegmentDetail != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include-segment-detail", includeSegmentDetail)); @@ -5059,7 +5059,7 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (offset != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); @@ -5220,7 +5220,7 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -5394,7 +5394,7 @@ public okhttp3.Call listAuditLogsCall(String organizationId, String startTime, S Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); @@ -5620,7 +5620,7 @@ public okhttp3.Call rotateApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -5770,7 +5770,7 @@ public okhttp3.Call startLiveActivityCall(String appId, String activityType, Sta Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -5933,7 +5933,7 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -6100,7 +6100,7 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (token != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); @@ -6264,7 +6264,7 @@ public okhttp3.Call updateApiKeyCall(String appId, String tokenId, UpdateApiKeyR Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -6420,7 +6420,7 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -6577,7 +6577,7 @@ public okhttp3.Call updateJourneyCall(String appId, String journeyId, UpdateJour Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -6756,7 +6756,7 @@ public okhttp3.Call updateJourneyNodeCall(String appId, String journeyId, String Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -6937,7 +6937,7 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -7100,7 +7100,7 @@ public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegm Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -7264,7 +7264,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -7429,7 +7429,7 @@ public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -7596,7 +7596,7 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -7761,7 +7761,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -7929,7 +7929,7 @@ public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) t Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -8070,7 +8070,7 @@ public okhttp3.Call viewJourneyCall(String appId, String journeyId, final ApiCal Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -8222,7 +8222,7 @@ public okhttp3.Call viewJourneyStatsCall(String appId, String journeyId, final A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); final String[] localVarAccepts = { "application/json" @@ -8375,7 +8375,7 @@ public okhttp3.Call viewJourneysCall(String appId, String cursor, Integer limit, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (cursor != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); @@ -8535,7 +8535,7 @@ public okhttp3.Call viewTemplateCall(String templateId, String appId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -8691,7 +8691,7 @@ public okhttp3.Call viewTemplatesCall(String appId, Integer limit, Integer offse Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.13.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); diff --git a/src/main/java/com/onesignal/client/model/BasicNotification.java b/src/main/java/com/onesignal/client/model/BasicNotification.java index 5f89dec..5a1124c 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotification.java +++ b/src/main/java/com/onesignal/client/model/BasicNotification.java @@ -22,6 +22,7 @@ import com.onesignal.client.model.BasicNotificationAllOf; import com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout; import com.onesignal.client.model.Button; +import com.onesignal.client.model.EmailWarmUpRequest; import com.onesignal.client.model.FilterExpression; import com.onesignal.client.model.LanguageStringMap; import com.onesignal.client.model.NotificationTarget; @@ -596,6 +597,59 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EMAIL_SENDER_DOMAIN) private String emailSenderDomain; + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WARMUP("warmup"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_EMAIL_WARM_UP = "email_warm_up"; + @SerializedName(SERIALIZED_NAME_EMAIL_WARM_UP) + private EmailWarmUpRequest emailWarmUp; + public static final String SERIALIZED_NAME_SMS_FROM = "sms_from"; @SerializedName(SERIALIZED_NAME_SMS_FROM) private String smsFrom; @@ -3102,11 +3156,11 @@ public BasicNotification emailSubject(String emailSubject) { } /** - * Channel: Email Required. The subject of the email. + * Channel: Email Required. The subject of the email. * @return emailSubject **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") + @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") public String getEmailSubject() { return emailSubject; @@ -3333,6 +3387,52 @@ public void setEmailSenderDomain(String emailSenderDomain) { } + public BasicNotification kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. ") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public BasicNotification emailWarmUp(EmailWarmUpRequest emailWarmUp) { + + this.emailWarmUp = emailWarmUp; + return this; + } + + /** + * Get emailWarmUp + * @return emailWarmUp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailWarmUpRequest getEmailWarmUp() { + return emailWarmUp; + } + + + public void setEmailWarmUp(EmailWarmUpRequest emailWarmUp) { + this.emailWarmUp = emailWarmUp; + } + + public BasicNotification smsFrom(String smsFrom) { this.smsFrom = smsFrom; @@ -3675,6 +3775,8 @@ public boolean equals(Object o) { Objects.equals(this.includeUnsubscribed, basicNotification.includeUnsubscribed) && Objects.equals(this.emailBcc, basicNotification.emailBcc) && Objects.equals(this.emailSenderDomain, basicNotification.emailSenderDomain) && + Objects.equals(this.kind, basicNotification.kind) && + Objects.equals(this.emailWarmUp, basicNotification.emailWarmUp) && Objects.equals(this.smsFrom, basicNotification.smsFrom) && Objects.equals(this.smsMediaUrls, basicNotification.smsMediaUrls) && Objects.equals(this.filters, basicNotification.filters) && @@ -3692,7 +3794,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag); + return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, kind, emailWarmUp, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag); } private static int hashCodeNullable(JsonNullable a) { @@ -3815,6 +3917,8 @@ public String toString() { sb.append(" includeUnsubscribed: ").append(toIndentedString(includeUnsubscribed)).append("\n"); sb.append(" emailBcc: ").append(toIndentedString(emailBcc)).append("\n"); sb.append(" emailSenderDomain: ").append(toIndentedString(emailSenderDomain)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" emailWarmUp: ").append(toIndentedString(emailWarmUp)).append("\n"); sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); sb.append(" smsMediaUrls: ").append(toIndentedString(smsMediaUrls)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); @@ -3955,6 +4059,8 @@ private String toIndentedString(Object o) { openapiFields.add("include_unsubscribed"); openapiFields.add("email_bcc"); openapiFields.add("email_sender_domain"); + openapiFields.add("kind"); + openapiFields.add("email_warm_up"); openapiFields.add("sms_from"); openapiFields.add("sms_media_urls"); openapiFields.add("filters"); diff --git a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java index 485793c..be99bf0 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java +++ b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonWriter; import com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout; import com.onesignal.client.model.Button; +import com.onesignal.client.model.EmailWarmUpRequest; import com.onesignal.client.model.FilterExpression; import com.onesignal.client.model.LanguageStringMap; import com.onesignal.client.model.WebButton; @@ -487,6 +488,59 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EMAIL_SENDER_DOMAIN) private String emailSenderDomain; + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WARMUP("warmup"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_EMAIL_WARM_UP = "email_warm_up"; + @SerializedName(SERIALIZED_NAME_EMAIL_WARM_UP) + private EmailWarmUpRequest emailWarmUp; + public static final String SERIALIZED_NAME_SMS_FROM = "sms_from"; @SerializedName(SERIALIZED_NAME_SMS_FROM) private String smsFrom; @@ -2565,11 +2619,11 @@ public BasicNotificationAllOf emailSubject(String emailSubject) { } /** - * Channel: Email Required. The subject of the email. + * Channel: Email Required. The subject of the email. * @return emailSubject **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") + @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") public String getEmailSubject() { return emailSubject; @@ -2796,6 +2850,52 @@ public void setEmailSenderDomain(String emailSenderDomain) { } + public BasicNotificationAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. ") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public BasicNotificationAllOf emailWarmUp(EmailWarmUpRequest emailWarmUp) { + + this.emailWarmUp = emailWarmUp; + return this; + } + + /** + * Get emailWarmUp + * @return emailWarmUp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailWarmUpRequest getEmailWarmUp() { + return emailWarmUp; + } + + + public void setEmailWarmUp(EmailWarmUpRequest emailWarmUp) { + this.emailWarmUp = emailWarmUp; + } + + public BasicNotificationAllOf smsFrom(String smsFrom) { this.smsFrom = smsFrom; @@ -3124,6 +3224,8 @@ public boolean equals(Object o) { Objects.equals(this.includeUnsubscribed, basicNotificationAllOf.includeUnsubscribed) && Objects.equals(this.emailBcc, basicNotificationAllOf.emailBcc) && Objects.equals(this.emailSenderDomain, basicNotificationAllOf.emailSenderDomain) && + Objects.equals(this.kind, basicNotificationAllOf.kind) && + Objects.equals(this.emailWarmUp, basicNotificationAllOf.emailWarmUp) && Objects.equals(this.smsFrom, basicNotificationAllOf.smsFrom) && Objects.equals(this.smsMediaUrls, basicNotificationAllOf.smsMediaUrls) && Objects.equals(this.filters, basicNotificationAllOf.filters) && @@ -3141,7 +3243,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag); + return Objects.hash(id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, kind, emailWarmUp, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag); } private static int hashCodeNullable(JsonNullable a) { @@ -3250,6 +3352,8 @@ public String toString() { sb.append(" includeUnsubscribed: ").append(toIndentedString(includeUnsubscribed)).append("\n"); sb.append(" emailBcc: ").append(toIndentedString(emailBcc)).append("\n"); sb.append(" emailSenderDomain: ").append(toIndentedString(emailSenderDomain)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" emailWarmUp: ").append(toIndentedString(emailWarmUp)).append("\n"); sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); sb.append(" smsMediaUrls: ").append(toIndentedString(smsMediaUrls)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); @@ -3376,6 +3480,8 @@ private String toIndentedString(Object o) { openapiFields.add("include_unsubscribed"); openapiFields.add("email_bcc"); openapiFields.add("email_sender_domain"); + openapiFields.add("kind"); + openapiFields.add("email_warm_up"); openapiFields.add("sms_from"); openapiFields.add("sms_media_urls"); openapiFields.add("filters"); diff --git a/src/main/java/com/onesignal/client/model/EmailWarmUp.java b/src/main/java/com/onesignal/client/model/EmailWarmUp.java new file mode 100644 index 0000000..415e810 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailWarmUp.java @@ -0,0 +1,386 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.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.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 com.onesignal.client.model.EmailWarmUpStage; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status. + */ +@ApiModel(description = "Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailWarmUp { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_STAGES = "stages"; + @SerializedName(SERIALIZED_NAME_STAGES) + private List stages = null; + + /** + * How the stage schedule was produced: * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages were provided as-is in the create request. + */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + RECOMMENDED("recommended"), + + CUSTOM("custom"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + /** + * Current status of the campaign: * `initializing` - The stages have been submitted and the schedule is being set up. * `draft` - The campaign has been created but has not started sending. * `active` - The campaign is currently working through its stages. * `finished` - All stages have completed. * `canceled` - The campaign was canceled before finishing. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + INITIALIZING("initializing"), + + DRAFT("draft"), + + ACTIVE("active"), + + FINISHED("finished"), + + CANCELED("canceled"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_IS_LIVE = "is_live"; + @SerializedName(SERIALIZED_NAME_IS_LIVE) + private Boolean isLive; + + public EmailWarmUp() { + } + + public EmailWarmUp stages(List stages) { + + this.stages = stages; + return this; + } + + public EmailWarmUp addStagesItem(EmailWarmUpStage stagesItem) { + if (this.stages == null) { + this.stages = new ArrayList<>(); + } + this.stages.add(stagesItem); + return this; + } + + /** + * The campaign's sending schedule, stage by stage. + * @return stages + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The campaign's sending schedule, stage by stage.") + + public List getStages() { + return stages; + } + + + public void setStages(List stages) { + this.stages = stages; + } + + + public EmailWarmUp strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * How the stage schedule was produced: * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages were provided as-is in the create request. + * @return strategy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "How the stage schedule was produced: * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages were provided as-is in the create request. ") + + public StrategyEnum getStrategy() { + return strategy; + } + + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + + public EmailWarmUp status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Current status of the campaign: * `initializing` - The stages have been submitted and the schedule is being set up. * `draft` - The campaign has been created but has not started sending. * `active` - The campaign is currently working through its stages. * `finished` - All stages have completed. * `canceled` - The campaign was canceled before finishing. + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Current status of the campaign: * `initializing` - The stages have been submitted and the schedule is being set up. * `draft` - The campaign has been created but has not started sending. * `active` - The campaign is currently working through its stages. * `finished` - All stages have completed. * `canceled` - The campaign was canceled before finishing. ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public EmailWarmUp isLive(Boolean isLive) { + + this.isLive = isLive; + return this; + } + + /** + * Whether the campaign is currently live (actively sending). + * @return isLive + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the campaign is currently live (actively sending).") + + public Boolean getIsLive() { + return isLive; + } + + + public void setIsLive(Boolean isLive) { + this.isLive = isLive; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailWarmUp emailWarmUp = (EmailWarmUp) o; + return Objects.equals(this.stages, emailWarmUp.stages) && + Objects.equals(this.strategy, emailWarmUp.strategy) && + Objects.equals(this.status, emailWarmUp.status) && + Objects.equals(this.isLive, emailWarmUp.isLive); + } + + @Override + public int hashCode() { + return Objects.hash(stages, strategy, status, isLive); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailWarmUp {\n"); + sb.append(" stages: ").append(toIndentedString(stages)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" isLive: ").append(toIndentedString(isLive)).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("stages"); + openapiFields.add("strategy"); + openapiFields.add("status"); + openapiFields.add("is_live"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailWarmUp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailWarmUp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailWarmUp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailWarmUp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailWarmUp read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailWarmUp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailWarmUp + * @throws IOException if the JSON string is invalid with respect to EmailWarmUp + */ + public static EmailWarmUp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailWarmUp.class); + } + + /** + * Convert an instance of EmailWarmUp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/EmailWarmUpRequest.java b/src/main/java/com/onesignal/client/model/EmailWarmUpRequest.java new file mode 100644 index 0000000..f3d3871 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailWarmUpRequest.java @@ -0,0 +1,283 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.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.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 com.onesignal.client.model.EmailWarmUpStage; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign. + */ +@ApiModel(description = "Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailWarmUpRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_STAGES = "stages"; + @SerializedName(SERIALIZED_NAME_STAGES) + private List stages = new ArrayList<>(); + + /** + * How the stage schedule should be treated: * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages provided are sent as-is. + */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + RECOMMENDED("recommended"), + + CUSTOM("custom"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + public EmailWarmUpRequest() { + } + + public EmailWarmUpRequest stages(List stages) { + + this.stages = stages; + return this; + } + + public EmailWarmUpRequest addStagesItem(EmailWarmUpStage stagesItem) { + this.stages.add(stagesItem); + return this; + } + + /** + * Required. The ordered stages that make up the campaign's sending schedule. + * @return stages + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Required. The ordered stages that make up the campaign's sending schedule.") + + public List getStages() { + return stages; + } + + + public void setStages(List stages) { + this.stages = stages; + } + + + public EmailWarmUpRequest strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * How the stage schedule should be treated: * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages provided are sent as-is. + * @return strategy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "How the stage schedule should be treated: * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience. * `custom` - The stages provided are sent as-is. ") + + public StrategyEnum getStrategy() { + return strategy; + } + + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailWarmUpRequest emailWarmUpRequest = (EmailWarmUpRequest) o; + return Objects.equals(this.stages, emailWarmUpRequest.stages) && + Objects.equals(this.strategy, emailWarmUpRequest.strategy); + } + + 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(stages, strategy); + } + + 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 EmailWarmUpRequest {\n"); + sb.append(" stages: ").append(toIndentedString(stages)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).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("stages"); + openapiFields.add("strategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stages"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailWarmUpRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailWarmUpRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailWarmUpRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailWarmUpRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailWarmUpRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailWarmUpRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailWarmUpRequest + * @throws IOException if the JSON string is invalid with respect to EmailWarmUpRequest + */ + public static EmailWarmUpRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailWarmUpRequest.class); + } + + /** + * Convert an instance of EmailWarmUpRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/EmailWarmUpStage.java b/src/main/java/com/onesignal/client/model/EmailWarmUpStage.java new file mode 100644 index 0000000..6ce78f4 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailWarmUpStage.java @@ -0,0 +1,279 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * Contact: devrel@onesignal.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.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.io.Serializable; + +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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Channel: Email One stage of an Auto Warm Up campaign's sending schedule. + */ +@ApiModel(description = "Channel: Email One stage of an Auto Warm Up campaign's sending schedule.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailWarmUpStage { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_START = "start"; + @SerializedName(SERIALIZED_NAME_START) + private OffsetDateTime start; + + public static final String SERIALIZED_NAME_END = "end"; + @SerializedName(SERIALIZED_NAME_END) + private OffsetDateTime end; + + public static final String SERIALIZED_NAME_QUOTA = "quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + private Integer quota; + + public static final String SERIALIZED_NAME_ACKED = "acked"; + @SerializedName(SERIALIZED_NAME_ACKED) + private Boolean acked; + + public EmailWarmUpStage() { + } + + + public EmailWarmUpStage( + Boolean acked + ) { + this(); + this.acked = acked; + } + + public EmailWarmUpStage start(OffsetDateTime start) { + + this.start = start; + return this; + } + + /** + * ISO 8601 timestamp for the start of this stage. Sending for this stage will not begin before this time. + * @return start + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "ISO 8601 timestamp for the start of this stage. Sending for this stage will not begin before this time.") + + public OffsetDateTime getStart() { + return start; + } + + + public void setStart(OffsetDateTime start) { + this.start = start; + } + + + public EmailWarmUpStage end(OffsetDateTime end) { + + this.end = end; + return this; + } + + /** + * ISO 8601 timestamp for the end of this stage. This stage's quota is expected to be sent by this time. + * @return end + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "ISO 8601 timestamp for the end of this stage. This stage's quota is expected to be sent by this time.") + + public OffsetDateTime getEnd() { + return end; + } + + + public void setEnd(OffsetDateTime end) { + this.end = end; + } + + + public EmailWarmUpStage quota(Integer quota) { + + this.quota = quota; + return this; + } + + /** + * Number of emails to send during this stage. + * minimum: 0 + * @return quota + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Number of emails to send during this stage.") + + public Integer getQuota() { + return quota; + } + + + public void setQuota(Integer quota) { + this.quota = quota; + } + + + /** + * Whether this stage has been picked up and acknowledged by the warm-up scheduler. Not accepted on create. This is only present when reading back a campaign. + * @return acked + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this stage has been picked up and acknowledged by the warm-up scheduler. Not accepted on create. This is only present when reading back a campaign.") + + public Boolean getAcked() { + return acked; + } + + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailWarmUpStage emailWarmUpStage = (EmailWarmUpStage) o; + return Objects.equals(this.start, emailWarmUpStage.start) && + Objects.equals(this.end, emailWarmUpStage.end) && + Objects.equals(this.quota, emailWarmUpStage.quota) && + Objects.equals(this.acked, emailWarmUpStage.acked); + } + + @Override + public int hashCode() { + return Objects.hash(start, end, quota, acked); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailWarmUpStage {\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" acked: ").append(toIndentedString(acked)).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("start"); + openapiFields.add("end"); + openapiFields.add("quota"); + openapiFields.add("acked"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("start"); + openapiRequiredFields.add("end"); + openapiRequiredFields.add("quota"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailWarmUpStage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailWarmUpStage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailWarmUpStage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailWarmUpStage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailWarmUpStage read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailWarmUpStage given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailWarmUpStage + * @throws IOException if the JSON string is invalid with respect to EmailWarmUpStage + */ + public static EmailWarmUpStage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailWarmUpStage.class); + } + + /** + * Convert an instance of EmailWarmUpStage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/Notification.java b/src/main/java/com/onesignal/client/model/Notification.java index d599179..ae888f4 100644 --- a/src/main/java/com/onesignal/client/model/Notification.java +++ b/src/main/java/com/onesignal/client/model/Notification.java @@ -22,6 +22,7 @@ import com.onesignal.client.model.BasicNotification; import com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout; import com.onesignal.client.model.Button; +import com.onesignal.client.model.EmailWarmUpRequest; import com.onesignal.client.model.FilterExpression; import com.onesignal.client.model.LanguageStringMap; import com.onesignal.client.model.NotificationAllOf; @@ -597,6 +598,59 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EMAIL_SENDER_DOMAIN) private String emailSenderDomain; + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WARMUP("warmup"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_EMAIL_WARM_UP = "email_warm_up"; + @SerializedName(SERIALIZED_NAME_EMAIL_WARM_UP) + private EmailWarmUpRequest emailWarmUp; + public static final String SERIALIZED_NAME_SMS_FROM = "sms_from"; @SerializedName(SERIALIZED_NAME_SMS_FROM) private String smsFrom; @@ -3107,11 +3161,11 @@ public Notification emailSubject(String emailSubject) { } /** - * Channel: Email Required. The subject of the email. + * Channel: Email Required. The subject of the email. * @return emailSubject **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") + @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") public String getEmailSubject() { return emailSubject; @@ -3338,6 +3392,52 @@ public void setEmailSenderDomain(String emailSenderDomain) { } + public Notification kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. ") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public Notification emailWarmUp(EmailWarmUpRequest emailWarmUp) { + + this.emailWarmUp = emailWarmUp; + return this; + } + + /** + * Get emailWarmUp + * @return emailWarmUp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailWarmUpRequest getEmailWarmUp() { + return emailWarmUp; + } + + + public void setEmailWarmUp(EmailWarmUpRequest emailWarmUp) { + this.emailWarmUp = emailWarmUp; + } + + public Notification smsFrom(String smsFrom) { this.smsFrom = smsFrom; @@ -3703,6 +3803,8 @@ public boolean equals(Object o) { Objects.equals(this.includeUnsubscribed, notification.includeUnsubscribed) && Objects.equals(this.emailBcc, notification.emailBcc) && Objects.equals(this.emailSenderDomain, notification.emailSenderDomain) && + Objects.equals(this.kind, notification.kind) && + Objects.equals(this.emailWarmUp, notification.emailWarmUp) && Objects.equals(this.smsFrom, notification.smsFrom) && Objects.equals(this.smsMediaUrls, notification.smsMediaUrls) && Objects.equals(this.filters, notification.filters) && @@ -3721,7 +3823,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag, sendAfter); + return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, kind, emailWarmUp, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag, sendAfter); } private static int hashCodeNullable(JsonNullable a) { @@ -3844,6 +3946,8 @@ public String toString() { sb.append(" includeUnsubscribed: ").append(toIndentedString(includeUnsubscribed)).append("\n"); sb.append(" emailBcc: ").append(toIndentedString(emailBcc)).append("\n"); sb.append(" emailSenderDomain: ").append(toIndentedString(emailSenderDomain)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" emailWarmUp: ").append(toIndentedString(emailWarmUp)).append("\n"); sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); sb.append(" smsMediaUrls: ").append(toIndentedString(smsMediaUrls)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); @@ -3985,6 +4089,8 @@ private String toIndentedString(Object o) { openapiFields.add("include_unsubscribed"); openapiFields.add("email_bcc"); openapiFields.add("email_sender_domain"); + openapiFields.add("kind"); + openapiFields.add("email_warm_up"); openapiFields.add("sms_from"); openapiFields.add("sms_media_urls"); openapiFields.add("filters"); diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java index e9595ca..eceaa93 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java @@ -23,6 +23,7 @@ import com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout; import com.onesignal.client.model.Button; import com.onesignal.client.model.DeliveryData; +import com.onesignal.client.model.EmailWarmUp; import com.onesignal.client.model.FilterExpression; import com.onesignal.client.model.LanguageStringMap; import com.onesignal.client.model.NotificationWithMetaAllOf; @@ -600,6 +601,59 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EMAIL_SENDER_DOMAIN) private String emailSenderDomain; + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + WARMUP("warmup"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public static final String SERIALIZED_NAME_EMAIL_WARM_UP = "email_warm_up"; + @SerializedName(SERIALIZED_NAME_EMAIL_WARM_UP) + private EmailWarmUp emailWarmUp; + public static final String SERIALIZED_NAME_SMS_FROM = "sms_from"; @SerializedName(SERIALIZED_NAME_SMS_FROM) private String smsFrom; @@ -3158,11 +3212,11 @@ public NotificationWithMeta emailSubject(String emailSubject) { } /** - * Channel: Email Required. The subject of the email. + * Channel: Email Required. The subject of the email. * @return emailSubject **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") + @ApiModelProperty(value = "Channel: Email Required. The subject of the email. ") public String getEmailSubject() { return emailSubject; @@ -3389,6 +3443,52 @@ public void setEmailSenderDomain(String emailSenderDomain) { } + public NotificationWithMeta kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications. ") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public NotificationWithMeta emailWarmUp(EmailWarmUp emailWarmUp) { + + this.emailWarmUp = emailWarmUp; + return this; + } + + /** + * Get emailWarmUp + * @return emailWarmUp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailWarmUp getEmailWarmUp() { + return emailWarmUp; + } + + + public void setEmailWarmUp(EmailWarmUp emailWarmUp) { + this.emailWarmUp = emailWarmUp; + } + + public NotificationWithMeta smsFrom(String smsFrom) { this.smsFrom = smsFrom; @@ -4038,6 +4138,8 @@ public boolean equals(Object o) { Objects.equals(this.includeUnsubscribed, notificationWithMeta.includeUnsubscribed) && Objects.equals(this.emailBcc, notificationWithMeta.emailBcc) && Objects.equals(this.emailSenderDomain, notificationWithMeta.emailSenderDomain) && + Objects.equals(this.kind, notificationWithMeta.kind) && + Objects.equals(this.emailWarmUp, notificationWithMeta.emailWarmUp) && Objects.equals(this.smsFrom, notificationWithMeta.smsFrom) && Objects.equals(this.smsMediaUrls, notificationWithMeta.smsMediaUrls) && Objects.equals(this.filters, notificationWithMeta.filters) && @@ -4068,7 +4170,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag, successful, failed, errored, converted, received, outcomes, remaining, queuedAt, sendAfter, completedAt, platformDeliveryStats, canceled, bccSent); + return Objects.hash(includedSegments, excludedSegments, includeSubscriptionIds, includeEmailTokens, emailTo, includePhoneNumbers, includeIosTokens, includeWpWnsUris, includeAmazonRegIds, includeChromeRegIds, includeChromeWebRegIds, includeAndroidRegIds, includeAliases, targetChannel, id, value, name, aggregation, isIos, isAndroid, isHuawei, isAnyWeb, isChromeWeb, isFirefox, isSafari, isWPWNS, isAdm, isChrome, appId, externalId, idempotencyKey, contents, headings, subtitle, data, huaweiMsgType, url, webUrl, appUrl, iosAttachments, templateId, contentAvailable, mutableContent, targetContentIdentifier, bigPicture, globalImage, huaweiBigPicture, admBigPicture, chromeBigPicture, chromeWebImage, buttons, webButtons, iosCategory, androidChannelId, huaweiChannelId, existingAndroidChannelId, huaweiExistingChannelId, androidBackgroundLayout, smallIcon, huaweiSmallIcon, largeIcon, huaweiLargeIcon, admSmallIcon, admLargeIcon, chromeWebIcon, chromeWebBadge, firefoxIcon, chromeIcon, iosSound, androidSound, huaweiSound, admSound, wpWnsSound, androidLedColor, huaweiLedColor, androidAccentColor, huaweiAccentColor, androidVisibility, huaweiVisibility, iosBadgeType, iosBadgeCount, collapseId, webPushTopic, apnsAlert, delayedOption, deliveryTimeOfDay, ttl, priority, apnsPushTypeOverride, throttleRatePerMinute, androidGroup, androidGroupMessage, admGroup, admGroupMessage, threadId, summaryArg, summaryArgCount, iosRelevanceScore, iosInterruptionLevel, emailSubject, emailBody, emailFromName, emailFromAddress, emailReplyToAddress, emailPreheader, disableEmailClickTracking, includeUnsubscribed, emailBcc, emailSenderDomain, kind, emailWarmUp, smsFrom, smsMediaUrls, filters, customData, huaweiBadgeClass, huaweiBadgeAddNum, huaweiBadgeSetNum, huaweiCategory, huaweiBiTag, successful, failed, errored, converted, received, outcomes, remaining, queuedAt, sendAfter, completedAt, platformDeliveryStats, canceled, bccSent); } private static int hashCodeNullable(JsonNullable a) { @@ -4191,6 +4293,8 @@ public String toString() { sb.append(" includeUnsubscribed: ").append(toIndentedString(includeUnsubscribed)).append("\n"); sb.append(" emailBcc: ").append(toIndentedString(emailBcc)).append("\n"); sb.append(" emailSenderDomain: ").append(toIndentedString(emailSenderDomain)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" emailWarmUp: ").append(toIndentedString(emailWarmUp)).append("\n"); sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); sb.append(" smsMediaUrls: ").append(toIndentedString(smsMediaUrls)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); @@ -4344,6 +4448,8 @@ private String toIndentedString(Object o) { openapiFields.add("include_unsubscribed"); openapiFields.add("email_bcc"); openapiFields.add("email_sender_domain"); + openapiFields.add("kind"); + openapiFields.add("email_warm_up"); openapiFields.add("sms_from"); openapiFields.add("sms_media_urls"); openapiFields.add("filters"); diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java index 169ba43..eea5bac 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java @@ -19,6 +19,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.EmailWarmUp; import com.onesignal.client.model.PlatformDeliveryData; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -111,6 +112,10 @@ public class NotificationWithMetaAllOf { @SerializedName(SERIALIZED_NAME_BCC_SENT) private Integer bccSent; + public static final String SERIALIZED_NAME_EMAIL_WARM_UP = "email_warm_up"; + @SerializedName(SERIALIZED_NAME_EMAIL_WARM_UP) + private EmailWarmUp emailWarmUp; + public NotificationWithMetaAllOf() { } @@ -444,6 +449,29 @@ public void setBccSent(Integer bccSent) { } + public NotificationWithMetaAllOf emailWarmUp(EmailWarmUp emailWarmUp) { + + this.emailWarmUp = emailWarmUp; + return this; + } + + /** + * Get emailWarmUp + * @return emailWarmUp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailWarmUp getEmailWarmUp() { + return emailWarmUp; + } + + + public void setEmailWarmUp(EmailWarmUp emailWarmUp) { + this.emailWarmUp = emailWarmUp; + } + + @Override public boolean equals(Object o) { @@ -467,7 +495,8 @@ public boolean equals(Object o) { Objects.equals(this.throttleRatePerMinute, notificationWithMetaAllOf.throttleRatePerMinute) && Objects.equals(this.canceled, notificationWithMetaAllOf.canceled) && Objects.equals(this.emailBcc, notificationWithMetaAllOf.emailBcc) && - Objects.equals(this.bccSent, notificationWithMetaAllOf.bccSent); + Objects.equals(this.bccSent, notificationWithMetaAllOf.bccSent) && + Objects.equals(this.emailWarmUp, notificationWithMetaAllOf.emailWarmUp); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -476,7 +505,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(remaining, successful, failed, errored, converted, queuedAt, sendAfter, completedAt, platformDeliveryStats, received, throttleRatePerMinute, canceled, emailBcc, bccSent); + return Objects.hash(remaining, successful, failed, errored, converted, queuedAt, sendAfter, completedAt, platformDeliveryStats, received, throttleRatePerMinute, canceled, emailBcc, bccSent, emailWarmUp); } private static int hashCodeNullable(JsonNullable a) { @@ -504,6 +533,7 @@ public String toString() { sb.append(" canceled: ").append(toIndentedString(canceled)).append("\n"); sb.append(" emailBcc: ").append(toIndentedString(emailBcc)).append("\n"); sb.append(" bccSent: ").append(toIndentedString(bccSent)).append("\n"); + sb.append(" emailWarmUp: ").append(toIndentedString(emailWarmUp)).append("\n"); sb.append("}"); return sb.toString(); } @@ -540,6 +570,7 @@ private String toIndentedString(Object o) { openapiFields.add("canceled"); openapiFields.add("email_bcc"); openapiFields.add("bcc_sent"); + openapiFields.add("email_warm_up"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet();