From 579c6872ecf76bca03f9eddae68daab59ca5dafa Mon Sep 17 00:00:00 2001 From: OneSignal Date: Thu, 15 Oct 2026 16:27:58 +0000 Subject: [PATCH] feat: add v5.17.0 package updates --- api/openapi.yaml | 388 ++++++++++++++++ docs/DefaultApi.md | 170 +++++++ docs/EmailMetrics.md | 22 + docs/EmailProviderMetrics.md | 15 + docs/EmailProviderMetricsEvent.md | 15 + docs/EmailProviderMetricsResponse.md | 14 + .../EmailProviderMetricsTimeseriesResponse.md | 14 + src/main/java/com/onesignal/client/JSON.java | 5 + .../com/onesignal/client/api/DefaultApi.java | 394 ++++++++++++++++ .../onesignal/client/model/EmailMetrics.java | 425 ++++++++++++++++++ .../client/model/EmailProviderMetrics.java | 216 +++++++++ .../model/EmailProviderMetricsEvent.java | 217 +++++++++ .../model/EmailProviderMetricsResponse.java | 196 ++++++++ ...mailProviderMetricsTimeseriesResponse.java | 196 ++++++++ 14 files changed, 2287 insertions(+) create mode 100644 docs/EmailMetrics.md create mode 100644 docs/EmailProviderMetrics.md create mode 100644 docs/EmailProviderMetricsEvent.md create mode 100644 docs/EmailProviderMetricsResponse.md create mode 100644 docs/EmailProviderMetricsTimeseriesResponse.md create mode 100644 src/main/java/com/onesignal/client/model/EmailMetrics.java create mode 100644 src/main/java/com/onesignal/client/model/EmailProviderMetrics.java create mode 100644 src/main/java/com/onesignal/client/model/EmailProviderMetricsEvent.java create mode 100644 src/main/java/com/onesignal/client/model/EmailProviderMetricsResponse.java create mode 100644 src/main/java/com/onesignal/client/model/EmailProviderMetricsTimeseriesResponse.java diff --git a/api/openapi.yaml b/api/openapi.yaml index cc9f93a..a20b8f6 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1027,6 +1027,210 @@ paths: - rest_api_key: [] summary: Get email reputation statistics x-accepts: application/json + /apps/{app_id}/email_analytics/provider_metrics: + get: + description: "Email delivery, opens, clicks, bounces, failures, and spam complaints\ + \ broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to\ + \ pinpoint where deliverability problems are coming from.\nMetrics are reported\ + \ for a single sending domain over the requested time range. `start` must\ + \ be before `end` and no more than 365 days ago. `providers` is empty when\ + \ the domain is not found for the app or is not currently active for sending.\n" + operationId: get_email_provider_metrics + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: The sending domain to report on. Must be an email domain configured + for this app. + explode: true + in: query + name: domain + required: true + schema: + example: mail.example.com + type: string + style: form + - description: "Start of the reporting window, as an ISO 8601 timestamp (for\ + \ example, `2026-08-01T00:00:00Z`)." + explode: true + in: query + name: start + required: true + schema: + example: 2026-08-01T00:00:00Z + format: date-time + type: string + style: form + - description: "End of the reporting window, as an ISO 8601 timestamp (for example,\ + \ `2026-08-08T00:00:00Z`)." + explode: true + in: query + name: end + required: true + schema: + example: 2026-08-08T00:00:00Z + format: date-time + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailProviderMetricsResponse' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Get email inbox provider metrics + x-accepts: application/json + /apps/{app_id}/email_analytics/provider_metrics_timeseries: + get: + description: "Email delivery, opens, clicks, bounces, failures, and spam complaints\ + \ for a sending domain over time, bucketed by hour, day, or month. Use `providers[]`\ + \ to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo,\ + \ Apple, and more) and track how deliverability to them changes.\nEach event's\ + \ metrics are totaled across the requested providers, or across all providers\ + \ when none are given. `start` must be before `end` and no more than 365 days\ + \ ago, or 60 days ago for `hourly` granularity. `events` is empty when the\ + \ domain is not found for the app or is not currently active for sending.\n" + operationId: get_email_provider_metrics_timeseries + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: The sending domain to report on. Must be an email domain configured + for this app. + explode: true + in: query + name: domain + required: true + schema: + example: mail.example.com + type: string + style: form + - description: "Start of the reporting window, as an ISO 8601 timestamp (for\ + \ example, `2026-08-01T00:00:00Z`)." + explode: true + in: query + name: start + required: true + schema: + example: 2026-08-01T00:00:00Z + format: date-time + type: string + style: form + - description: "End of the reporting window, as an ISO 8601 timestamp (for example,\ + \ `2026-08-08T00:00:00Z`)." + explode: true + in: query + name: end + required: true + schema: + example: 2026-08-08T00:00:00Z + format: date-time + type: string + style: form + - description: The size of each time bucket. Hourly data is only available for + the last 60 days. + explode: true + in: query + name: granularity + required: true + schema: + enum: + - hourly + - daily + - monthly + example: daily + type: string + style: form + - description: "Inbox providers to include in the totals. Omit to include all\ + \ providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`,\ + \ `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`,\ + \ `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`,\ + \ `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`,\ + \ `other_eu`, `other_us`, and `other`.\nExample: providers[]=gmail&providers[]=yahoo_us\n" + explode: true + in: query + name: "providers[]" + required: false + schema: + items: + example: gmail + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailProviderMetricsTimeseriesResponse' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Get email inbox provider metrics over time + x-accepts: application/json /apps/{app_id}/activities/activity/{activity_type}: post: description: Remotely start a Live Activity on iOS devices via OneSignal’s REST @@ -5340,6 +5544,190 @@ components: format: double type: number type: object + EmailProviderMetricsResponse: + description: "Email metrics for a sending domain, broken down by inbox provider." + example: + providers: + - provider: gmail + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + - provider: gmail + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + properties: + providers: + description: One entry per inbox provider that received email from the domain + during the reporting window. Empty when the domain is not found for the + app or is not currently active for sending. + items: + $ref: '#/components/schemas/EmailProviderMetrics' + type: array + type: object + EmailProviderMetrics: + description: Email metrics for a single inbox provider. + example: + provider: gmail + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + properties: + provider: + description: "The inbox provider. Known values include `apple`, `att`, `canadian`,\ + \ `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`,\ + \ `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`,\ + \ `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`,\ + \ `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers\ + \ may be added over time." + example: gmail + type: string + metrics: + $ref: '#/components/schemas/EmailMetrics' + type: object + EmailMetrics: + description: Email delivery and engagement counts for the reporting window. + example: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + properties: + sent: + description: The number of emails sent. + example: 100 + format: int64 + type: integer + delivered: + description: The number of emails successfully delivered. + example: 95 + format: int64 + type: integer + opened: + description: "The total number of email opens, including repeat opens by\ + \ the same recipient." + example: 40 + format: int64 + type: integer + clicked: + description: "The total number of email link clicks, including repeat clicks\ + \ by the same recipient." + example: 10 + format: int64 + type: integer + unique_opened: + description: The number of emails opened at least once. + example: 35 + format: int64 + type: integer + unique_clicked: + description: The number of emails with at least one link click. + example: 8 + format: int64 + type: integer + failed: + description: The number of emails that failed to send. + example: 5 + format: int64 + type: integer + bounced: + description: The number of emails that bounced. + example: 3 + format: int64 + type: integer + complained: + description: The number of emails that recipients reported as spam. + example: 1 + format: int64 + type: integer + type: object + EmailProviderMetricsTimeseriesResponse: + description: Email metrics for a sending domain over time. + example: + events: + - date: 2026-08-01T00:00:00Z + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + - date: 2026-08-01T00:00:00Z + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + properties: + events: + description: "One entry for every time bucket in the reporting window, oldest\ + \ first. Buckets with no email activity are included with all metrics\ + \ set to `0`. Empty when the domain is not found for the app or is not\ + \ currently active for sending." + items: + $ref: '#/components/schemas/EmailProviderMetricsEvent' + type: array + type: object + EmailProviderMetricsEvent: + description: "Email metrics for a single time bucket, totaled across the requested\ + \ inbox providers." + example: + date: 2026-08-01T00:00:00Z + metrics: + unique_opened: 35 + complained: 1 + delivered: 95 + opened: 40 + failed: 5 + bounced: 3 + sent: 100 + clicked: 10 + unique_clicked: 8 + properties: + date: + description: "The start of the time bucket, aligned to the hour, day, or\ + \ month in UTC." + example: 2026-08-01T00:00:00Z + format: date-time + type: string + metrics: + $ref: '#/components/schemas/EmailMetrics' + type: object GenericSuccessBoolResponse: example: success: true diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 32b7eca..4871402 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -32,6 +32,8 @@ All URIs are relative to *https://api.onesignal.com* | [**getAliasesBySubscription**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | | [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app | | [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps | +| [**getEmailProviderMetrics**](DefaultApi.md#getEmailProviderMetrics) | **GET** /apps/{app_id}/email_analytics/provider_metrics | Get email inbox provider metrics | +| [**getEmailProviderMetricsTimeseries**](DefaultApi.md#getEmailProviderMetricsTimeseries) | **GET** /apps/{app_id}/email_analytics/provider_metrics_timeseries | Get email inbox provider metrics over time | | [**getEmailReputation**](DefaultApi.md#getEmailReputation) | **GET** /apps/{app_id}/email_analytics/delivery_metrics | Get email reputation statistics | | [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification | | [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History | @@ -2384,6 +2386,174 @@ This endpoint does not need any parameter. | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **getEmailProviderMetrics** +> EmailProviderMetricsResponse getEmailProviderMetrics(appId, domain, start, end) + +Get email inbox provider metrics + +Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + +### Example +```java +// Import classes: +import java.util.Arrays; +import java.util.List; +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); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String domain = "mail.example.com"; // String | The sending domain to report on. Must be an email domain configured for this app. + OffsetDateTime start = OffsetDateTime.parse("2026-08-01T00:00Z"); // OffsetDateTime | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + OffsetDateTime end = OffsetDateTime.parse("2026-08-08T00:00Z"); // OffsetDateTime | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + try { + EmailProviderMetricsResponse result = apiInstance.getEmailProviderMetrics(appId, domain, start, end); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getEmailProviderMetrics"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **domain** | **String**| The sending domain to report on. Must be an email domain configured for this app. | | +| **start** | **OffsetDateTime**| Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). | | +| **end** | **OffsetDateTime**| End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). | | + +### Return type + +[**EmailProviderMetricsResponse**](EmailProviderMetricsResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + + +# **getEmailProviderMetricsTimeseries** +> EmailProviderMetricsTimeseriesResponse getEmailProviderMetricsTimeseries(appId, domain, start, end, granularity, providers) + +Get email inbox provider metrics over time + +Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + +### Example +```java +// Import classes: +import java.util.Arrays; +import java.util.List; +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); + String appId = "YOUR_APP_ID"; // String | Your OneSignal App ID in UUID v4 format. + String domain = "mail.example.com"; // String | The sending domain to report on. Must be an email domain configured for this app. + OffsetDateTime start = OffsetDateTime.parse("2026-08-01T00:00Z"); // OffsetDateTime | Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). + OffsetDateTime end = OffsetDateTime.parse("2026-08-08T00:00Z"); // OffsetDateTime | End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). + String granularity = "daily"; // String | The size of each time bucket. Hourly data is only available for the last 60 days. + List providers = Arrays.asList(); // List | Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us + try { + EmailProviderMetricsTimeseriesResponse result = apiInstance.getEmailProviderMetricsTimeseries(appId, domain, start, end, granularity, providers); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getEmailProviderMetricsTimeseries"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **domain** | **String**| The sending domain to report on. Must be an email domain configured for this app. | | +| **start** | **OffsetDateTime**| Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). | | +| **end** | **OffsetDateTime**| End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). | | +| **granularity** | **String**| The size of each time bucket. Hourly data is only available for the last 60 days. | [enum: hourly, daily, monthly] | +| **providers** | [**List<String>**](String.md)| Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us | [optional] | + +### Return type + +[**EmailProviderMetricsTimeseriesResponse**](EmailProviderMetricsTimeseriesResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **getEmailReputation** > EmailReputationResponse getEmailReputation(appId) diff --git a/docs/EmailMetrics.md b/docs/EmailMetrics.md new file mode 100644 index 0000000..bca9ff3 --- /dev/null +++ b/docs/EmailMetrics.md @@ -0,0 +1,22 @@ + + +# EmailMetrics + +Email delivery and engagement counts for the reporting window. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sent** | **Long** | The number of emails sent. | [optional] | +|**delivered** | **Long** | The number of emails successfully delivered. | [optional] | +|**opened** | **Long** | The total number of email opens, including repeat opens by the same recipient. | [optional] | +|**clicked** | **Long** | The total number of email link clicks, including repeat clicks by the same recipient. | [optional] | +|**uniqueOpened** | **Long** | The number of emails opened at least once. | [optional] | +|**uniqueClicked** | **Long** | The number of emails with at least one link click. | [optional] | +|**failed** | **Long** | The number of emails that failed to send. | [optional] | +|**bounced** | **Long** | The number of emails that bounced. | [optional] | +|**complained** | **Long** | The number of emails that recipients reported as spam. | [optional] | + + + diff --git a/docs/EmailProviderMetrics.md b/docs/EmailProviderMetrics.md new file mode 100644 index 0000000..ea04caa --- /dev/null +++ b/docs/EmailProviderMetrics.md @@ -0,0 +1,15 @@ + + +# EmailProviderMetrics + +Email metrics for a single inbox provider. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**provider** | **String** | The inbox provider. Known values include `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers may be added over time. | [optional] | +|**metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] | + + + diff --git a/docs/EmailProviderMetricsEvent.md b/docs/EmailProviderMetricsEvent.md new file mode 100644 index 0000000..8eb5df8 --- /dev/null +++ b/docs/EmailProviderMetricsEvent.md @@ -0,0 +1,15 @@ + + +# EmailProviderMetricsEvent + +Email metrics for a single time bucket, totaled across the requested inbox providers. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**date** | **OffsetDateTime** | The start of the time bucket, aligned to the hour, day, or month in UTC. | [optional] | +|**metrics** | [**EmailMetrics**](EmailMetrics.md) | | [optional] | + + + diff --git a/docs/EmailProviderMetricsResponse.md b/docs/EmailProviderMetricsResponse.md new file mode 100644 index 0000000..3c8d4dd --- /dev/null +++ b/docs/EmailProviderMetricsResponse.md @@ -0,0 +1,14 @@ + + +# EmailProviderMetricsResponse + +Email metrics for a sending domain, broken down by inbox provider. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**providers** | [**List<EmailProviderMetrics>**](EmailProviderMetrics.md) | One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending. | [optional] | + + + diff --git a/docs/EmailProviderMetricsTimeseriesResponse.md b/docs/EmailProviderMetricsTimeseriesResponse.md new file mode 100644 index 0000000..1fd5617 --- /dev/null +++ b/docs/EmailProviderMetricsTimeseriesResponse.md @@ -0,0 +1,14 @@ + + +# EmailProviderMetricsTimeseriesResponse + +Email metrics for a sending domain over time. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**List<EmailProviderMetricsEvent>**](EmailProviderMetricsEvent.md) | One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to `0`. Empty when the domain is not found for the app or is not currently active for sending. | [optional] | + + + diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index 672a190..5155569 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -119,6 +119,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.DuplicateJourneyOverrides.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.DuplicateJourneyRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailMetrics.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailProviderMetrics.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailProviderMetricsEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailProviderMetricsResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.EmailProviderMetricsTimeseriesResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.EmailReputationWindow.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.EmailWarmUp.CustomTypeAdapterFactory()) diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index a59b5f5..30cfde3 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -39,6 +39,8 @@ import com.onesignal.client.model.CreateUserConflictResponse; import com.onesignal.client.model.CustomEventsRequest; import com.onesignal.client.model.DuplicateJourneyRequest; +import com.onesignal.client.model.EmailProviderMetricsResponse; +import com.onesignal.client.model.EmailProviderMetricsTimeseriesResponse; import com.onesignal.client.model.EmailReputationResponse; import com.onesignal.client.model.EstimateNotificationRecipientsRequest; import com.onesignal.client.model.EstimateNotificationRecipientsSuccessResponse; @@ -58,6 +60,7 @@ import com.onesignal.client.model.NotificationHistorySuccessResponse; import com.onesignal.client.model.NotificationSlice; import com.onesignal.client.model.NotificationWithMeta; +import java.time.OffsetDateTime; import com.onesignal.client.model.OutcomesData; import com.onesignal.client.model.PropertiesBody; import com.onesignal.client.model.RateLimitError; @@ -4497,6 +4500,397 @@ public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getEmailProviderMetrics + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getEmailProviderMetricsCall(String appId, String domain, OffsetDateTime start, OffsetDateTime end, 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 = null; + + // create path and map variables + String localVarPath = "/apps/{app_id}/email_analytics/provider_metrics" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + + 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.17.0"); + + if (domain != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("domain", domain)); + } + + if (start != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start", start)); + } + + if (end != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end", end)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEmailProviderMetricsValidateBeforeCall(String appId, String domain, OffsetDateTime start, OffsetDateTime end, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getEmailProviderMetrics(Async)"); + } + + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException("Missing the required parameter 'domain' when calling getEmailProviderMetrics(Async)"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException("Missing the required parameter 'start' when calling getEmailProviderMetrics(Async)"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException("Missing the required parameter 'end' when calling getEmailProviderMetrics(Async)"); + } + + + okhttp3.Call localVarCall = getEmailProviderMetricsCall(appId, domain, start, end, _callback); + return localVarCall; + + } + + /** + * Get email inbox provider metrics + * Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @return EmailProviderMetricsResponse + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public EmailProviderMetricsResponse getEmailProviderMetrics(String appId, String domain, OffsetDateTime start, OffsetDateTime end) throws ApiException { + ApiResponse localVarResp = getEmailProviderMetricsWithHttpInfo(appId, domain, start, end); + return localVarResp.getData(); + } + + /** + * Get email inbox provider metrics + * Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @return ApiResponse<EmailProviderMetricsResponse> + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse getEmailProviderMetricsWithHttpInfo(String appId, String domain, OffsetDateTime start, OffsetDateTime end) throws ApiException { + okhttp3.Call localVarCall = getEmailProviderMetricsValidateBeforeCall(appId, domain, start, end, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get email inbox provider metrics (asynchronously) + * Email delivery, opens, clicks, bounces, failures, and spam complaints broken down by inbox provider (Gmail, Outlook, Yahoo, Apple, and more) to pinpoint where deliverability problems are coming from. Metrics are reported for a single sending domain over the requested time range. `start` must be before `end` and no more than 365 days ago. `providers` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getEmailProviderMetricsAsync(String appId, String domain, OffsetDateTime start, OffsetDateTime end, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEmailProviderMetricsValidateBeforeCall(appId, domain, start, end, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEmailProviderMetricsTimeseries + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @param granularity The size of each time bucket. Hourly data is only available for the last 60 days. (required) + * @param providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us (optional) + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getEmailProviderMetricsTimeseriesCall(String appId, String domain, OffsetDateTime start, OffsetDateTime end, String granularity, List providers, 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 = null; + + // create path and map variables + String localVarPath = "/apps/{app_id}/email_analytics/provider_metrics_timeseries" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + + 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.17.0"); + + if (domain != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("domain", domain)); + } + + if (start != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start", start)); + } + + if (end != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end", end)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + if (providers != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "providers[]", providers)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEmailProviderMetricsTimeseriesValidateBeforeCall(String appId, String domain, OffsetDateTime start, OffsetDateTime end, String granularity, List providers, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getEmailProviderMetricsTimeseries(Async)"); + } + + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException("Missing the required parameter 'domain' when calling getEmailProviderMetricsTimeseries(Async)"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException("Missing the required parameter 'start' when calling getEmailProviderMetricsTimeseries(Async)"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException("Missing the required parameter 'end' when calling getEmailProviderMetricsTimeseries(Async)"); + } + + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling getEmailProviderMetricsTimeseries(Async)"); + } + + + okhttp3.Call localVarCall = getEmailProviderMetricsTimeseriesCall(appId, domain, start, end, granularity, providers, _callback); + return localVarCall; + + } + + /** + * Get email inbox provider metrics over time + * Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @param granularity The size of each time bucket. Hourly data is only available for the last 60 days. (required) + * @param providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us (optional) + * @return EmailProviderMetricsTimeseriesResponse + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public EmailProviderMetricsTimeseriesResponse getEmailProviderMetricsTimeseries(String appId, String domain, OffsetDateTime start, OffsetDateTime end, String granularity, List providers) throws ApiException { + ApiResponse localVarResp = getEmailProviderMetricsTimeseriesWithHttpInfo(appId, domain, start, end, granularity, providers); + return localVarResp.getData(); + } + + /** + * Get email inbox provider metrics over time + * Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @param granularity The size of each time bucket. Hourly data is only available for the last 60 days. (required) + * @param providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us (optional) + * @return ApiResponse<EmailProviderMetricsTimeseriesResponse> + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse getEmailProviderMetricsTimeseriesWithHttpInfo(String appId, String domain, OffsetDateTime start, OffsetDateTime end, String granularity, List providers) throws ApiException { + okhttp3.Call localVarCall = getEmailProviderMetricsTimeseriesValidateBeforeCall(appId, domain, start, end, granularity, providers, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get email inbox provider metrics over time (asynchronously) + * Email delivery, opens, clicks, bounces, failures, and spam complaints for a sending domain over time, bucketed by hour, day, or month. Use `providers[]` to narrow the totals to specific inbox providers (Gmail, Outlook, Yahoo, Apple, and more) and track how deliverability to them changes. Each event's metrics are totaled across the requested providers, or across all providers when none are given. `start` must be before `end` and no more than 365 days ago, or 60 days ago for `hourly` granularity. `events` is empty when the domain is not found for the app or is not currently active for sending. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param domain The sending domain to report on. Must be an email domain configured for this app. (required) + * @param start Start of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-01T00:00:00Z`). (required) + * @param end End of the reporting window, as an ISO 8601 timestamp (for example, `2026-08-08T00:00:00Z`). (required) + * @param granularity The size of each time bucket. Hourly data is only available for the last 60 days. (required) + * @param providers Inbox providers to include in the totals. Omit to include all providers. Accepted values: `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. Example: providers[]=gmail&providers[]=yahoo_us (optional) + * @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 -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getEmailProviderMetricsTimeseriesAsync(String appId, String domain, OffsetDateTime start, OffsetDateTime end, String granularity, List providers, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEmailProviderMetricsTimeseriesValidateBeforeCall(appId, domain, start, end, granularity, providers, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getEmailReputation * @param appId Your OneSignal App ID in UUID v4 format. (required) diff --git a/src/main/java/com/onesignal/client/model/EmailMetrics.java b/src/main/java/com/onesignal/client/model/EmailMetrics.java new file mode 100644 index 0000000..4d7798c --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailMetrics.java @@ -0,0 +1,425 @@ +/* + * 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.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; + +/** + * Email delivery and engagement counts for the reporting window. + */ +@ApiModel(description = "Email delivery and engagement counts for the reporting window.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailMetrics { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_SENT = "sent"; + @SerializedName(SERIALIZED_NAME_SENT) + private Long sent; + + public static final String SERIALIZED_NAME_DELIVERED = "delivered"; + @SerializedName(SERIALIZED_NAME_DELIVERED) + private Long delivered; + + public static final String SERIALIZED_NAME_OPENED = "opened"; + @SerializedName(SERIALIZED_NAME_OPENED) + private Long opened; + + public static final String SERIALIZED_NAME_CLICKED = "clicked"; + @SerializedName(SERIALIZED_NAME_CLICKED) + private Long clicked; + + public static final String SERIALIZED_NAME_UNIQUE_OPENED = "unique_opened"; + @SerializedName(SERIALIZED_NAME_UNIQUE_OPENED) + private Long uniqueOpened; + + public static final String SERIALIZED_NAME_UNIQUE_CLICKED = "unique_clicked"; + @SerializedName(SERIALIZED_NAME_UNIQUE_CLICKED) + private Long uniqueClicked; + + public static final String SERIALIZED_NAME_FAILED = "failed"; + @SerializedName(SERIALIZED_NAME_FAILED) + private Long failed; + + public static final String SERIALIZED_NAME_BOUNCED = "bounced"; + @SerializedName(SERIALIZED_NAME_BOUNCED) + private Long bounced; + + public static final String SERIALIZED_NAME_COMPLAINED = "complained"; + @SerializedName(SERIALIZED_NAME_COMPLAINED) + private Long complained; + + public EmailMetrics() { + } + + public EmailMetrics sent(Long sent) { + + this.sent = sent; + return this; + } + + /** + * The number of emails sent. + * @return sent + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "100", value = "The number of emails sent.") + + public Long getSent() { + return sent; + } + + + public void setSent(Long sent) { + this.sent = sent; + } + + + public EmailMetrics delivered(Long delivered) { + + this.delivered = delivered; + return this; + } + + /** + * The number of emails successfully delivered. + * @return delivered + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "95", value = "The number of emails successfully delivered.") + + public Long getDelivered() { + return delivered; + } + + + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + + public EmailMetrics opened(Long opened) { + + this.opened = opened; + return this; + } + + /** + * The total number of email opens, including repeat opens by the same recipient. + * @return opened + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "40", value = "The total number of email opens, including repeat opens by the same recipient.") + + public Long getOpened() { + return opened; + } + + + public void setOpened(Long opened) { + this.opened = opened; + } + + + public EmailMetrics clicked(Long clicked) { + + this.clicked = clicked; + return this; + } + + /** + * The total number of email link clicks, including repeat clicks by the same recipient. + * @return clicked + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10", value = "The total number of email link clicks, including repeat clicks by the same recipient.") + + public Long getClicked() { + return clicked; + } + + + public void setClicked(Long clicked) { + this.clicked = clicked; + } + + + public EmailMetrics uniqueOpened(Long uniqueOpened) { + + this.uniqueOpened = uniqueOpened; + return this; + } + + /** + * The number of emails opened at least once. + * @return uniqueOpened + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "35", value = "The number of emails opened at least once.") + + public Long getUniqueOpened() { + return uniqueOpened; + } + + + public void setUniqueOpened(Long uniqueOpened) { + this.uniqueOpened = uniqueOpened; + } + + + public EmailMetrics uniqueClicked(Long uniqueClicked) { + + this.uniqueClicked = uniqueClicked; + return this; + } + + /** + * The number of emails with at least one link click. + * @return uniqueClicked + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "8", value = "The number of emails with at least one link click.") + + public Long getUniqueClicked() { + return uniqueClicked; + } + + + public void setUniqueClicked(Long uniqueClicked) { + this.uniqueClicked = uniqueClicked; + } + + + public EmailMetrics failed(Long failed) { + + this.failed = failed; + return this; + } + + /** + * The number of emails that failed to send. + * @return failed + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "5", value = "The number of emails that failed to send.") + + public Long getFailed() { + return failed; + } + + + public void setFailed(Long failed) { + this.failed = failed; + } + + + public EmailMetrics bounced(Long bounced) { + + this.bounced = bounced; + return this; + } + + /** + * The number of emails that bounced. + * @return bounced + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "3", value = "The number of emails that bounced.") + + public Long getBounced() { + return bounced; + } + + + public void setBounced(Long bounced) { + this.bounced = bounced; + } + + + public EmailMetrics complained(Long complained) { + + this.complained = complained; + return this; + } + + /** + * The number of emails that recipients reported as spam. + * @return complained + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1", value = "The number of emails that recipients reported as spam.") + + public Long getComplained() { + return complained; + } + + + public void setComplained(Long complained) { + this.complained = complained; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailMetrics emailMetrics = (EmailMetrics) o; + return Objects.equals(this.sent, emailMetrics.sent) && + Objects.equals(this.delivered, emailMetrics.delivered) && + Objects.equals(this.opened, emailMetrics.opened) && + Objects.equals(this.clicked, emailMetrics.clicked) && + Objects.equals(this.uniqueOpened, emailMetrics.uniqueOpened) && + Objects.equals(this.uniqueClicked, emailMetrics.uniqueClicked) && + Objects.equals(this.failed, emailMetrics.failed) && + Objects.equals(this.bounced, emailMetrics.bounced) && + Objects.equals(this.complained, emailMetrics.complained); + } + + @Override + public int hashCode() { + return Objects.hash(sent, delivered, opened, clicked, uniqueOpened, uniqueClicked, failed, bounced, complained); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailMetrics {\n"); + sb.append(" sent: ").append(toIndentedString(sent)).append("\n"); + sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n"); + sb.append(" opened: ").append(toIndentedString(opened)).append("\n"); + sb.append(" clicked: ").append(toIndentedString(clicked)).append("\n"); + sb.append(" uniqueOpened: ").append(toIndentedString(uniqueOpened)).append("\n"); + sb.append(" uniqueClicked: ").append(toIndentedString(uniqueClicked)).append("\n"); + sb.append(" failed: ").append(toIndentedString(failed)).append("\n"); + sb.append(" bounced: ").append(toIndentedString(bounced)).append("\n"); + sb.append(" complained: ").append(toIndentedString(complained)).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("sent"); + openapiFields.add("delivered"); + openapiFields.add("opened"); + openapiFields.add("clicked"); + openapiFields.add("unique_opened"); + openapiFields.add("unique_clicked"); + openapiFields.add("failed"); + openapiFields.add("bounced"); + openapiFields.add("complained"); + + // 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 (!EmailMetrics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailMetrics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailMetrics.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailMetrics value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailMetrics read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailMetrics given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailMetrics + * @throws IOException if the JSON string is invalid with respect to EmailMetrics + */ + public static EmailMetrics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailMetrics.class); + } + + /** + * Convert an instance of EmailMetrics 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/EmailProviderMetrics.java b/src/main/java/com/onesignal/client/model/EmailProviderMetrics.java new file mode 100644 index 0000000..370d938 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailProviderMetrics.java @@ -0,0 +1,216 @@ +/* + * 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.EmailMetrics; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +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; + +/** + * Email metrics for a single inbox provider. + */ +@ApiModel(description = "Email metrics for a single inbox provider.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailProviderMetrics { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + private String provider; + + public static final String SERIALIZED_NAME_METRICS = "metrics"; + @SerializedName(SERIALIZED_NAME_METRICS) + private EmailMetrics metrics; + + public EmailProviderMetrics() { + } + + public EmailProviderMetrics provider(String provider) { + + this.provider = provider; + return this; + } + + /** + * The inbox provider. Known values include `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers may be added over time. + * @return provider + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gmail", value = "The inbox provider. Known values include `apple`, `att`, `canadian`, `chinese`, `comcast`, `free_fr`, `french`, `german`, `gmail`, `google_workspace`, `googlers`, `inbox_lv`, `italian`, `japanese`, `outlook_365`, `outlook_eu`, `outlook_us`, `proton`, `rackspace`, `russian`, `uk`, `united_online`, `yahoo_eu`, `yahoo_us`, `other_eu`, `other_us`, and `other`. New providers may be added over time.") + + public String getProvider() { + return provider; + } + + + public void setProvider(String provider) { + this.provider = provider; + } + + + public EmailProviderMetrics metrics(EmailMetrics metrics) { + + this.metrics = metrics; + return this; + } + + /** + * Get metrics + * @return metrics + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailMetrics getMetrics() { + return metrics; + } + + + public void setMetrics(EmailMetrics metrics) { + this.metrics = metrics; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailProviderMetrics emailProviderMetrics = (EmailProviderMetrics) o; + return Objects.equals(this.provider, emailProviderMetrics.provider) && + Objects.equals(this.metrics, emailProviderMetrics.metrics); + } + + @Override + public int hashCode() { + return Objects.hash(provider, metrics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailProviderMetrics {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).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("provider"); + openapiFields.add("metrics"); + + // 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 (!EmailProviderMetrics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailProviderMetrics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailProviderMetrics.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailProviderMetrics value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailProviderMetrics read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailProviderMetrics given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailProviderMetrics + * @throws IOException if the JSON string is invalid with respect to EmailProviderMetrics + */ + public static EmailProviderMetrics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailProviderMetrics.class); + } + + /** + * Convert an instance of EmailProviderMetrics 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/EmailProviderMetricsEvent.java b/src/main/java/com/onesignal/client/model/EmailProviderMetricsEvent.java new file mode 100644 index 0000000..33f4196 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailProviderMetricsEvent.java @@ -0,0 +1,217 @@ +/* + * 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.EmailMetrics; +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; + +/** + * Email metrics for a single time bucket, totaled across the requested inbox providers. + */ +@ApiModel(description = "Email metrics for a single time bucket, totaled across the requested inbox providers.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailProviderMetricsEvent { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_DATE = "date"; + @SerializedName(SERIALIZED_NAME_DATE) + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_METRICS = "metrics"; + @SerializedName(SERIALIZED_NAME_METRICS) + private EmailMetrics metrics; + + public EmailProviderMetricsEvent() { + } + + public EmailProviderMetricsEvent date(OffsetDateTime date) { + + this.date = date; + return this; + } + + /** + * The start of the time bucket, aligned to the hour, day, or month in UTC. + * @return date + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2026-08-01T00:00Z", value = "The start of the time bucket, aligned to the hour, day, or month in UTC.") + + public OffsetDateTime getDate() { + return date; + } + + + public void setDate(OffsetDateTime date) { + this.date = date; + } + + + public EmailProviderMetricsEvent metrics(EmailMetrics metrics) { + + this.metrics = metrics; + return this; + } + + /** + * Get metrics + * @return metrics + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EmailMetrics getMetrics() { + return metrics; + } + + + public void setMetrics(EmailMetrics metrics) { + this.metrics = metrics; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailProviderMetricsEvent emailProviderMetricsEvent = (EmailProviderMetricsEvent) o; + return Objects.equals(this.date, emailProviderMetricsEvent.date) && + Objects.equals(this.metrics, emailProviderMetricsEvent.metrics); + } + + @Override + public int hashCode() { + return Objects.hash(date, metrics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailProviderMetricsEvent {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).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("date"); + openapiFields.add("metrics"); + + // 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 (!EmailProviderMetricsEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailProviderMetricsEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailProviderMetricsEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailProviderMetricsEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailProviderMetricsEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailProviderMetricsEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailProviderMetricsEvent + * @throws IOException if the JSON string is invalid with respect to EmailProviderMetricsEvent + */ + public static EmailProviderMetricsEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailProviderMetricsEvent.class); + } + + /** + * Convert an instance of EmailProviderMetricsEvent 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/EmailProviderMetricsResponse.java b/src/main/java/com/onesignal/client/model/EmailProviderMetricsResponse.java new file mode 100644 index 0000000..fe44dfe --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailProviderMetricsResponse.java @@ -0,0 +1,196 @@ +/* + * 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.EmailProviderMetrics; +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; + +/** + * Email metrics for a sending domain, broken down by inbox provider. + */ +@ApiModel(description = "Email metrics for a sending domain, broken down by inbox provider.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailProviderMetricsResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_PROVIDERS = "providers"; + @SerializedName(SERIALIZED_NAME_PROVIDERS) + private List providers = null; + + public EmailProviderMetricsResponse() { + } + + public EmailProviderMetricsResponse providers(List providers) { + + this.providers = providers; + return this; + } + + public EmailProviderMetricsResponse addProvidersItem(EmailProviderMetrics providersItem) { + if (this.providers == null) { + this.providers = new ArrayList<>(); + } + this.providers.add(providersItem); + return this; + } + + /** + * One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending. + * @return providers + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "One entry per inbox provider that received email from the domain during the reporting window. Empty when the domain is not found for the app or is not currently active for sending.") + + public List getProviders() { + return providers; + } + + + public void setProviders(List providers) { + this.providers = providers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailProviderMetricsResponse emailProviderMetricsResponse = (EmailProviderMetricsResponse) o; + return Objects.equals(this.providers, emailProviderMetricsResponse.providers); + } + + @Override + public int hashCode() { + return Objects.hash(providers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailProviderMetricsResponse {\n"); + sb.append(" providers: ").append(toIndentedString(providers)).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("providers"); + + // 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 (!EmailProviderMetricsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailProviderMetricsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailProviderMetricsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailProviderMetricsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailProviderMetricsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailProviderMetricsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailProviderMetricsResponse + * @throws IOException if the JSON string is invalid with respect to EmailProviderMetricsResponse + */ + public static EmailProviderMetricsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailProviderMetricsResponse.class); + } + + /** + * Convert an instance of EmailProviderMetricsResponse 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/EmailProviderMetricsTimeseriesResponse.java b/src/main/java/com/onesignal/client/model/EmailProviderMetricsTimeseriesResponse.java new file mode 100644 index 0000000..b12dc6b --- /dev/null +++ b/src/main/java/com/onesignal/client/model/EmailProviderMetricsTimeseriesResponse.java @@ -0,0 +1,196 @@ +/* + * 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.EmailProviderMetricsEvent; +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; + +/** + * Email metrics for a sending domain over time. + */ +@ApiModel(description = "Email metrics for a sending domain over time.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EmailProviderMetricsTimeseriesResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_EVENTS = "events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + private List events = null; + + public EmailProviderMetricsTimeseriesResponse() { + } + + public EmailProviderMetricsTimeseriesResponse events(List events) { + + this.events = events; + return this; + } + + public EmailProviderMetricsTimeseriesResponse addEventsItem(EmailProviderMetricsEvent eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to `0`. Empty when the domain is not found for the app or is not currently active for sending. + * @return events + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "One entry for every time bucket in the reporting window, oldest first. Buckets with no email activity are included with all metrics set to `0`. Empty when the domain is not found for the app or is not currently active for sending.") + + public List getEvents() { + return events; + } + + + public void setEvents(List events) { + this.events = events; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailProviderMetricsTimeseriesResponse emailProviderMetricsTimeseriesResponse = (EmailProviderMetricsTimeseriesResponse) o; + return Objects.equals(this.events, emailProviderMetricsTimeseriesResponse.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailProviderMetricsTimeseriesResponse {\n"); + sb.append(" events: ").append(toIndentedString(events)).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("events"); + + // 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 (!EmailProviderMetricsTimeseriesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailProviderMetricsTimeseriesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailProviderMetricsTimeseriesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailProviderMetricsTimeseriesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailProviderMetricsTimeseriesResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailProviderMetricsTimeseriesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailProviderMetricsTimeseriesResponse + * @throws IOException if the JSON string is invalid with respect to EmailProviderMetricsTimeseriesResponse + */ + public static EmailProviderMetricsTimeseriesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailProviderMetricsTimeseriesResponse.class); + } + + /** + * Convert an instance of EmailProviderMetricsTimeseriesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +