diff --git a/api/openapi.yaml b/api/openapi.yaml
index e0dc964..e03dbd3 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -2255,6 +2255,57 @@ paths:
- rest_api_key: []
summary: Export CSV of Events
x-accepts: application/json
+ /notifications/count-unsaved:
+ post:
+ description: "Returns the estimated number of recipients for a notification's\
+ \ targeting, without creating or sending anything.\nThe returned `count` reflects\
+ \ the same audience-size estimate you would see under \"Choose your target\
+ \ audience\" when composing a message. It is based on the user targeting method\
+ \ you've set and the specific platforms the message is targeted to send to.\n\
+ This endpoint only supports a subset of targeting parameters: `included_segments`\
+ \ is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`,\
+ \ `filters`, `include_aliases`, and `target_channel` narrow that audience\
+ \ further. Use `target_channel` to select platforms. `include_subscription_ids`\
+ \ and the other raw subscription id/token fields, and the individual `isIos`\
+ \ / `isAndroid` / etc. platform flags, are not supported. All other notification\
+ \ fields (content, delivery options, and so on) are accepted, but ignored.\n"
+ operationId: estimate_notification_recipients
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EstimateNotificationRecipientsRequest'
+ required: true
+ responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Unexpected error
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EstimateNotificationRecipientsSuccessResponse'
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GenericError'
+ description: Bad Request
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RateLimitError'
+ description: Rate Limit Exceeded
+ security:
+ - rest_api_key: []
+ summary: Estimate notification recipients
+ x-content-type: application/json
+ x-accepts: application/json
/templates:
get:
description: List templates for an app.
@@ -3728,7 +3779,9 @@ components:
description: "The segment names you want to target. Users in these segments\
\ will receive a notification. This targeting parameter is only compatible\
\ with excluded_segments.\nExample: [\"Active Users\", \"Inactive Users\"\
- ]\n"
+ ]\n`\"All\"` is a shorthand for every subscribed user: if the array includes\
+ \ the string `\"All\"` and the app has no segment actually named `All`,\
+ \ it targets all subscribers instead of a literal segment lookup.\n"
items:
type: string
type: array
@@ -5046,6 +5099,55 @@ components:
\ be 200 with partial success. Typed SDKs model this loosely so both shapes\
\ deserialize."
type: object
+ EstimateNotificationRecipientsRequest:
+ allOf:
+ - $ref: '#/components/schemas/SegmentNotificationTarget'
+ - $ref: '#/components/schemas/EstimateNotificationRecipientsRequest_allOf'
+ - required:
+ - app_id
+ description: "The targeting subset of notification fields this endpoint honors.\
+ \ `included_segments` (or its `\"All\"` shorthand) is required. `excluded_segments`,\
+ \ `filters`, `include_aliases`, and `target_channel` narrow that segment-based\
+ \ audience further when present. Use `target_channel` to select which platforms\
+ \ to count. Other notification targeting fields (`include_subscription_ids`\
+ \ and the other raw subscription id/token fields, and the individual `isIos`\
+ \ / `isAndroid` / etc. platform flags) are not read by this endpoint. All\
+ \ non-targeting notification fields (content, delivery options, and so on)\
+ \ are accepted, but ignored.\n"
+ EstimateNotificationRecipientsSuccessResponse:
+ example:
+ mobile_suppressed: true
+ uncapped_count: 6
+ count: 0
+ mobile_excluded_count: 1
+ cap_applied: true
+ properties:
+ count:
+ description: "The estimated audience size based on the user targeting method\
+ \ you've set on the message, and the specific platforms the message is\
+ \ targeted to send to."
+ type: integer
+ uncapped_count:
+ description: The estimated audience size before the plan's web push subscriber
+ cap is applied. Present only when `cap_applied` is `true`; `null` otherwise.
+ nullable: true
+ type: integer
+ cap_applied:
+ description: Whether `count` was reduced because the app is on a plan that
+ caps the number of web push subscribers it can send to.
+ type: boolean
+ mobile_suppressed:
+ description: The mobile equivalent of `cap_applied`. Whether mobile push
+ deliveries will be dropped for this send because the org is over its plan's
+ mobile push subscriber cap. `false` when the notification doesn't target
+ any mobile push platforms.
+ type: boolean
+ mobile_excluded_count:
+ description: How many mobile push recipients the `count` excludes due to
+ the plan's mobile push subscriber cap. `0` when `mobile_suppressed` is
+ `false`.
+ type: integer
+ type: object
GenericSuccessBoolResponse:
example:
success: true
@@ -9131,6 +9233,47 @@ components:
unsubscribe link in this email.
nullable: true
type: integer
+ EstimateNotificationRecipientsRequest_allOf:
+ properties:
+ app_id:
+ description: "The OneSignal App ID for your app, which can be found in Keys\
+ \ & IDs."
+ type: string
+ filters:
+ items:
+ $ref: '#/components/schemas/FilterExpression'
+ nullable: true
+ type: array
+ include_aliases:
+ additionalProperties:
+ items:
+ type: string
+ type: array
+ description: "Target specific users by aliases assigned via API. An alias\
+ \ can be an external_id, onesignal_id, or a custom alias.\nAccepts an\
+ \ object where keys are alias labels and values are arrays of alias IDs\
+ \ to include\nExample usage: { \"external_id\": [\"exId1\", \"extId2\"\
+ ], \"internal_label\": [\"id1\", \"id2\"] }\nKeys must match API spellings\
+ \ exactly (for example the label for External ID is the string `external_id`;\
+ \ arbitrary keys such as camelCase variants are not aliases and may yield\
+ \ no recipients).\nNot compatible with any other targeting parameters.\n\
+ REQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\
+ \ API call\nNote: If targeting push, email, or sms subscribers with same\
+ \ ids, use with target_channel to indicate you are sending a push or email\
+ \ or sms."
+ nullable: true
+ type: object
+ target_channel:
+ description: "Which platforms to count recipients for. Selects the same\
+ \ default platforms Create notification would use for the channel. Individual\
+ \ platform flags (`isIos`, `isAndroid`, etc.) are not supported by this\
+ \ endpoint."
+ enum:
+ - push
+ - email
+ - sms
+ type: string
+ type: object
CreateUserConflictResponse_errorsItems_meta:
properties:
conflicting_aliases:
diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md
index e3ba1ea..d9bfd06 100644
--- a/docs/BasicNotification.md
+++ b/docs/BasicNotification.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] |
|**includeEmailTokens** | **List<String>** | Deprecated alias for `email_to`. Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST API call. Prefer `email_to` in new integrations. | [optional] |
diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md
index 13000b6..ff73cef 100644
--- a/docs/DefaultApi.md
+++ b/docs/DefaultApi.md
@@ -24,6 +24,7 @@ All URIs are relative to *https://api.onesignal.com*
| [**deleteSubscription**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
| [**deleteTemplate**](DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template |
| [**deleteUser**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
+| [**estimateNotificationRecipients**](DefaultApi.md#estimateNotificationRecipients) | **POST** /notifications/count-unsaved | Estimate notification recipients |
| [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events |
| [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
| [**getAliases**](DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
@@ -1729,6 +1730,79 @@ null (empty response body)
| **429** | Rate Limit Exceeded | - |
| **0** | Unexpected error | - |
+
+# **estimateNotificationRecipients**
+> EstimateNotificationRecipientsSuccessResponse estimateNotificationRecipients(estimateNotificationRecipientsRequest)
+
+Estimate notification recipients
+
+Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
+
+### Example
+```java
+// Import classes:
+import com.onesignal.client.ApiClient;
+import com.onesignal.client.ApiException;
+import com.onesignal.client.Configuration;
+import com.onesignal.client.auth.*;
+import com.onesignal.client.model.*;
+import com.onesignal.client.api.DefaultApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://api.onesignal.com");
+
+ // Configure HTTP bearer authorization: rest_api_key
+ HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key");
+ rest_api_key.setBearerToken("YOUR_REST_API_KEY");
+
+ DefaultApi apiInstance = new DefaultApi(defaultClient);
+ EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest = new EstimateNotificationRecipientsRequest(); // EstimateNotificationRecipientsRequest |
+ try {
+ EstimateNotificationRecipientsSuccessResponse result = apiInstance.estimateNotificationRecipients(estimateNotificationRecipientsRequest);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#estimateNotificationRecipients");
+ System.err.println("Status code: " + e.getCode());
+ // getErrorMessages() flattens any error-envelope shape to a List;
+ // the raw body remains on getResponseBody().
+ System.err.println("Error messages: " + e.getErrorMessages());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **estimateNotificationRecipientsRequest** | [**EstimateNotificationRecipientsRequest**](EstimateNotificationRecipientsRequest.md)| | |
+
+### Return type
+
+[**EstimateNotificationRecipientsSuccessResponse**](EstimateNotificationRecipientsSuccessResponse.md)
+
+### Authorization
+
+[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | OK | - |
+| **400** | Bad Request | - |
+| **429** | Rate Limit Exceeded | - |
+| **0** | Unexpected error | - |
+
# **exportEvents**
> ExportEventsSuccessResponse exportEvents(notificationId, appId)
diff --git a/docs/EstimateNotificationRecipientsRequest.md b/docs/EstimateNotificationRecipientsRequest.md
new file mode 100644
index 0000000..6ca2157
--- /dev/null
+++ b/docs/EstimateNotificationRecipientsRequest.md
@@ -0,0 +1,29 @@
+
+
+# EstimateNotificationRecipientsRequest
+
+The targeting subset of notification fields this endpoint honors. `included_segments` (or its `\"All\"` shorthand) is required. `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that segment-based audience further when present. Use `target_channel` to select which platforms to count. Other notification targeting fields (`include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags) are not read by this endpoint. All non-targeting notification fields (content, delivery options, and so on) are accepted, but ignored.
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
+|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**appId** | **String** | The OneSignal App ID for your app, which can be found in Keys & IDs. | |
+|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] |
+|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] |
+|**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint. | [optional] |
+
+
+
+## Enum: TargetChannelEnum
+
+| Name | Value |
+|---- | -----|
+| PUSH | "push" |
+| EMAIL | "email" |
+| SMS | "sms" |
+
+
+
diff --git a/docs/EstimateNotificationRecipientsRequestAllOf.md b/docs/EstimateNotificationRecipientsRequestAllOf.md
new file mode 100644
index 0000000..086cc99
--- /dev/null
+++ b/docs/EstimateNotificationRecipientsRequestAllOf.md
@@ -0,0 +1,26 @@
+
+
+# EstimateNotificationRecipientsRequestAllOf
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**appId** | **String** | The OneSignal App ID for your app, which can be found in Keys & IDs. | [optional] |
+|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] |
+|**includeAliases** | **Map<String, List<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] |
+|**targetChannel** | [**TargetChannelEnum**](#TargetChannelEnum) | Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint. | [optional] |
+
+
+
+## Enum: TargetChannelEnum
+
+| Name | Value |
+|---- | -----|
+| PUSH | "push" |
+| EMAIL | "email" |
+| SMS | "sms" |
+
+
+
diff --git a/docs/EstimateNotificationRecipientsSuccessResponse.md b/docs/EstimateNotificationRecipientsSuccessResponse.md
new file mode 100644
index 0000000..1f0e5ff
--- /dev/null
+++ b/docs/EstimateNotificationRecipientsSuccessResponse.md
@@ -0,0 +1,17 @@
+
+
+# EstimateNotificationRecipientsSuccessResponse
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**count** | **Integer** | The estimated audience size based on the user targeting method you've set on the message, and the specific platforms the message is targeted to send to. | [optional] |
+|**uncappedCount** | **Integer** | The estimated audience size before the plan's web push subscriber cap is applied. Present only when `cap_applied` is `true`; `null` otherwise. | [optional] |
+|**capApplied** | **Boolean** | Whether `count` was reduced because the app is on a plan that caps the number of web push subscribers it can send to. | [optional] |
+|**mobileSuppressed** | **Boolean** | The mobile equivalent of `cap_applied`. Whether mobile push deliveries will be dropped for this send because the org is over its plan's mobile push subscriber cap. `false` when the notification doesn't target any mobile push platforms. | [optional] |
+|**mobileExcludedCount** | **Integer** | How many mobile push recipients the `count` excludes due to the plan's mobile push subscriber cap. `0` when `mobile_suppressed` is `false`. | [optional] |
+
+
+
diff --git a/docs/Notification.md b/docs/Notification.md
index 49c003e..24606e7 100644
--- a/docs/Notification.md
+++ b/docs/Notification.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] |
|**includeEmailTokens** | **List<String>** | Deprecated alias for `email_to`. Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST API call. Prefer `email_to` in new integrations. | [optional] |
diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md
index db4e8cd..f701356 100644
--- a/docs/NotificationTarget.md
+++ b/docs/NotificationTarget.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] |
|**includeEmailTokens** | **List<String>** | Deprecated alias for `email_to`. Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST API call. Prefer `email_to` in new integrations. | [optional] |
diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md
index 51b71de..f3890a3 100644
--- a/docs/NotificationWithMeta.md
+++ b/docs/NotificationWithMeta.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] |
|**includeEmailTokens** | **List<String>** | Deprecated alias for `email_to`. Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts. Limit of 2,000 entries per REST API call. Prefer `email_to` in new integrations. | [optional] |
diff --git a/docs/SegmentNotificationTarget.md b/docs/SegmentNotificationTarget.md
index 9fe3346..3b72763 100644
--- a/docs/SegmentNotificationTarget.md
+++ b/docs/SegmentNotificationTarget.md
@@ -7,7 +7,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
-|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
+|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. | [optional] |
|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] |
diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java
index 7755a66..a519fca 100644
--- a/src/main/java/com/onesignal/client/JSON.java
+++ b/src/main/java/com/onesignal/client/JSON.java
@@ -120,6 +120,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
.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.EstimateNotificationRecipientsRequest.CustomTypeAdapterFactory())
+ .registerTypeAdapterFactory(new com.onesignal.client.model.EstimateNotificationRecipientsRequestAllOf.CustomTypeAdapterFactory())
+ .registerTypeAdapterFactory(new com.onesignal.client.model.EstimateNotificationRecipientsSuccessResponse.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 047163e..5e5c080 100644
--- a/src/main/java/com/onesignal/client/api/DefaultApi.java
+++ b/src/main/java/com/onesignal/client/api/DefaultApi.java
@@ -38,6 +38,8 @@
import com.onesignal.client.model.CreateTemplateRequest;
import com.onesignal.client.model.CreateUserConflictResponse;
import com.onesignal.client.model.CustomEventsRequest;
+import com.onesignal.client.model.EstimateNotificationRecipientsRequest;
+import com.onesignal.client.model.EstimateNotificationRecipientsSuccessResponse;
import com.onesignal.client.model.ExportEventsSuccessResponse;
import com.onesignal.client.model.ExportSubscriptionsRequestBody;
import com.onesignal.client.model.ExportSubscriptionsSuccessResponse;
@@ -3276,6 +3278,147 @@ public okhttp3.Call deleteUserAsync(String appId, String aliasLabel, String alia
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
+ /**
+ * Build call for estimateNotificationRecipients
+ * @param estimateNotificationRecipientsRequest (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+ | 400 | Bad Request | - |
+ | 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
+
+ */
+ public okhttp3.Call estimateNotificationRecipientsCall(EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = estimateNotificationRecipientsRequest;
+
+ // create path and map variables
+ String localVarPath = "/notifications/count-unsaved";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ // Adds client sdk version header
+ localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.14.0");
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { "rest_api_key" };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call estimateNotificationRecipientsValidateBeforeCall(EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest, final ApiCallback _callback) throws ApiException {
+
+ // verify the required parameter 'estimateNotificationRecipientsRequest' is set
+ if (estimateNotificationRecipientsRequest == null) {
+ throw new ApiException("Missing the required parameter 'estimateNotificationRecipientsRequest' when calling estimateNotificationRecipients(Async)");
+ }
+
+
+ okhttp3.Call localVarCall = estimateNotificationRecipientsCall(estimateNotificationRecipientsRequest, _callback);
+ return localVarCall;
+
+ }
+
+ /**
+ * Estimate notification recipients
+ * Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
+ * @param estimateNotificationRecipientsRequest (required)
+ * @return EstimateNotificationRecipientsSuccessResponse
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+ | 400 | Bad Request | - |
+ | 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
+
+ */
+ public EstimateNotificationRecipientsSuccessResponse estimateNotificationRecipients(EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest) throws ApiException {
+ ApiResponse localVarResp = estimateNotificationRecipientsWithHttpInfo(estimateNotificationRecipientsRequest);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Estimate notification recipients
+ * Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
+ * @param estimateNotificationRecipientsRequest (required)
+ * @return ApiResponse<EstimateNotificationRecipientsSuccessResponse>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+ | 400 | Bad Request | - |
+ | 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
+
+ */
+ public ApiResponse estimateNotificationRecipientsWithHttpInfo(EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest) throws ApiException {
+ okhttp3.Call localVarCall = estimateNotificationRecipientsValidateBeforeCall(estimateNotificationRecipientsRequest, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Estimate notification recipients (asynchronously)
+ * Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
+ * @param estimateNotificationRecipientsRequest (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+ | 400 | Bad Request | - |
+ | 429 | Rate Limit Exceeded | - |
+ | 0 | Unexpected error | - |
+
+ */
+ public okhttp3.Call estimateNotificationRecipientsAsync(EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = estimateNotificationRecipientsValidateBeforeCall(estimateNotificationRecipientsRequest, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
/**
* Build call for exportEvents
* @param notificationId The ID of the notification to export events from. (required)
diff --git a/src/main/java/com/onesignal/client/model/BasicNotification.java b/src/main/java/com/onesignal/client/model/BasicNotification.java
index 5a1124c..e84e5df 100644
--- a/src/main/java/com/onesignal/client/model/BasicNotification.java
+++ b/src/main/java/com/onesignal/client/model/BasicNotification.java
@@ -781,11 +781,11 @@ public BasicNotification addIncludedSegmentsItem(String includedSegmentsItem) {
}
/**
- * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
+ * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
* @return includedSegments
**/
@javax.annotation.Nullable
- @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] ")
+ @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. ")
public List getIncludedSegments() {
return includedSegments;
diff --git a/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsRequest.java b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsRequest.java
new file mode 100644
index 0000000..7a93cd2
--- /dev/null
+++ b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsRequest.java
@@ -0,0 +1,436 @@
+/*
+ * 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.EstimateNotificationRecipientsRequestAllOf;
+import com.onesignal.client.model.FilterExpression;
+import com.onesignal.client.model.SegmentNotificationTarget;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+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;
+
+/**
+ * The targeting subset of notification fields this endpoint honors. `included_segments` (or its `\"All\"` shorthand) is required. `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that segment-based audience further when present. Use `target_channel` to select which platforms to count. Other notification targeting fields (`include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags) are not read by this endpoint. All non-targeting notification fields (content, delivery options, and so on) are accepted, but ignored.
+ */
+@ApiModel(description = "The targeting subset of notification fields this endpoint honors. `included_segments` (or its `\"All\"` shorthand) is required. `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that segment-based audience further when present. Use `target_channel` to select which platforms to count. Other notification targeting fields (`include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags) are not read by this endpoint. All non-targeting notification fields (content, delivery options, and so on) are accepted, but ignored. ")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class EstimateNotificationRecipientsRequest {
+ private static final long serialVersionUID = 1L;
+
+ public static final String SERIALIZED_NAME_INCLUDED_SEGMENTS = "included_segments";
+ @SerializedName(SERIALIZED_NAME_INCLUDED_SEGMENTS)
+ private List includedSegments = null;
+
+ public static final String SERIALIZED_NAME_EXCLUDED_SEGMENTS = "excluded_segments";
+ @SerializedName(SERIALIZED_NAME_EXCLUDED_SEGMENTS)
+ private List excludedSegments = null;
+
+ public static final String SERIALIZED_NAME_APP_ID = "app_id";
+ @SerializedName(SERIALIZED_NAME_APP_ID)
+ private String appId;
+
+ public static final String SERIALIZED_NAME_FILTERS = "filters";
+ @SerializedName(SERIALIZED_NAME_FILTERS)
+ private List filters = null;
+
+ public static final String SERIALIZED_NAME_INCLUDE_ALIASES = "include_aliases";
+ @SerializedName(SERIALIZED_NAME_INCLUDE_ALIASES)
+ private Map> includeAliases = null;
+
+ /**
+ * Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
+ */
+ @JsonAdapter(TargetChannelEnum.Adapter.class)
+ public enum TargetChannelEnum {
+ PUSH("push"),
+
+ EMAIL("email"),
+
+ SMS("sms");
+
+ private String value;
+
+ TargetChannelEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static TargetChannelEnum fromValue(String value) {
+ for (TargetChannelEnum b : TargetChannelEnum.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 TargetChannelEnum enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue());
+ }
+
+ @Override
+ public TargetChannelEnum read(final JsonReader jsonReader) throws IOException {
+ String value = jsonReader.nextString();
+ return TargetChannelEnum.fromValue(value);
+ }
+ }
+ }
+
+ public static final String SERIALIZED_NAME_TARGET_CHANNEL = "target_channel";
+ @SerializedName(SERIALIZED_NAME_TARGET_CHANNEL)
+ private TargetChannelEnum targetChannel;
+
+ public EstimateNotificationRecipientsRequest() {
+ }
+
+ public EstimateNotificationRecipientsRequest includedSegments(List includedSegments) {
+
+ this.includedSegments = includedSegments;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequest addIncludedSegmentsItem(String includedSegmentsItem) {
+ if (this.includedSegments == null) {
+ this.includedSegments = new ArrayList<>();
+ }
+ this.includedSegments.add(includedSegmentsItem);
+ return this;
+ }
+
+ /**
+ * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
+ * @return includedSegments
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. ")
+
+ public List getIncludedSegments() {
+ return includedSegments;
+ }
+
+
+ public void setIncludedSegments(List includedSegments) {
+ this.includedSegments = includedSegments;
+ }
+
+
+ public EstimateNotificationRecipientsRequest excludedSegments(List excludedSegments) {
+
+ this.excludedSegments = excludedSegments;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequest addExcludedSegmentsItem(String excludedSegmentsItem) {
+ if (this.excludedSegments == null) {
+ this.excludedSegments = new ArrayList<>();
+ }
+ this.excludedSegments.add(excludedSegmentsItem);
+ return this;
+ }
+
+ /**
+ * Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
+ * @return excludedSegments
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] ")
+
+ public List getExcludedSegments() {
+ return excludedSegments;
+ }
+
+
+ public void setExcludedSegments(List excludedSegments) {
+ this.excludedSegments = excludedSegments;
+ }
+
+
+ public EstimateNotificationRecipientsRequest appId(String appId) {
+
+ this.appId = appId;
+ return this;
+ }
+
+ /**
+ * The OneSignal App ID for your app, which can be found in Keys & IDs.
+ * @return appId
+ **/
+ @javax.annotation.Nonnull
+ @ApiModelProperty(required = true, value = "The OneSignal App ID for your app, which can be found in Keys & IDs.")
+
+ public String getAppId() {
+ return appId;
+ }
+
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+
+ public EstimateNotificationRecipientsRequest filters(List filters) {
+
+ this.filters = filters;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequest addFiltersItem(FilterExpression filtersItem) {
+ if (this.filters == null) {
+ this.filters = new ArrayList<>();
+ }
+ this.filters.add(filtersItem);
+ return this;
+ }
+
+ /**
+ * Get filters
+ * @return filters
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "")
+
+ public List getFilters() {
+ return filters;
+ }
+
+
+ public void setFilters(List filters) {
+ this.filters = filters;
+ }
+
+
+ public EstimateNotificationRecipientsRequest includeAliases(Map> includeAliases) {
+
+ this.includeAliases = includeAliases;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequest putIncludeAliasesItem(String key, List includeAliasesItem) {
+ if (this.includeAliases == null) {
+ this.includeAliases = new HashMap<>();
+ }
+ this.includeAliases.put(key, includeAliasesItem);
+ return this;
+ }
+
+ /**
+ * Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
+ * @return includeAliases
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.")
+
+ public Map> getIncludeAliases() {
+ return includeAliases;
+ }
+
+
+ public void setIncludeAliases(Map> includeAliases) {
+ this.includeAliases = includeAliases;
+ }
+
+
+ public EstimateNotificationRecipientsRequest targetChannel(TargetChannelEnum targetChannel) {
+
+ this.targetChannel = targetChannel;
+ return this;
+ }
+
+ /**
+ * Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
+ * @return targetChannel
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.")
+
+ public TargetChannelEnum getTargetChannel() {
+ return targetChannel;
+ }
+
+
+ public void setTargetChannel(TargetChannelEnum targetChannel) {
+ this.targetChannel = targetChannel;
+ }
+
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EstimateNotificationRecipientsRequest estimateNotificationRecipientsRequest = (EstimateNotificationRecipientsRequest) o;
+ return Objects.equals(this.includedSegments, estimateNotificationRecipientsRequest.includedSegments) &&
+ Objects.equals(this.excludedSegments, estimateNotificationRecipientsRequest.excludedSegments) &&
+ Objects.equals(this.appId, estimateNotificationRecipientsRequest.appId) &&
+ Objects.equals(this.filters, estimateNotificationRecipientsRequest.filters) &&
+ Objects.equals(this.includeAliases, estimateNotificationRecipientsRequest.includeAliases) &&
+ Objects.equals(this.targetChannel, estimateNotificationRecipientsRequest.targetChannel);
+ }
+
+ 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(includedSegments, excludedSegments, appId, filters, includeAliases, targetChannel);
+ }
+
+ 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 EstimateNotificationRecipientsRequest {\n");
+ sb.append(" includedSegments: ").append(toIndentedString(includedSegments)).append("\n");
+ sb.append(" excludedSegments: ").append(toIndentedString(excludedSegments)).append("\n");
+ sb.append(" appId: ").append(toIndentedString(appId)).append("\n");
+ sb.append(" filters: ").append(toIndentedString(filters)).append("\n");
+ sb.append(" includeAliases: ").append(toIndentedString(includeAliases)).append("\n");
+ sb.append(" targetChannel: ").append(toIndentedString(targetChannel)).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("included_segments");
+ openapiFields.add("excluded_segments");
+ openapiFields.add("app_id");
+ openapiFields.add("filters");
+ openapiFields.add("include_aliases");
+ openapiFields.add("target_channel");
+
+ // a set of required properties/fields (JSON key names)
+ openapiRequiredFields = new HashSet();
+ openapiRequiredFields.add("app_id");
+ }
+
+ public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
+ @SuppressWarnings("unchecked")
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ if (!EstimateNotificationRecipientsRequest.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'EstimateNotificationRecipientsRequest' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(EstimateNotificationRecipientsRequest.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, EstimateNotificationRecipientsRequest value) throws IOException {
+ JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ elementAdapter.write(out, obj);
+ }
+
+ @Override
+ public EstimateNotificationRecipientsRequest read(JsonReader in) throws IOException {
+ JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
+
+ return thisAdapter.fromJsonTree(jsonObj);
+ }
+
+ }.nullSafe();
+ }
+ }
+
+ /**
+ * Create an instance of EstimateNotificationRecipientsRequest given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of EstimateNotificationRecipientsRequest
+ * @throws IOException if the JSON string is invalid with respect to EstimateNotificationRecipientsRequest
+ */
+ public static EstimateNotificationRecipientsRequest fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, EstimateNotificationRecipientsRequest.class);
+ }
+
+ /**
+ * Convert an instance of EstimateNotificationRecipientsRequest 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/EstimateNotificationRecipientsRequestAllOf.java b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsRequestAllOf.java
new file mode 100644
index 0000000..f7975eb
--- /dev/null
+++ b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsRequestAllOf.java
@@ -0,0 +1,356 @@
+/*
+ * 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.FilterExpression;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+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;
+
+/**
+ * EstimateNotificationRecipientsRequestAllOf
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class EstimateNotificationRecipientsRequestAllOf {
+ private static final long serialVersionUID = 1L;
+
+ public static final String SERIALIZED_NAME_APP_ID = "app_id";
+ @SerializedName(SERIALIZED_NAME_APP_ID)
+ private String appId;
+
+ public static final String SERIALIZED_NAME_FILTERS = "filters";
+ @SerializedName(SERIALIZED_NAME_FILTERS)
+ private List filters = null;
+
+ public static final String SERIALIZED_NAME_INCLUDE_ALIASES = "include_aliases";
+ @SerializedName(SERIALIZED_NAME_INCLUDE_ALIASES)
+ private Map> includeAliases = null;
+
+ /**
+ * Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
+ */
+ @JsonAdapter(TargetChannelEnum.Adapter.class)
+ public enum TargetChannelEnum {
+ PUSH("push"),
+
+ EMAIL("email"),
+
+ SMS("sms");
+
+ private String value;
+
+ TargetChannelEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static TargetChannelEnum fromValue(String value) {
+ for (TargetChannelEnum b : TargetChannelEnum.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 TargetChannelEnum enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue());
+ }
+
+ @Override
+ public TargetChannelEnum read(final JsonReader jsonReader) throws IOException {
+ String value = jsonReader.nextString();
+ return TargetChannelEnum.fromValue(value);
+ }
+ }
+ }
+
+ public static final String SERIALIZED_NAME_TARGET_CHANNEL = "target_channel";
+ @SerializedName(SERIALIZED_NAME_TARGET_CHANNEL)
+ private TargetChannelEnum targetChannel;
+
+ public EstimateNotificationRecipientsRequestAllOf() {
+ }
+
+ public EstimateNotificationRecipientsRequestAllOf appId(String appId) {
+
+ this.appId = appId;
+ return this;
+ }
+
+ /**
+ * The OneSignal App ID for your app, which can be found in Keys & IDs.
+ * @return appId
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "The OneSignal App ID for your app, which can be found in Keys & IDs.")
+
+ public String getAppId() {
+ return appId;
+ }
+
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+
+ public EstimateNotificationRecipientsRequestAllOf filters(List filters) {
+
+ this.filters = filters;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequestAllOf addFiltersItem(FilterExpression filtersItem) {
+ if (this.filters == null) {
+ this.filters = new ArrayList<>();
+ }
+ this.filters.add(filtersItem);
+ return this;
+ }
+
+ /**
+ * Get filters
+ * @return filters
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "")
+
+ public List getFilters() {
+ return filters;
+ }
+
+
+ public void setFilters(List filters) {
+ this.filters = filters;
+ }
+
+
+ public EstimateNotificationRecipientsRequestAllOf includeAliases(Map> includeAliases) {
+
+ this.includeAliases = includeAliases;
+ return this;
+ }
+
+ public EstimateNotificationRecipientsRequestAllOf putIncludeAliasesItem(String key, List includeAliasesItem) {
+ if (this.includeAliases == null) {
+ this.includeAliases = new HashMap<>();
+ }
+ this.includeAliases.put(key, includeAliasesItem);
+ return this;
+ }
+
+ /**
+ * Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
+ * @return includeAliases
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.")
+
+ public Map> getIncludeAliases() {
+ return includeAliases;
+ }
+
+
+ public void setIncludeAliases(Map> includeAliases) {
+ this.includeAliases = includeAliases;
+ }
+
+
+ public EstimateNotificationRecipientsRequestAllOf targetChannel(TargetChannelEnum targetChannel) {
+
+ this.targetChannel = targetChannel;
+ return this;
+ }
+
+ /**
+ * Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
+ * @return targetChannel
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.")
+
+ public TargetChannelEnum getTargetChannel() {
+ return targetChannel;
+ }
+
+
+ public void setTargetChannel(TargetChannelEnum targetChannel) {
+ this.targetChannel = targetChannel;
+ }
+
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EstimateNotificationRecipientsRequestAllOf estimateNotificationRecipientsRequestAllOf = (EstimateNotificationRecipientsRequestAllOf) o;
+ return Objects.equals(this.appId, estimateNotificationRecipientsRequestAllOf.appId) &&
+ Objects.equals(this.filters, estimateNotificationRecipientsRequestAllOf.filters) &&
+ Objects.equals(this.includeAliases, estimateNotificationRecipientsRequestAllOf.includeAliases) &&
+ Objects.equals(this.targetChannel, estimateNotificationRecipientsRequestAllOf.targetChannel);
+ }
+
+ 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(appId, filters, includeAliases, targetChannel);
+ }
+
+ 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 EstimateNotificationRecipientsRequestAllOf {\n");
+ sb.append(" appId: ").append(toIndentedString(appId)).append("\n");
+ sb.append(" filters: ").append(toIndentedString(filters)).append("\n");
+ sb.append(" includeAliases: ").append(toIndentedString(includeAliases)).append("\n");
+ sb.append(" targetChannel: ").append(toIndentedString(targetChannel)).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("app_id");
+ openapiFields.add("filters");
+ openapiFields.add("include_aliases");
+ openapiFields.add("target_channel");
+
+ // 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 (!EstimateNotificationRecipientsRequestAllOf.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'EstimateNotificationRecipientsRequestAllOf' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(EstimateNotificationRecipientsRequestAllOf.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, EstimateNotificationRecipientsRequestAllOf value) throws IOException {
+ JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ elementAdapter.write(out, obj);
+ }
+
+ @Override
+ public EstimateNotificationRecipientsRequestAllOf read(JsonReader in) throws IOException {
+ JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
+
+ return thisAdapter.fromJsonTree(jsonObj);
+ }
+
+ }.nullSafe();
+ }
+ }
+
+ /**
+ * Create an instance of EstimateNotificationRecipientsRequestAllOf given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of EstimateNotificationRecipientsRequestAllOf
+ * @throws IOException if the JSON string is invalid with respect to EstimateNotificationRecipientsRequestAllOf
+ */
+ public static EstimateNotificationRecipientsRequestAllOf fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, EstimateNotificationRecipientsRequestAllOf.class);
+ }
+
+ /**
+ * Convert an instance of EstimateNotificationRecipientsRequestAllOf 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/EstimateNotificationRecipientsSuccessResponse.java b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsSuccessResponse.java
new file mode 100644
index 0000000..45ebf13
--- /dev/null
+++ b/src/main/java/com/onesignal/client/model/EstimateNotificationRecipientsSuccessResponse.java
@@ -0,0 +1,316 @@
+/*
+ * 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 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;
+
+/**
+ * EstimateNotificationRecipientsSuccessResponse
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class EstimateNotificationRecipientsSuccessResponse {
+ private static final long serialVersionUID = 1L;
+
+ public static final String SERIALIZED_NAME_COUNT = "count";
+ @SerializedName(SERIALIZED_NAME_COUNT)
+ private Integer count;
+
+ public static final String SERIALIZED_NAME_UNCAPPED_COUNT = "uncapped_count";
+ @SerializedName(SERIALIZED_NAME_UNCAPPED_COUNT)
+ private Integer uncappedCount;
+
+ public static final String SERIALIZED_NAME_CAP_APPLIED = "cap_applied";
+ @SerializedName(SERIALIZED_NAME_CAP_APPLIED)
+ private Boolean capApplied;
+
+ public static final String SERIALIZED_NAME_MOBILE_SUPPRESSED = "mobile_suppressed";
+ @SerializedName(SERIALIZED_NAME_MOBILE_SUPPRESSED)
+ private Boolean mobileSuppressed;
+
+ public static final String SERIALIZED_NAME_MOBILE_EXCLUDED_COUNT = "mobile_excluded_count";
+ @SerializedName(SERIALIZED_NAME_MOBILE_EXCLUDED_COUNT)
+ private Integer mobileExcludedCount;
+
+ public EstimateNotificationRecipientsSuccessResponse() {
+ }
+
+ public EstimateNotificationRecipientsSuccessResponse count(Integer count) {
+
+ this.count = count;
+ return this;
+ }
+
+ /**
+ * The estimated audience size based on the user targeting method you've set on the message, and the specific platforms the message is targeted to send to.
+ * @return count
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "The estimated audience size based on the user targeting method you've set on the message, and the specific platforms the message is targeted to send to.")
+
+ public Integer getCount() {
+ return count;
+ }
+
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+
+ public EstimateNotificationRecipientsSuccessResponse uncappedCount(Integer uncappedCount) {
+
+ this.uncappedCount = uncappedCount;
+ return this;
+ }
+
+ /**
+ * The estimated audience size before the plan's web push subscriber cap is applied. Present only when `cap_applied` is `true`; `null` otherwise.
+ * @return uncappedCount
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "The estimated audience size before the plan's web push subscriber cap is applied. Present only when `cap_applied` is `true`; `null` otherwise.")
+
+ public Integer getUncappedCount() {
+ return uncappedCount;
+ }
+
+
+ public void setUncappedCount(Integer uncappedCount) {
+ this.uncappedCount = uncappedCount;
+ }
+
+
+ public EstimateNotificationRecipientsSuccessResponse capApplied(Boolean capApplied) {
+
+ this.capApplied = capApplied;
+ return this;
+ }
+
+ /**
+ * Whether `count` was reduced because the app is on a plan that caps the number of web push subscribers it can send to.
+ * @return capApplied
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Whether `count` was reduced because the app is on a plan that caps the number of web push subscribers it can send to.")
+
+ public Boolean getCapApplied() {
+ return capApplied;
+ }
+
+
+ public void setCapApplied(Boolean capApplied) {
+ this.capApplied = capApplied;
+ }
+
+
+ public EstimateNotificationRecipientsSuccessResponse mobileSuppressed(Boolean mobileSuppressed) {
+
+ this.mobileSuppressed = mobileSuppressed;
+ return this;
+ }
+
+ /**
+ * The mobile equivalent of `cap_applied`. Whether mobile push deliveries will be dropped for this send because the org is over its plan's mobile push subscriber cap. `false` when the notification doesn't target any mobile push platforms.
+ * @return mobileSuppressed
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "The mobile equivalent of `cap_applied`. Whether mobile push deliveries will be dropped for this send because the org is over its plan's mobile push subscriber cap. `false` when the notification doesn't target any mobile push platforms.")
+
+ public Boolean getMobileSuppressed() {
+ return mobileSuppressed;
+ }
+
+
+ public void setMobileSuppressed(Boolean mobileSuppressed) {
+ this.mobileSuppressed = mobileSuppressed;
+ }
+
+
+ public EstimateNotificationRecipientsSuccessResponse mobileExcludedCount(Integer mobileExcludedCount) {
+
+ this.mobileExcludedCount = mobileExcludedCount;
+ return this;
+ }
+
+ /**
+ * How many mobile push recipients the `count` excludes due to the plan's mobile push subscriber cap. `0` when `mobile_suppressed` is `false`.
+ * @return mobileExcludedCount
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "How many mobile push recipients the `count` excludes due to the plan's mobile push subscriber cap. `0` when `mobile_suppressed` is `false`.")
+
+ public Integer getMobileExcludedCount() {
+ return mobileExcludedCount;
+ }
+
+
+ public void setMobileExcludedCount(Integer mobileExcludedCount) {
+ this.mobileExcludedCount = mobileExcludedCount;
+ }
+
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EstimateNotificationRecipientsSuccessResponse estimateNotificationRecipientsSuccessResponse = (EstimateNotificationRecipientsSuccessResponse) o;
+ return Objects.equals(this.count, estimateNotificationRecipientsSuccessResponse.count) &&
+ Objects.equals(this.uncappedCount, estimateNotificationRecipientsSuccessResponse.uncappedCount) &&
+ Objects.equals(this.capApplied, estimateNotificationRecipientsSuccessResponse.capApplied) &&
+ Objects.equals(this.mobileSuppressed, estimateNotificationRecipientsSuccessResponse.mobileSuppressed) &&
+ Objects.equals(this.mobileExcludedCount, estimateNotificationRecipientsSuccessResponse.mobileExcludedCount);
+ }
+
+ 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(count, uncappedCount, capApplied, mobileSuppressed, mobileExcludedCount);
+ }
+
+ 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 EstimateNotificationRecipientsSuccessResponse {\n");
+ sb.append(" count: ").append(toIndentedString(count)).append("\n");
+ sb.append(" uncappedCount: ").append(toIndentedString(uncappedCount)).append("\n");
+ sb.append(" capApplied: ").append(toIndentedString(capApplied)).append("\n");
+ sb.append(" mobileSuppressed: ").append(toIndentedString(mobileSuppressed)).append("\n");
+ sb.append(" mobileExcludedCount: ").append(toIndentedString(mobileExcludedCount)).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("count");
+ openapiFields.add("uncapped_count");
+ openapiFields.add("cap_applied");
+ openapiFields.add("mobile_suppressed");
+ openapiFields.add("mobile_excluded_count");
+
+ // 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 (!EstimateNotificationRecipientsSuccessResponse.class.isAssignableFrom(type.getRawType())) {
+ return null; // this class only serializes 'EstimateNotificationRecipientsSuccessResponse' and its subtypes
+ }
+ final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
+ final TypeAdapter thisAdapter
+ = gson.getDelegateAdapter(this, TypeToken.get(EstimateNotificationRecipientsSuccessResponse.class));
+
+ return (TypeAdapter) new TypeAdapter() {
+ @Override
+ public void write(JsonWriter out, EstimateNotificationRecipientsSuccessResponse value) throws IOException {
+ JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ elementAdapter.write(out, obj);
+ }
+
+ @Override
+ public EstimateNotificationRecipientsSuccessResponse read(JsonReader in) throws IOException {
+ JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
+
+ return thisAdapter.fromJsonTree(jsonObj);
+ }
+
+ }.nullSafe();
+ }
+ }
+
+ /**
+ * Create an instance of EstimateNotificationRecipientsSuccessResponse given an JSON string
+ *
+ * @param jsonString JSON string
+ * @return An instance of EstimateNotificationRecipientsSuccessResponse
+ * @throws IOException if the JSON string is invalid with respect to EstimateNotificationRecipientsSuccessResponse
+ */
+ public static EstimateNotificationRecipientsSuccessResponse fromJson(String jsonString) throws IOException {
+ return JSON.getGson().fromJson(jsonString, EstimateNotificationRecipientsSuccessResponse.class);
+ }
+
+ /**
+ * Convert an instance of EstimateNotificationRecipientsSuccessResponse 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 ae888f4..26f078f 100644
--- a/src/main/java/com/onesignal/client/model/Notification.java
+++ b/src/main/java/com/onesignal/client/model/Notification.java
@@ -786,11 +786,11 @@ public Notification addIncludedSegmentsItem(String includedSegmentsItem) {
}
/**
- * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
+ * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
* @return includedSegments
**/
@javax.annotation.Nullable
- @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] ")
+ @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. ")
public List getIncludedSegments() {
return includedSegments;
diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java
index eceaa93..dc39945 100644
--- a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java
+++ b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java
@@ -837,11 +837,11 @@ public NotificationWithMeta addIncludedSegmentsItem(String includedSegmentsItem)
}
/**
- * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
+ * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
* @return includedSegments
**/
@javax.annotation.Nullable
- @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] ")
+ @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. ")
public List getIncludedSegments() {
return includedSegments;
diff --git a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java
index a1675b7..8e7ac3e 100644
--- a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java
+++ b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java
@@ -79,11 +79,11 @@ public SegmentNotificationTarget addIncludedSegmentsItem(String includedSegments
}
/**
- * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
+ * The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
* @return includedSegments
**/
@javax.annotation.Nullable
- @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] ")
+ @ApiModelProperty(value = "The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup. ")
public List getIncludedSegments() {
return includedSegments;