From abdb323a8343947cec6f40772f8e0baa181848aa Mon Sep 17 00:00:00 2001 From: OneSignal Date: Wed, 1 Oct 2025 21:06:27 +0000 Subject: [PATCH] feat: add v5.3.0-beta1 package updates --- README.md | 38 +- api/openapi.yaml | 2643 +++++++--- build.gradle | 2 +- build.sbt | 2 +- docs/ApiKeyToken.md | 27 + docs/ApiKeyTokensListResponse.md | 13 + docs/CopyTemplateRequest.md | 13 + docs/CreateApiKeyRequest.md | 24 + docs/CreateApiKeyResponse.md | 14 + docs/CreateTemplateRequest.md | 20 + docs/CustomEvent.md | 17 + docs/CustomEventsRequest.md | 13 + docs/DefaultApi.md | 1818 +++++-- docs/StartLiveActivityRequest.md | 36 + docs/StartLiveActivitySuccessResponse.md | 13 + docs/TemplateResource.md | 28 + docs/TemplatesListResponse.md | 13 + docs/UpdateApiKeyRequest.md | 24 + docs/UpdateTemplateRequest.md | 19 + pom.xml | 2 +- .../com/onesignal/client/ApiCallback.java | 2 +- .../java/com/onesignal/client/ApiClient.java | 4 +- .../com/onesignal/client/ApiException.java | 2 +- .../com/onesignal/client/ApiResponse.java | 2 +- .../com/onesignal/client/Configuration.java | 2 +- .../client/GzipRequestInterceptor.java | 2 +- src/main/java/com/onesignal/client/JSON.java | 16 +- src/main/java/com/onesignal/client/Pair.java | 2 +- .../onesignal/client/ProgressRequestBody.java | 2 +- .../client/ProgressResponseBody.java | 2 +- .../java/com/onesignal/client/StringUtil.java | 2 +- .../com/onesignal/client/api/DefaultApi.java | 4631 ++++++++++++----- .../com/onesignal/client/auth/ApiKeyAuth.java | 2 +- .../onesignal/client/auth/Authentication.java | 2 +- .../onesignal/client/auth/HttpBasicAuth.java | 2 +- .../onesignal/client/auth/HttpBearerAuth.java | 2 +- .../client/model/AbstractOpenApiSchema.java | 2 +- .../onesignal/client/model/ApiKeyToken.java | 392 ++ .../model/ApiKeyTokensListResponse.java | 196 + .../java/com/onesignal/client/model/App.java | 2 +- .../client/model/BasicNotification.java | 2 +- .../client/model/BasicNotificationAllOf.java | 2 +- ...ificationAllOfAndroidBackgroundLayout.java | 2 +- .../com/onesignal/client/model/Button.java | 2 +- .../client/model/CopyTemplateRequest.java | 186 + .../client/model/CreateApiKeyRequest.java | 302 ++ .../client/model/CreateApiKeyResponse.java | 215 + .../CreateNotificationSuccessResponse.java | 2 +- .../model/CreateSegmentConflictResponse.java | 2 +- .../model/CreateSegmentSuccessResponse.java | 2 +- .../client/model/CreateTemplateRequest.java | 411 ++ .../model/CreateUserConflictResponse.java | 2 +- ...CreateUserConflictResponseErrorsInner.java | 2 +- ...teUserConflictResponseErrorsItemsMeta.java | 2 +- .../onesignal/client/model/CustomEvent.java | 330 ++ .../client/model/CustomEventsRequest.java | 194 + .../onesignal/client/model/DeliveryData.java | 2 +- .../model/ExportEventsSuccessResponse.java | 2 +- .../model/ExportSubscriptionsRequestBody.java | 2 +- .../ExportSubscriptionsSuccessResponse.java | 2 +- .../com/onesignal/client/model/Filter.java | 2 +- .../client/model/FilterExpression.java | 2 +- .../onesignal/client/model/GenericError.java | 2 +- .../model/GenericSuccessBoolResponse.java | 2 +- .../GetNotificationHistoryRequestBody.java | 2 +- .../model/GetSegmentsSuccessResponse.java | 2 +- .../client/model/LanguageStringMap.java | 2 +- .../onesignal/client/model/Notification.java | 2 +- .../client/model/NotificationAllOf.java | 2 +- .../NotificationHistorySuccessResponse.java | 2 +- .../client/model/NotificationSlice.java | 2 +- .../client/model/NotificationTarget.java | 2 +- .../client/model/NotificationWithMeta.java | 2 +- .../model/NotificationWithMetaAllOf.java | 2 +- .../com/onesignal/client/model/Operator.java | 2 +- .../onesignal/client/model/OutcomeData.java | 2 +- .../onesignal/client/model/OutcomesData.java | 2 +- .../client/model/PlatformDeliveryData.java | 2 +- .../model/PlatformDeliveryDataEmailAllOf.java | 2 +- .../model/PlatformDeliveryDataSmsAllOf.java | 2 +- .../client/model/PropertiesBody.java | 2 +- .../client/model/PropertiesDeltas.java | 2 +- .../client/model/PropertiesObject.java | 2 +- .../com/onesignal/client/model/Purchase.java | 2 +- .../client/model/RateLimitError.java | 2 +- .../com/onesignal/client/model/Segment.java | 2 +- .../onesignal/client/model/SegmentData.java | 2 +- .../model/SegmentNotificationTarget.java | 2 +- .../model/StartLiveActivityRequest.java | 746 +++ .../StartLiveActivitySuccessResponse.java | 185 + .../onesignal/client/model/Subscription.java | 2 +- .../client/model/SubscriptionBody.java | 2 +- .../model/SubscriptionNotificationTarget.java | 2 +- .../client/model/TemplateResource.java | 408 ++ .../client/model/TemplatesListResponse.java | 196 + .../TransferSubscriptionRequestBody.java | 2 +- .../client/model/UpdateApiKeyRequest.java | 302 ++ .../model/UpdateLiveActivityRequest.java | 2 +- .../UpdateLiveActivitySuccessResponse.java | 2 +- .../client/model/UpdateTemplateRequest.java | 378 ++ .../client/model/UpdateUserRequest.java | 2 +- .../java/com/onesignal/client/model/User.java | 2 +- .../client/model/UserIdentityBody.java | 2 +- .../com/onesignal/client/model/WebButton.java | 2 +- 104 files changed, 11574 insertions(+), 2431 deletions(-) create mode 100644 docs/ApiKeyToken.md create mode 100644 docs/ApiKeyTokensListResponse.md create mode 100644 docs/CopyTemplateRequest.md create mode 100644 docs/CreateApiKeyRequest.md create mode 100644 docs/CreateApiKeyResponse.md create mode 100644 docs/CreateTemplateRequest.md create mode 100644 docs/CustomEvent.md create mode 100644 docs/CustomEventsRequest.md create mode 100644 docs/StartLiveActivityRequest.md create mode 100644 docs/StartLiveActivitySuccessResponse.md create mode 100644 docs/TemplateResource.md create mode 100644 docs/TemplatesListResponse.md create mode 100644 docs/UpdateApiKeyRequest.md create mode 100644 docs/UpdateTemplateRequest.md create mode 100644 src/main/java/com/onesignal/client/model/ApiKeyToken.java create mode 100644 src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java create mode 100644 src/main/java/com/onesignal/client/model/CopyTemplateRequest.java create mode 100644 src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java create mode 100644 src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java create mode 100644 src/main/java/com/onesignal/client/model/CreateTemplateRequest.java create mode 100644 src/main/java/com/onesignal/client/model/CustomEvent.java create mode 100644 src/main/java/com/onesignal/client/model/CustomEventsRequest.java create mode 100644 src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java create mode 100644 src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java create mode 100644 src/main/java/com/onesignal/client/model/TemplateResource.java create mode 100644 src/main/java/com/onesignal/client/model/TemplatesListResponse.java create mode 100644 src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java create mode 100644 src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java diff --git a/README.md b/README.md index 6210bb2..0d6f73c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # onesignal-java-client OneSignal -- API version: 5.2.1 +- API version: 5.3.0 A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com @@ -30,7 +30,7 @@ Add this dependency to your project's POM: com.onesignal onesignal-java-client - 5.2.1 + 5.3.0 compile ``` @@ -41,7 +41,7 @@ Add this dependency to your project's build file: ```groovy dependencies { - implementation "com.onesignal:onesignal-java-client:5.2.1" + implementation "com.onesignal:onesignal-java-client:5.3.0" } ``` @@ -62,7 +62,7 @@ repositories { } dependencies { - implementation "com.onesignal:onesignal-java-client:5.2.1" + implementation "com.onesignal:onesignal-java-client:5.3.0" } ``` @@ -76,7 +76,7 @@ mvn clean package Then manually install the following JARs: -* `target/onesignal-java-client-5.2.1.jar` +* `target/onesignal-java-client-5.3.0.jar` * `target/lib/*.jar` ## Getting Started @@ -140,16 +140,22 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DefaultApi* | [**cancelNotification**](docs/DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +*DefaultApi* | [**copyTemplateToApp**](docs/DefaultApi.md#copyTemplateToApp) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app *DefaultApi* | [**createAlias**](docs/DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | *DefaultApi* | [**createAliasBySubscription**](docs/DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**createApiKey**](docs/DefaultApi.md#createApiKey) | **POST** /apps/{app_id}/auth/tokens | Create API key *DefaultApi* | [**createApp**](docs/DefaultApi.md#createApp) | **POST** /apps | Create an app +*DefaultApi* | [**createCustomEvents**](docs/DefaultApi.md#createCustomEvents) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events *DefaultApi* | [**createNotification**](docs/DefaultApi.md#createNotification) | **POST** /notifications | Create notification *DefaultApi* | [**createSegment**](docs/DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment *DefaultApi* | [**createSubscription**](docs/DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +*DefaultApi* | [**createTemplate**](docs/DefaultApi.md#createTemplate) | **POST** /templates | Create template *DefaultApi* | [**createUser**](docs/DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | *DefaultApi* | [**deleteAlias**](docs/DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | +*DefaultApi* | [**deleteApiKey**](docs/DefaultApi.md#deleteApiKey) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key *DefaultApi* | [**deleteSegment**](docs/DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment *DefaultApi* | [**deleteSubscription**](docs/DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**deleteTemplate**](docs/DefaultApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete template *DefaultApi* | [**deleteUser**](docs/DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *DefaultApi* | [**exportEvents**](docs/DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events *DefaultApi* | [**exportSubscriptions**](docs/DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions @@ -163,27 +169,43 @@ Class | Method | HTTP request | Description *DefaultApi* | [**getOutcomes**](docs/DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes *DefaultApi* | [**getSegments**](docs/DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments *DefaultApi* | [**getUser**](docs/DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*DefaultApi* | [**rotateApiKey**](docs/DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key +*DefaultApi* | [**startLiveActivity**](docs/DefaultApi.md#startLiveActivity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity *DefaultApi* | [**transferSubscription**](docs/DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | *DefaultApi* | [**unsubscribeEmailWithToken**](docs/DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token +*DefaultApi* | [**updateApiKey**](docs/DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key *DefaultApi* | [**updateApp**](docs/DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app *DefaultApi* | [**updateLiveActivity**](docs/DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push *DefaultApi* | [**updateSubscription**](docs/DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**updateSubscriptionByToken**](docs/DefaultApi.md#updateSubscriptionByToken) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token +*DefaultApi* | [**updateTemplate**](docs/DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template *DefaultApi* | [**updateUser**](docs/DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*DefaultApi* | [**viewApiKeys**](docs/DefaultApi.md#viewApiKeys) | **GET** /apps/{app_id}/auth/tokens | View API keys +*DefaultApi* | [**viewTemplate**](docs/DefaultApi.md#viewTemplate) | **GET** /templates/{template_id} | View template +*DefaultApi* | [**viewTemplates**](docs/DefaultApi.md#viewTemplates) | **GET** /templates | View templates ## Documentation for Models + - [ApiKeyToken](docs/ApiKeyToken.md) + - [ApiKeyTokensListResponse](docs/ApiKeyTokensListResponse.md) - [App](docs/App.md) - [BasicNotification](docs/BasicNotification.md) - [BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) - [Button](docs/Button.md) + - [CopyTemplateRequest](docs/CopyTemplateRequest.md) + - [CreateApiKeyRequest](docs/CreateApiKeyRequest.md) + - [CreateApiKeyResponse](docs/CreateApiKeyResponse.md) - [CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) + - [CreateTemplateRequest](docs/CreateTemplateRequest.md) - [CreateUserConflictResponse](docs/CreateUserConflictResponse.md) - [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) - [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) + - [CustomEvent](docs/CustomEvent.md) + - [CustomEventsRequest](docs/CustomEventsRequest.md) - [DeliveryData](docs/DeliveryData.md) - [ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md) - [ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md) @@ -216,12 +238,18 @@ Class | Method | HTTP request | Description - [Segment](docs/Segment.md) - [SegmentData](docs/SegmentData.md) - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md) + - [StartLiveActivityRequest](docs/StartLiveActivityRequest.md) + - [StartLiveActivitySuccessResponse](docs/StartLiveActivitySuccessResponse.md) - [Subscription](docs/Subscription.md) - [SubscriptionBody](docs/SubscriptionBody.md) - [SubscriptionNotificationTarget](docs/SubscriptionNotificationTarget.md) + - [TemplateResource](docs/TemplateResource.md) + - [TemplatesListResponse](docs/TemplatesListResponse.md) - [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) + - [UpdateApiKeyRequest](docs/UpdateApiKeyRequest.md) - [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) + - [UpdateTemplateRequest](docs/UpdateTemplateRequest.md) - [UpdateUserRequest](docs/UpdateUserRequest.md) - [User](docs/User.md) - [UserIdentityBody](docs/UserIdentityBody.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 51d3732..fc8e610 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 5.2.1 + version: 5.3.0 servers: - url: https://api.onesignal.com paths: @@ -699,6 +699,59 @@ paths: - rest_api_key: [] summary: View Outcomes 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 + API. + operationId: start_live_activity + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: The name of the Live Activity defined in your app. This should + match the attributes struct used in your app's Live Activity implementation. + explode: false + in: path + name: activity_type + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartLiveActivityRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/StartLiveActivitySuccessResponse' + description: Created + "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: Start Live Activity + x-content-type: application/json + x-accepts: application/json /apps/{app_id}/live_activities/{activity_id}/notifications: post: description: Updates a specified live activity. @@ -1503,6 +1556,68 @@ paths: - rest_api_key: [] x-content-type: application/json x-accepts: application/json + /apps/{app_id}/subscriptions_by_token/{token_type}/{token}: + patch: + description: Update properties on an existing OneSignal subscription using its + token. + operationId: update_subscription_by_token + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: The type of token to use when looking up the subscription. See + Subscription Types. + explode: false + in: path + name: token_type + required: true + schema: + type: string + style: simple + - description: "The value of the token to lookup by (e.g., email address, phone\ + \ number)." + explode: false + in: path + name: token + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionBody' + required: true + responses: + "202": + content: + application/json: + schema: + type: object + description: ACCEPTED + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + security: + - rest_api_key: [] + summary: Update subscription by token + x-content-type: application/json + x-accepts: application/json /apps/{app_id}/notifications/{notification_id}/unsubscribe: post: description: Unsubscribe an email with a token when using your own custom email @@ -1710,88 +1825,594 @@ paths: - rest_api_key: [] summary: Export CSV of Events x-accepts: application/json -components: - requestBodies: - get_notification_history_request_body: - content: - application/json: - schema: - $ref: '#/components/schemas/get_notification_history_request_body' - required: true - export_subscriptions_request_body: - content: - application/json: - schema: - $ref: '#/components/schemas/export_subscriptions_request_body' - schemas: - App: - example: - apns_key_id: apns_key_id - apns_team_id: apns_team_id - apns_p12: apns_p12 - safari_site_origin: safari_site_origin - apns_p12_password: apns_p12_password - created_at: 2000-01-23T04:56:07.000+00:00 - safari_icon_64_64: safari_icon_64_64 - chrome_web_sub_domain: chrome_web_sub_domain - gcm_key: gcm_key - apns_bundle_id: apns_bundle_id - chrome_key: chrome_key - safari_push_id: safari_push_id - updated_at: 2000-01-23T04:56:07.000+00:00 - apns_certificates: apns_certificates - safari_apns_p12: safari_apns_p12 - safari_icon_128_128: safari_icon_128_128 - id: id - android_gcm_sender_id: android_gcm_sender_id - safari_icon_32_32: safari_icon_32_32 - additional_data_is_root_payload: true - apns_env: sandbox - players: 0 - messageable_players: 6 - apns_p8: apns_p8 - chrome_web_origin: chrome_web_origin - basic_auth_key: basic_auth_key - site_name: site_name - safari_icon_16_16: safari_icon_16_16 - chrome_web_default_notification_icon: chrome_web_default_notification_icon - organization_id: organization_id - name: name - safari_apns_certificates: safari_apns_certificates - safari_apns_p12_password: safari_apns_p12_password - safari_icon_256_256: safari_icon_256_256 - properties: - id: - readOnly: true - type: string - name: - description: "The name of your app, as displayed on your apps list on the\ - \ dashboard. This can be renamed." + /templates: + get: + description: List templates for an app. + operationId: view_templates + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: true + in: query + name: app_id + required: true + schema: type: string - players: - readOnly: true + style: form + - description: Maximum number of templates. Default and max is 50. + explode: true + in: query + name: limit + required: false + schema: + default: 50 type: integer - messageable_players: - readOnly: true + style: form + - description: Pagination offset. + explode: true + in: query + name: offset + required: false + schema: + default: 0 type: integer - updated_at: - format: date-time - readOnly: true - type: string - created_at: - format: date-time - readOnly: true + style: form + - description: Filter by delivery channel. + explode: true + in: query + name: channel + required: false + schema: + enum: + - push + - email + - sms type: string - android_gcm_sender_id: - description: "Android: Your Google Project number. Also known as Sender\ - \ ID." + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplatesListResponse' + 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: View templates + x-accepts: application/json + post: + description: "Create reusable message templates for push, email, and SMS channels." + operationId: create_template + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTemplateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateResource' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unprocessable Entity + security: + - rest_api_key: [] + summary: Create template + x-content-type: application/json + x-accepts: application/json + /templates/{template_id}: + delete: + description: Delete a template by id. + operationId: delete_template + parameters: + - explode: false + in: path + name: template_id + required: true + schema: type: string - writeOnly: true - gcm_key: - description: "Android: Your Google Push Messaging Auth Key" - nullable: true + style: simple + - explode: true + in: query + name: app_id + required: true + schema: type: string - chrome_web_origin: + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericSuccessBoolResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + security: + - rest_api_key: [] + summary: Delete template + x-accepts: application/json + get: + description: Fetch a single template by id. + operationId: view_template + parameters: + - explode: false + in: path + name: template_id + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateResource' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + security: + - rest_api_key: [] + summary: View template + x-accepts: application/json + patch: + description: Update an existing template. + operationId: update_template + parameters: + - explode: false + in: path + name: template_id + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTemplateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateResource' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - rest_api_key: [] + summary: Update template + x-content-type: application/json + x-accepts: application/json + /templates/{template_id}/copy_to_app: + post: + description: Copy a template to a destination app. + operationId: copy_template_to_app + parameters: + - explode: false + in: path + name: template_id + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CopyTemplateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateResource' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: Copy template to another app + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/auth/tokens: + get: + description: View the details of all of your current app API keys (Rich Authentication + Token) for a single OneSignal app. + operationId: view_api_keys + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKeyTokensListResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: View API keys + x-accepts: application/json + post: + description: "Use this API to create a new App API Key (also called a Rich Authentication\ + \ Token) for a specific OneSignal app. These keys are used to authenticate\ + \ API requests at the app level and offer enhanced security features, including\ + \ optional IP allowlisting." + operationId: create_api_key + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: Create API key + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/auth/tokens/{token_id}: + delete: + description: "Delete a specific Rich Authentication Token (App API Key) for\ + \ a OneSignal app. Requires your Organization API Key and the token’s unique\ + \ ID, not the token value itself." + operationId: delete_api_key + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: token_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + type: object + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: Delete API key + x-accepts: application/json + patch: + description: Update a Rich Authentication Token (App API Key) for a OneSignal + app. + operationId: update_api_key + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: token_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateApiKeyRequest' + required: true + responses: + "200": + content: + application/json: + schema: + type: object + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: Update API key + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/auth/tokens/{token_id}/rotate: + post: + description: Rotate a Rich Authentication Token (App API Key) for a OneSignal + app. Rotating a key revokes the current token and generates a new one under + the same configuration—ideal when a token is lost or compromised but you don’t + want to recreate and reconfigure it from scratch. + operationId: rotate_api_key + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: token_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateApiKeyResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + security: + - organization_api_key: [] + summary: Rotate API key + x-accepts: application/json + /apps/{app_id}/integrations/custom_events: + post: + description: "The Custom Events API allows you to record user events. Custom\ + \ events can represent any action users take in your application, such as\ + \ completing a purchase, viewing content, or achieving milestones." + operationId: create_custom_events + parameters: + - description: Your OneSignal App ID in UUID v4 format. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEventsRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEventsResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unauthorized + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Create custom events + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + get_notification_history_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/get_notification_history_request_body' + required: true + export_subscriptions_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/export_subscriptions_request_body' + schemas: + App: + example: + apns_key_id: apns_key_id + apns_team_id: apns_team_id + apns_p12: apns_p12 + safari_site_origin: safari_site_origin + apns_p12_password: apns_p12_password + created_at: 2000-01-23T04:56:07.000+00:00 + safari_icon_64_64: safari_icon_64_64 + chrome_web_sub_domain: chrome_web_sub_domain + gcm_key: gcm_key + apns_bundle_id: apns_bundle_id + chrome_key: chrome_key + safari_push_id: safari_push_id + updated_at: 2000-01-23T04:56:07.000+00:00 + apns_certificates: apns_certificates + safari_apns_p12: safari_apns_p12 + safari_icon_128_128: safari_icon_128_128 + id: id + android_gcm_sender_id: android_gcm_sender_id + safari_icon_32_32: safari_icon_32_32 + additional_data_is_root_payload: true + apns_env: sandbox + players: 0 + messageable_players: 6 + apns_p8: apns_p8 + chrome_web_origin: chrome_web_origin + basic_auth_key: basic_auth_key + site_name: site_name + safari_icon_16_16: safari_icon_16_16 + chrome_web_default_notification_icon: chrome_web_default_notification_icon + organization_id: organization_id + name: name + safari_apns_certificates: safari_apns_certificates + safari_apns_p12_password: safari_apns_p12_password + safari_icon_256_256: safari_icon_256_256 + properties: + id: + readOnly: true + type: string + name: + description: "The name of your app, as displayed on your apps list on the\ + \ dashboard. This can be renamed." + type: string + players: + readOnly: true + type: integer + messageable_players: + readOnly: true + type: integer + updated_at: + format: date-time + readOnly: true + type: string + created_at: + format: date-time + readOnly: true + type: string + android_gcm_sender_id: + description: "Android: Your Google Project number. Also known as Sender\ + \ ID." + type: string + writeOnly: true + gcm_key: + description: "Android: Your Google Push Messaging Auth Key" + nullable: true + type: string + chrome_web_origin: description: "Chrome (All Browsers except Safari) (Recommended): The URL\ \ to your website. This field is required if you wish to enable web push\ \ and specify other web push parameters." @@ -2194,352 +2815,838 @@ components: description: Text in Hungarian. type: string id: - description: Text in Indonesian. + description: Text in Indonesian. + type: string + it: + description: Text in Italian. + type: string + ja: + description: Text in Japanese. + type: string + ko: + description: Text in Korean. + type: string + lv: + description: Text in Latvian. + type: string + lt: + description: Text in Lithuanian. + type: string + ms: + description: Text in Malay. + type: string + nb: + description: Text in Norwegian. + type: string + pl: + description: Text in Polish. + type: string + fa: + description: Text in Persian. + type: string + pt: + description: Text in Portugese. + type: string + pa: + description: Text in Punjabi. + type: string + ro: + description: Text in Romanian. + type: string + ru: + description: Text in Russian. + type: string + sr: + description: Text in Serbian. + type: string + sk: + description: Text in Slovak. + type: string + es: + description: Text in Spanish. + type: string + sv: + description: Text in Swedish. + type: string + th: + description: Text in Thai. + type: string + tr: + description: Text in Turkish. + type: string + uk: + description: Text in Ukrainian. + type: string + vi: + description: Text in Vietnamese. + type: string + type: object + NotificationSlice: + example: + offset: 6 + total_count: 0 + limit: 1 + notifications: + - null + - null + properties: + total_count: + type: integer + offset: + type: integer + limit: + type: integer + notifications: + items: + $ref: '#/components/schemas/NotificationWithMeta' + type: array + type: object + PlatformDeliveryData: + description: Hash of delivery statistics broken out by target device platform. + properties: + edge_web_push: + $ref: '#/components/schemas/DeliveryData' + chrome_web_push: + $ref: '#/components/schemas/DeliveryData' + firefox_web_push: + $ref: '#/components/schemas/DeliveryData' + safari_web_push: + $ref: '#/components/schemas/DeliveryData' + android: + $ref: '#/components/schemas/DeliveryData' + ios: + $ref: '#/components/schemas/DeliveryData' + sms: + allOf: + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/PlatformDeliveryData_sms_allOf' + email: + allOf: + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/PlatformDeliveryData_email_allOf' + type: object + DeliveryData: + properties: + successful: + description: "Number of messages delivered to push servers, mobile carriers,\ + \ or email service providers." + nullable: true + type: integer + failed: + description: Number of messages sent to unsubscribed devices. + nullable: true + type: integer + errored: + description: Number of errors reported. + nullable: true + type: integer + converted: + description: Number of messages that were clicked. + nullable: true + type: integer + received: + description: Number of devices that received the message. + nullable: true + type: integer + type: object + Purchase: + example: + amount: amount + iso: iso + count: 2 + sku: sku + properties: + sku: + description: The unique identifier of the purchased item. + type: string + amount: + description: "The amount, in USD, spent purchasing the item." + type: string + iso: + description: The 3-letter ISO 4217 currency code. Required for correct storage + and conversion of amount. + type: string + count: + type: integer + required: + - amount + - iso + - sku + type: object + OutcomeData: + example: + aggregation: sum + id: id + value: 0 + properties: + id: type: string - it: - description: Text in Italian. + value: + type: integer + aggregation: + enum: + - sum + - count type: string - ja: - description: Text in Japanese. + required: + - aggregation + - id + - value + type: object + OutcomesData: + example: + outcomes: + - aggregation: sum + id: id + value: 0 + - aggregation: sum + id: id + value: 0 + properties: + outcomes: + items: + $ref: '#/components/schemas/OutcomeData' + type: array + type: object + Filter: + properties: + field: + description: Required. Name of the field to use as the first operand in + the filter expression. type: string - ko: - description: Text in Korean. + key: + description: "If `field` is `tag`, this field is *required* to specify `key`\ + \ inside the tags." type: string - lv: - description: Text in Latvian. + value: + description: Constant value to use as the second operand in the filter expression. + This value is *required* when the relation operator is a binary operator. type: string - lt: - description: Text in Lithuanian. + hours_ago: + description: "If `field` is session-related, this is *required* to specify\ + \ the number of hours before or after the user's session." type: string - ms: - description: Text in Malay. + radius: + description: "If `field` is `location`, this will specify the radius in\ + \ meters from a provided location point. Use with `lat` and `long`." + type: number + lat: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's latitude." + type: number + long: + description: "If `field` is `location`, this is *required* to specify the\ + \ user's longitude." + type: number + relation: + description: Required. Operator of a filter expression. + enum: + - '>' + - < + - = + - '!=' + - exists + - not_exists + - time_elapsed_gt + - time_elapsed_lt type: string - nb: - description: Text in Norwegian. + type: object + Operator: + properties: + operator: + description: "Strictly, this must be either `\"OR\"`, or `\"AND\"`. It\ + \ can be used to compose Filters as part of a Filters object." + enum: + - OR + - AND type: string - pl: - description: Text in Polish. + type: object + FilterExpression: + oneOf: + - $ref: '#/components/schemas/Filter' + - $ref: '#/components/schemas/Operator' + Segment: + example: + name: name + id: id + filters: + - null + - null + properties: + id: + description: "UUID of the segment. If left empty, it will be assigned automaticaly." type: string - fa: - description: Text in Persian. + name: + description: Name of the segment. You'll see this name on the Web UI. type: string - pt: - description: Text in Portugese. + filters: + description: "Filter or operators the segment will have. For a list of\ + \ available filters with details, please see Send to Users Based on Filters." + items: + $ref: '#/components/schemas/FilterExpression' + type: array + required: + - filters + - name + type: object + SegmentData: + example: + is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id + properties: + id: + description: The segment ID type: string - pa: - description: Text in Punjabi. + name: + description: The segment name type: string - ro: - description: Text in Romanian. + created_at: + description: Date segment created type: string - ru: - description: Text in Russian. + updated_at: + description: Date segment last updated type: string - sr: - description: Text in Serbian. + app_id: + description: The app id type: string - sk: - description: Text in Slovak. + read_only: + description: Is the segment read only? + type: boolean + is_active: + description: Is the segment active? + type: boolean + type: object + GetSegmentsSuccessResponse: + example: + offset: 6 + total_count: 0 + limit: 1 + segments: + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id + - is_active: true + updated_at: updated_at + read_only: true + name: name + created_at: created_at + id: id + app_id: app_id + properties: + total_count: + description: The number of Segments in the response. + type: integer + offset: + description: Set with the offset query parameter. Default 0. + type: integer + limit: + description: Maximum number of Segments returned. Default 300. + type: integer + segments: + description: An array containing the Segment information. + items: + $ref: '#/components/schemas/SegmentData' + type: array + type: object + UpdateLiveActivityRequest: + example: + event_updates: "{}" + stale_date: 0 + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + sound: sound + name: name + headings: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + dismissal_date: 6 + event: update + priority: 1 + properties: + name: + description: An internal name to assist with your campaign organization. + This does not get displayed in the message itself. type: string - es: - description: Text in Spanish. + event: + enum: + - update + - end type: string - sv: - description: Text in Swedish. + event_updates: + description: This must match the ContentState interface you have defined + within your Live Activity in your app. + type: object + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + sound: + description: Sound file that is included in your app to play instead of + the default device notification sound. Omit to disable vibration and sound + for the notification. type: string - th: - description: Text in Thai. + stale_date: + description: "Accepts Unix timestamp in seconds. When time reaches the configured\ + \ stale date, the system considers the Live Activity out of date, and\ + \ the ActivityState of the Live Activity changes to ActivityState.stale." + type: integer + dismissal_date: + description: Accepts Unix timestamp in seconds; only allowed if event is + "end" + type: integer + priority: + description: "Delivery priority through the the push provider (APNs). Pass\ + \ 10 for higher priority notifications, or 5 for lower priority notifications.\ + \ Lower priority notifications are sent based on the power considerations\ + \ of the end user's device. If not set, defaults to 10. Some providers\ + \ (APNs) allow for a limited budget of high priority notifications per\ + \ hour, and if that budget is exceeded, the provider may throttle notification\ + \ delivery." + type: integer + required: + - event + - event_updates + - name + type: object + IdentityObject: + additionalProperties: + type: string + type: object + PropertiesObject: + example: + country: country + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 + properties: + tags: + additionalProperties: true + type: object + language: type: string - tr: - description: Text in Turkish. + timezone_id: type: string - uk: - description: Text in Ukrainian. + lat: + type: number + long: + type: number + country: type: string - vi: - description: Text in Vietnamese. + first_active: + type: integer + last_active: + type: integer + amount_spent: + type: number + purchases: + items: + $ref: '#/components/schemas/Purchase' + type: array + ip: type: string type: object - NotificationSlice: + PropertiesDeltas: example: - offset: 6 - total_count: 0 - limit: 1 - notifications: - - null - - null + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + session_count: 6 + session_time: 0 properties: - total_count: - type: integer - offset: + session_time: type: integer - limit: + session_count: type: integer - notifications: + purchases: items: - $ref: '#/components/schemas/NotificationWithMeta' + $ref: '#/components/schemas/Purchase' type: array type: object - PlatformDeliveryData: - description: Hash of delivery statistics broken out by target device platform. - properties: - edge_web_push: - $ref: '#/components/schemas/DeliveryData' - chrome_web_push: - $ref: '#/components/schemas/DeliveryData' - firefox_web_push: - $ref: '#/components/schemas/DeliveryData' - safari_web_push: - $ref: '#/components/schemas/DeliveryData' - android: - $ref: '#/components/schemas/DeliveryData' - ios: - $ref: '#/components/schemas/DeliveryData' - sms: - allOf: - - $ref: '#/components/schemas/DeliveryData' - - $ref: '#/components/schemas/PlatformDeliveryData_sms_allOf' - email: - allOf: - - $ref: '#/components/schemas/DeliveryData' - - $ref: '#/components/schemas/PlatformDeliveryData_email_allOf' - type: object - DeliveryData: + Subscription: + example: + notification_types: 7 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9 + test_type: 2 + token: token + carrier: carrier + session_count: 3 + web_auth: web_auth + rooted: true + id: id + sdk: sdk properties: - successful: - description: "Number of messages delivered to push servers, mobile carriers,\ - \ or email service providers." - nullable: true - type: integer - failed: - description: Number of messages sent to unsubscribed devices. - nullable: true - type: integer - errored: - description: Number of errors reported. - nullable: true + id: + type: string + type: + enum: + - iOSPush + - AndroidPush + - FireOSPush + - ChromeExtensionPush + - ChromePush + - WindowsPush + - SafariLegacyPush + - FirefoxPush + - macOSPush + - HuaweiPush + - SafariPush + - Email + - SMS + type: string + token: + type: string + enabled: + type: boolean + notification_types: type: integer - converted: - description: Number of messages that were clicked. - nullable: true + session_time: type: integer - received: - description: Number of devices that received the message. - nullable: true + session_count: type: integer - type: object - Purchase: - example: - amount: amount - iso: iso - count: 2 - sku: sku - properties: - sku: - description: The unique identifier of the purchased item. + sdk: type: string - amount: - description: "The amount, in USD, spent purchasing the item." + device_model: type: string - iso: - description: The 3-letter ISO 4217 currency code. Required for correct storage - and conversion of amount. + device_os: type: string - count: + rooted: + type: boolean + test_type: type: integer - required: - - amount - - iso - - sku - type: object - OutcomeData: - example: - aggregation: sum - id: id - value: 0 - properties: - id: + app_version: type: string - value: + net_type: type: integer - aggregation: - enum: - - sum - - count + carrier: + type: string + web_auth: + type: string + web_p256: type: string - required: - - aggregation - - id - - value type: object - OutcomesData: + User: example: - outcomes: - - aggregation: sum + subscriptions: + - notification_types: 7 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9 + test_type: 2 + token: token + carrier: carrier + session_count: 3 + web_auth: web_auth + rooted: true id: id - value: 0 - - aggregation: sum + sdk: sdk + - notification_types: 7 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9 + test_type: 2 + token: token + carrier: carrier + session_count: 3 + web_auth: web_auth + rooted: true id: id - value: 0 + sdk: sdk + identity: + key: identity + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 properties: - outcomes: + properties: + $ref: '#/components/schemas/PropertiesObject' + identity: + additionalProperties: + type: string + type: object + subscriptions: items: - $ref: '#/components/schemas/OutcomeData' + $ref: '#/components/schemas/Subscription' type: array type: object - Filter: + UpdateUserRequest: + example: + refresh_device_metadata: false + deltas: + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + session_count: 6 + session_time: 0 + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2 + sku: sku + - amount: amount + iso: iso + count: 2 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1 + last_active: 5 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 properties: - field: - description: Required. Name of the field to use as the first operand in - the filter expression. - type: string - key: - description: "If `field` is `tag`, this field is *required* to specify `key`\ - \ inside the tags." - type: string - value: - description: Constant value to use as the second operand in the filter expression. - This value is *required* when the relation operator is a binary operator. - type: string - hours_ago: - description: "If `field` is session-related, this is *required* to specify\ - \ the number of hours before or after the user's session." + properties: + $ref: '#/components/schemas/PropertiesObject' + refresh_device_metadata: + default: false + type: boolean + deltas: + $ref: '#/components/schemas/PropertiesDeltas' + type: object + CreateNotificationSuccessResponse: + example: + external_id: external_id + id: id + errors: "" + properties: + id: type: string - radius: - description: "If `field` is `location`, this will specify the radius in\ - \ meters from a provided location point. Use with `lat` and `long`." - type: number - lat: - description: "If `field` is `location`, this is *required* to specify the\ - \ user's latitude." - type: number - long: - description: "If `field` is `location`, this is *required* to specify the\ - \ user's longitude." - type: number - relation: - description: Required. Operator of a filter expression. - enum: - - '>' - - < - - = - - '!=' - - exists - - not_exists - - time_elapsed_gt - - time_elapsed_lt + external_id: + nullable: true type: string + errors: + description: "Errors include the identifiers that are invalid, or that there\ + \ are no subscribers." type: object - Operator: + GenericSuccessBoolResponse: + example: + success: true properties: - operator: - description: "Strictly, this must be either `\"OR\"`, or `\"AND\"`. It\ - \ can be used to compose Filters as part of a Filters object." - enum: - - OR - - AND + success: + type: boolean + type: object + NotificationHistorySuccessResponse: + example: + success: true + destination_url: destination_url + properties: + success: + type: boolean + destination_url: type: string type: object - FilterExpression: - oneOf: - - $ref: '#/components/schemas/Filter' - - $ref: '#/components/schemas/Operator' - Segment: + CreateSegmentSuccessResponse: example: - name: name + success: true id: id - filters: - - null - - null properties: + success: + type: boolean id: - description: "UUID of the segment. If left empty, it will be assigned automaticaly." - type: string - name: - description: Name of the segment. You'll see this name on the Web UI. + description: UUID of created segment type: string - filters: - description: "Filter or operators the segment will have. For a list of\ - \ available filters with details, please see Send to Users Based on Filters." + type: object + CreateSegmentConflictResponse: + properties: + success: + type: boolean + errors: items: - $ref: '#/components/schemas/FilterExpression' + type: string type: array - required: - - filters - - name type: object - SegmentData: + ExportSubscriptionsSuccessResponse: example: - is_active: true - updated_at: updated_at - read_only: true - name: name - created_at: created_at - id: id - app_id: app_id + csv_file_url: csv_file_url properties: - id: - description: The segment ID - type: string - name: - description: The segment name - type: string - created_at: - description: Date segment created - type: string - updated_at: - description: Date segment last updated - type: string - app_id: - description: The app id + csv_file_url: type: string - read_only: - description: Is the segment read only? - type: boolean - is_active: - description: Is the segment active? - type: boolean type: object - GetSegmentsSuccessResponse: + UpdateLiveActivitySuccessResponse: example: - offset: 6 - total_count: 0 - limit: 1 - segments: - - is_active: true - updated_at: updated_at - read_only: true - name: name - created_at: created_at - id: id - app_id: app_id - - is_active: true - updated_at: updated_at - read_only: true - name: name - created_at: created_at - id: id - app_id: app_id + id: id properties: - total_count: - description: The number of Segments in the response. - type: integer - offset: - description: Set with the offset query parameter. Default 0. - type: integer - limit: - description: Maximum number of Segments returned. Default 300. - type: integer - segments: - description: An array containing the Segment information. - items: - $ref: '#/components/schemas/SegmentData' - type: array + id: + type: string type: object - UpdateLiveActivityRequest: + StartLiveActivityRequest: example: - event_updates: "{}" + excluded_segments: + - excluded_segments + - excluded_segments stale_date: 0 + included_segments: + - included_segments + - included_segments + filters: + - null + - null + priority: 6 + include_aliases: + key: + - include_aliases + - include_aliases + ios_relevance_score: 1.4658129805029452 + event_updates: "{}" contents: de: de hi: hi @@ -2584,8 +3691,8 @@ components: ro: ro nl: nl tr: tr - sound: sound name: name + activity_id: activity_id headings: de: de hi: hi @@ -2622,390 +3729,370 @@ components: vi: vi nb: nb th: th - ja: ja - fa: fa - pl: pl - da: da - he: he - ro: ro - nl: nl - tr: tr - dismissal_date: 6 - event: update - priority: 1 - properties: - name: - description: An internal name to assist with your campaign organization. - This does not get displayed in the message itself. - type: string - event: - enum: - - update - - end - type: string - event_updates: - description: This must match the ContentState interface you have defined - within your Live Activity in your app. - type: object - contents: - $ref: '#/components/schemas/LanguageStringMap' - headings: - $ref: '#/components/schemas/LanguageStringMap' - sound: - description: Sound file that is included in your app to play instead of - the default device notification sound. Omit to disable vibration and sound - for the notification. - type: string - stale_date: - description: "Accepts Unix timestamp in seconds. When time reaches the configured\ - \ stale date, the system considers the Live Activity out of date, and\ - \ the ActivityState of the Live Activity changes to ActivityState.stale." - type: integer - dismissal_date: - description: Accepts Unix timestamp in seconds; only allowed if event is - "end" - type: integer - priority: - description: "Delivery priority through the the push provider (APNs). Pass\ - \ 10 for higher priority notifications, or 5 for lower priority notifications.\ - \ Lower priority notifications are sent based on the power considerations\ - \ of the end user's device. If not set, defaults to 10. Some providers\ - \ (APNs) allow for a limited budget of high priority notifications per\ - \ hour, and if that budget is exceeded, the provider may throttle notification\ - \ delivery." - type: integer - required: - - event - - event_updates - - name - type: object - IdentityObject: - additionalProperties: - type: string - type: object - PropertiesObject: - example: - country: country - purchases: - - amount: amount - iso: iso - count: 2 - sku: sku - - amount: amount - iso: iso - count: 2 - sku: sku - ip: ip - timezone_id: timezone_id - language: language - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - key: "" - amount_spent: 5.637376656633329 - properties: - tags: - additionalProperties: true - type: object - language: - type: string - timezone_id: - type: string - lat: - type: number - long: - type: number - country: - type: string - first_active: - type: integer - last_active: - type: integer - amount_spent: - type: number - purchases: - items: - $ref: '#/components/schemas/Purchase' - type: array - ip: - type: string - type: object - PropertiesDeltas: - example: - purchases: - - amount: amount - iso: iso - count: 2 - sku: sku - - amount: amount - iso: iso - count: 2 - sku: sku - session_count: 6 - session_time: 0 - properties: - session_time: - type: integer - session_count: - type: integer - purchases: - items: - $ref: '#/components/schemas/Purchase' - type: array - type: object - Subscription: - example: - notification_types: 7 - device_model: device_model - app_version: app_version - web_p256: web_p256 - net_type: 4 - type: iOSPush - device_os: device_os - enabled: true - session_time: 9 - test_type: 2 - token: token - carrier: carrier - session_count: 3 - web_auth: web_auth - rooted: true - id: id - sdk: sdk + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + idempotency_key: idempotency_key + event_attributes: "{}" + include_subscription_ids: + - include_subscription_ids + - include_subscription_ids + event: start properties: - id: + name: + description: An internal name to assist with your campaign organization. + This does not get displayed in the message itself. type: string - type: + event: + default: start enum: - - iOSPush - - AndroidPush - - FireOSPush - - ChromeExtensionPush - - ChromePush - - WindowsPush - - SafariLegacyPush - - FirefoxPush - - macOSPush - - HuaweiPush - - SafariPush - - Email - - SMS - type: string - token: - type: string - enabled: - type: boolean - notification_types: - type: integer - session_time: - type: integer - session_count: - type: integer - sdk: + - start type: string - device_model: - type: string - device_os: + activity_id: + description: Set a unique activity_id to track and manage the Live Activity. type: string - rooted: - type: boolean - test_type: + event_attributes: + description: Default/static data to initialize the Live Activity upon start. + type: object + event_updates: + description: Dynamic content used to update the running Live Activity at + start. Must match the ContentState interface defined in your app. + type: object + contents: + $ref: '#/components/schemas/LanguageStringMap' + headings: + $ref: '#/components/schemas/LanguageStringMap' + stale_date: + description: "Accepts Unix timestamp in seconds. When time reaches the configured\ + \ stale date, the system considers the Live Activity out of date, and\ + \ the ActivityState of the Live Activity changes to ActivityState.stale." type: integer - app_version: - type: string - net_type: + priority: + description: "Delivery priority through the push provider (APNs). Pass 10\ + \ for higher priority notifications, or 5 for lower priority notifications.\ + \ Lower priority notifications are sent based on the power considerations\ + \ of the end user's device. If not set, defaults to 10." type: integer - carrier: - type: string - web_auth: - type: string - web_p256: + ios_relevance_score: + description: iOS 15+. A score to indicate how a notification should be displayed + when grouped. Use a float between 0-1. + nullable: true + type: number + idempotency_key: + description: "Correlation and idempotency key.\nA request received with\ + \ this parameter will first look for another notification with the same\ + \ idempotency key. If one exists, a notification will not be sent, and\ + \ result of the previous operation will instead be returned. Therefore,\ + \ if you plan on using this feature, it's important to use a good source\ + \ of randomness to generate the UUID passed here.\nThis key is only idempotent\ + \ for 30 days. After 30 days, the notification could be removed from our\ + \ system and a notification with the same idempotency key will be sent\ + \ again.\n See Idempotent Notification Requests for more details\nwriteOnly:\ + \ true\n" + nullable: true type: string - type: object - User: - example: - subscriptions: - - notification_types: 7 - device_model: device_model - app_version: app_version - web_p256: web_p256 - net_type: 4 - type: iOSPush - device_os: device_os - enabled: true - session_time: 9 - test_type: 2 - token: token - carrier: carrier - session_count: 3 - web_auth: web_auth - rooted: true - id: id - sdk: sdk - - notification_types: 7 - device_model: device_model - app_version: app_version - web_p256: web_p256 - net_type: 4 - type: iOSPush - device_os: device_os - enabled: true - session_time: 9 - test_type: 2 - token: token - carrier: carrier - session_count: 3 - web_auth: web_auth - rooted: true - id: id - sdk: sdk - identity: - key: identity - properties: - country: country - purchases: - - amount: amount - iso: iso - count: 2 - sku: sku - - amount: amount - iso: iso - count: 2 - sku: sku - ip: ip - timezone_id: timezone_id - language: language - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - key: "" - amount_spent: 5.637376656633329 - properties: - properties: - $ref: '#/components/schemas/PropertiesObject' - identity: + include_aliases: additionalProperties: - type: string + 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\"] }\nNot compatible with any other\ + \ targeting parameters.\nREQUIRED: 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 - subscriptions: + include_subscription_ids: + description: Specific subscription ids to target. Not compatible with other + targeting parameters. items: - $ref: '#/components/schemas/Subscription' + type: string + nullable: true + type: array + included_segments: + description: Segment names to include. Only compatible with excluded_segments. + items: + type: string + nullable: true + type: array + excluded_segments: + description: Segment names to exclude. Only compatible with included_segments. + items: + type: string + nullable: true + type: array + filters: + items: + $ref: '#/components/schemas/FilterExpression' + nullable: true type: array + required: + - activity_id + - contents + - event + - event_attributes + - event_updates + - headings + - name type: object - UpdateUserRequest: + StartLiveActivitySuccessResponse: example: - refresh_device_metadata: false - deltas: - purchases: - - amount: amount - iso: iso - count: 2 - sku: sku - - amount: amount - iso: iso - count: 2 - sku: sku - session_count: 6 - session_time: 0 - properties: - country: country - purchases: - - amount: amount - iso: iso - count: 2 - sku: sku - - amount: amount - iso: iso - count: 2 - sku: sku - ip: ip - timezone_id: timezone_id - language: language - first_active: 1 - last_active: 5 - lat: 0.8008281904610115 - long: 6.027456183070403 - tags: - key: "" - amount_spent: 5.637376656633329 + notification_id: notification_id + properties: + notification_id: + type: string + type: object + IncludeAliases: + 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\"] }\nNot compatible with any other targeting parameters.\nREQUIRED:\ + \ REST API Key Authentication\nLimit of 2,000 entries per REST API call\n\ + 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." + nullable: true + type: object + CreateTemplateRequest: + example: + isSMS: true + email_body: email_body + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + name: name + isEmail: true + dynamic_content: dynamic_content + app_id: app_id + email_subject: email_subject properties: - properties: - $ref: '#/components/schemas/PropertiesObject' - refresh_device_metadata: - default: false + app_id: + description: Your OneSignal App ID in UUID v4 format. + type: string + name: + description: Name of the template. + type: string + contents: + $ref: '#/components/schemas/LanguageStringMap' + isEmail: + description: Set true for an Email template. type: boolean - deltas: - $ref: '#/components/schemas/PropertiesDeltas' - type: object - CreateNotificationSuccessResponse: - example: - external_id: external_id - id: id - errors: "" - properties: - id: + email_subject: + description: Subject of the email. + nullable: true type: string - external_id: + email_body: + description: Body of the email (HTML supported). nullable: true type: string - errors: - description: "Errors include the identifiers that are invalid, or that there\ - \ are no subscribers." - type: object - GenericSuccessBoolResponse: - example: - success: true - properties: - success: + isSMS: + description: Set true for an SMS template. type: boolean + dynamic_content: + description: JSON string for dynamic content personalization. + nullable: true + type: string + required: + - app_id + - contents + - name type: object - NotificationHistorySuccessResponse: + UpdateTemplateRequest: example: - success: true - destination_url: destination_url + isSMS: true + email_body: email_body + contents: + de: de + hi: hi + fi: fi + ru: ru + pt: pt + bg: bg + lt: lt + hr: hr + lv: lv + fr: fr + hu: hu + bs: bs + zh-Hans: zh-Hans + zh-Hant: zh-Hant + ka: ka + uk: uk + sk: sk + id: id + ca: ca + sr: sr + sv: sv + ko: ko + ms: ms + el: el + en: en + it: it + zh: zh + es: es + et: et + cs: cs + ar: ar + pa: pa + vi: vi + nb: nb + th: th + ja: ja + fa: fa + pl: pl + da: da + he: he + ro: ro + nl: nl + tr: tr + name: name + isEmail: true + dynamic_content: dynamic_content + email_subject: email_subject properties: - success: + name: + description: Updated name of the template. + type: string + contents: + $ref: '#/components/schemas/LanguageStringMap' + isEmail: + description: Set true for an Email template. type: boolean - destination_url: + email_subject: + description: Subject of the email. + nullable: true + type: string + email_body: + description: Body of the email (HTML supported). + nullable: true + type: string + isSMS: + description: Set true for an SMS template. + type: boolean + dynamic_content: + description: JSON string for dynamic content personalization. + nullable: true type: string type: object - CreateSegmentSuccessResponse: + TemplateResource: example: - success: true + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 id: id + content: + key: "" properties: - success: - type: boolean id: - description: UUID of created segment type: string + name: + type: string + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + channel: + enum: + - push + - email + - sms + nullable: true + type: string + content: + additionalProperties: true + description: Rendered content and channel/platform flags for the template. + type: object type: object - CreateSegmentConflictResponse: + TemplatesListResponse: + example: + templates: + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + content: + key: "" + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + channel: push + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + content: + key: "" properties: - success: - type: boolean - errors: + templates: items: - type: string + $ref: '#/components/schemas/TemplateResource' type: array type: object - ExportSubscriptionsSuccessResponse: - example: - csv_file_url: csv_file_url - properties: - csv_file_url: - type: string - type: object - UpdateLiveActivitySuccessResponse: + CopyTemplateRequest: example: - id: id + target_app_id: target_app_id properties: - id: + target_app_id: + description: Destination OneSignal App ID in UUID v4 format. type: string + required: + - target_app_id type: object CreateUserConflictResponse: properties: @@ -3110,6 +4197,170 @@ components: csv_file_url: type: string type: object + CustomEvent: + example: + onesignal_id: onesignal_id + payload: + key: "" + name: name + external_id: external_id + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + name: + description: The identifier or name of the event. Maximum 128 characters. + type: string + external_id: + description: The external ID of the user targeted for the event. Either + the user's External ID or OneSignal ID is required. + nullable: true + type: string + onesignal_id: + description: The OneSignal ID of the user targeted for the event. Either + the user's External ID or OneSignal ID is required. + nullable: true + type: string + timestamp: + description: Time the event occurred as an ISO8601 formatted string. Defaults + to now if not included or past date provided. + format: date-time + type: string + payload: + additionalProperties: true + description: "Properties or data related to the event, like {\"geography\"\ + : \"USA\"}" + type: object + required: + - name + type: object + CustomEventsRequest: + example: + events: + - onesignal_id: onesignal_id + payload: + key: "" + name: name + external_id: external_id + timestamp: 2000-01-23T04:56:07.000+00:00 + - onesignal_id: onesignal_id + payload: + key: "" + name: name + external_id: external_id + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + events: + items: + $ref: '#/components/schemas/CustomEvent' + type: array + required: + - events + type: object + CustomEventsResponse: + type: object + ApiKeyToken: + example: + token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + properties: + token_id: + type: string + updated_at: + type: string + created_at: + type: string + name: + type: string + ip_allowlist_mode: + enum: + - disabled + - explicit + type: string + ip_allowlist: + items: + type: string + type: array + type: object + ApiKeyTokensListResponse: + example: + tokens: + - token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + - token_id: token_id + updated_at: updated_at + name: name + created_at: created_at + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + properties: + tokens: + items: + $ref: '#/components/schemas/ApiKeyToken' + type: array + type: object + CreateApiKeyRequest: + example: + name: name + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + properties: + name: + type: string + ip_allowlist_mode: + enum: + - disabled + - explicit + type: string + ip_allowlist: + items: + type: string + type: array + type: object + CreateApiKeyResponse: + example: + token_id: token_id + formatted_token: formatted_token + properties: + token_id: + type: string + formatted_token: + type: string + type: object + UpdateApiKeyRequest: + example: + name: name + ip_allowlist_mode: disabled + ip_allowlist: + - ip_allowlist + - ip_allowlist + properties: + name: + type: string + ip_allowlist_mode: + enum: + - disabled + - explicit + type: string + ip_allowlist: + items: + type: string + type: array + type: object get_notification_history_request_body: properties: events: diff --git a/build.gradle b/build.gradle index b718abb..fa730cb 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'com.vanniktech.maven.publish' group = 'com.onesignal' -version = '5.2.1' +version = '5.3.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index afa1473..411cf16 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.onesignal", name := "onesignal-java-client", - version := "5.2.1", + version := "5.3.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/ApiKeyToken.md b/docs/ApiKeyToken.md new file mode 100644 index 0000000..ce0d48e --- /dev/null +++ b/docs/ApiKeyToken.md @@ -0,0 +1,27 @@ + + +# ApiKeyToken + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenId** | **String** | | [optional] | +|**updatedAt** | **String** | | [optional] | +|**createdAt** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**ipAllowlistMode** | [**IpAllowlistModeEnum**](#IpAllowlistModeEnum) | | [optional] | +|**ipAllowlist** | **List<String>** | | [optional] | + + + +## Enum: IpAllowlistModeEnum + +| Name | Value | +|---- | -----| +| DISABLED | "disabled" | +| EXPLICIT | "explicit" | + + + diff --git a/docs/ApiKeyTokensListResponse.md b/docs/ApiKeyTokensListResponse.md new file mode 100644 index 0000000..89ca0ba --- /dev/null +++ b/docs/ApiKeyTokensListResponse.md @@ -0,0 +1,13 @@ + + +# ApiKeyTokensListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokens** | [**List<ApiKeyToken>**](ApiKeyToken.md) | | [optional] | + + + diff --git a/docs/CopyTemplateRequest.md b/docs/CopyTemplateRequest.md new file mode 100644 index 0000000..0b4a8a1 --- /dev/null +++ b/docs/CopyTemplateRequest.md @@ -0,0 +1,13 @@ + + +# CopyTemplateRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**targetAppId** | **String** | Destination OneSignal App ID in UUID v4 format. | | + + + diff --git a/docs/CreateApiKeyRequest.md b/docs/CreateApiKeyRequest.md new file mode 100644 index 0000000..6e329a1 --- /dev/null +++ b/docs/CreateApiKeyRequest.md @@ -0,0 +1,24 @@ + + +# CreateApiKeyRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**ipAllowlistMode** | [**IpAllowlistModeEnum**](#IpAllowlistModeEnum) | | [optional] | +|**ipAllowlist** | **List<String>** | | [optional] | + + + +## Enum: IpAllowlistModeEnum + +| Name | Value | +|---- | -----| +| DISABLED | "disabled" | +| EXPLICIT | "explicit" | + + + diff --git a/docs/CreateApiKeyResponse.md b/docs/CreateApiKeyResponse.md new file mode 100644 index 0000000..fc6f570 --- /dev/null +++ b/docs/CreateApiKeyResponse.md @@ -0,0 +1,14 @@ + + +# CreateApiKeyResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenId** | **String** | | [optional] | +|**formattedToken** | **String** | | [optional] | + + + diff --git a/docs/CreateTemplateRequest.md b/docs/CreateTemplateRequest.md new file mode 100644 index 0000000..6eb9c38 --- /dev/null +++ b/docs/CreateTemplateRequest.md @@ -0,0 +1,20 @@ + + +# CreateTemplateRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**appId** | **String** | Your OneSignal App ID in UUID v4 format. | | +|**name** | **String** | Name of the template. | | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | | +|**isEmail** | **Boolean** | Set true for an Email template. | [optional] | +|**emailSubject** | **String** | Subject of the email. | [optional] | +|**emailBody** | **String** | Body of the email (HTML supported). | [optional] | +|**isSMS** | **Boolean** | Set true for an SMS template. | [optional] | +|**dynamicContent** | **String** | JSON string for dynamic content personalization. | [optional] | + + + diff --git a/docs/CustomEvent.md b/docs/CustomEvent.md new file mode 100644 index 0000000..b4b9b94 --- /dev/null +++ b/docs/CustomEvent.md @@ -0,0 +1,17 @@ + + +# CustomEvent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The identifier or name of the event. Maximum 128 characters. | | +|**externalId** | **String** | The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] | +|**onesignalId** | **String** | The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] | +|**timestamp** | **OffsetDateTime** | Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided. | [optional] | +|**payload** | **Map<String, Object>** | Properties or data related to the event, like {\"geography\": \"USA\"} | [optional] | + + + diff --git a/docs/CustomEventsRequest.md b/docs/CustomEventsRequest.md new file mode 100644 index 0000000..54ef6fa --- /dev/null +++ b/docs/CustomEventsRequest.md @@ -0,0 +1,13 @@ + + +# CustomEventsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**List<CustomEvent>**](CustomEvent.md) | | | + + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index e940587..d118ccc 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -5,16 +5,22 @@ All URIs are relative to *https://api.onesignal.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification | +| [**copyTemplateToApp**](DefaultApi.md#copyTemplateToApp) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app | | [**createAlias**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | | [**createAliasBySubscription**](DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**createApiKey**](DefaultApi.md#createApiKey) | **POST** /apps/{app_id}/auth/tokens | Create API key | | [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app | +| [**createCustomEvents**](DefaultApi.md#createCustomEvents) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events | | [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification | | [**createSegment**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment | | [**createSubscription**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | +| [**createTemplate**](DefaultApi.md#createTemplate) | **POST** /templates | Create template | | [**createUser**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | | | [**deleteAlias**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | +| [**deleteApiKey**](DefaultApi.md#deleteApiKey) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key | | [**deleteSegment**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment | | [**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} | | | [**exportEvents**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events | | [**exportSubscriptions**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions | @@ -28,12 +34,20 @@ All URIs are relative to *https://api.onesignal.com* | [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | | [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments | | [**getUser**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**rotateApiKey**](DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key | +| [**startLiveActivity**](DefaultApi.md#startLiveActivity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity | | [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | | [**unsubscribeEmailWithToken**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token | +| [**updateApiKey**](DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key | | [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app | | [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | | [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | +| [**updateSubscriptionByToken**](DefaultApi.md#updateSubscriptionByToken) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token | +| [**updateTemplate**](DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template | | [**updateUser**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**viewApiKeys**](DefaultApi.md#viewApiKeys) | **GET** /apps/{app_id}/auth/tokens | View API keys | +| [**viewTemplate**](DefaultApi.md#viewTemplate) | **GET** /templates/{template_id} | View template | +| [**viewTemplates**](DefaultApi.md#viewTemplates) | **GET** /templates | View templates | @@ -108,6 +122,78 @@ public class Example { | **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | + +# **copyTemplateToApp** +> TemplateResource copyTemplateToApp(templateId, appId, copyTemplateRequest) + +Copy template to another app + +Copy a template to a destination app. + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String templateId = "templateId_example"; // String | + String appId = "appId_example"; // String | + CopyTemplateRequest copyTemplateRequest = new CopyTemplateRequest(); // CopyTemplateRequest | + try { + TemplateResource result = apiInstance.copyTemplateToApp(templateId, appId, copyTemplateRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#copyTemplateToApp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **templateId** | **String**| | | +| **appId** | **String**| | | +| **copyTemplateRequest** | [**CopyTemplateRequest**](CopyTemplateRequest.md)| | | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | + # **createAlias** > UserIdentityBody createAlias(appId, aliasLabel, aliasId, userIdentityBody) @@ -260,13 +346,13 @@ public class Example { | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **createApp** -> App createApp(app) + +# **createApiKey** +> CreateApiKeyResponse createApiKey(appId, createApiKeyRequest) -Create an app +Create API key -Creates a new OneSignal app +Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. ### Example ```java @@ -288,12 +374,13 @@ public class Example { organization_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - App app = new App(); // App | + String appId = "appId_example"; // String | + CreateApiKeyRequest createApiKeyRequest = new CreateApiKeyRequest(); // CreateApiKeyRequest | try { - App result = apiInstance.createApp(app); + CreateApiKeyResponse result = apiInstance.createApiKey(appId, createApiKeyRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createApp"); + System.err.println("Exception when calling DefaultApi#createApiKey"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -307,11 +394,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **app** | [**App**](App.md)| | | +| **appId** | **String**| | | +| **createApiKeyRequest** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md)| | | ### Return type -[**App**](App.md) +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) ### Authorization @@ -327,15 +415,14 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - -# **createNotification** -> CreateNotificationSuccessResponse createNotification(notification) + +# **createApp** +> App createApp(app) -Create notification +Create an app -Sends notifications to your users +Creates a new OneSignal app ### Example ```java @@ -352,17 +439,17 @@ public class Example { 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("BEARER TOKEN"); + // Configure HTTP bearer authorization: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - Notification notification = new Notification(); // Notification | + App app = new App(); // App | try { - CreateNotificationSuccessResponse result = apiInstance.createNotification(notification); + App result = apiInstance.createApp(app); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createNotification"); + System.err.println("Exception when calling DefaultApi#createApp"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -376,15 +463,15 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **notification** | [**Notification**](Notification.md)| | | +| **app** | [**App**](App.md)| | | ### Return type -[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) +[**App**](App.md) ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers @@ -394,17 +481,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - | +| **200** | OK | - | | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **createSegment** -> CreateSegmentSuccessResponse createSegment(appId, segment) + +# **createCustomEvents** +> Object createCustomEvents(appId, customEventsRequest) -Create Segment +Create custom events -Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. +The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. ### Example ```java @@ -426,13 +513,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - Segment segment = new Segment(); // Segment | + String appId = "appId_example"; // String | Your OneSignal App ID in UUID v4 format. + CustomEventsRequest customEventsRequest = new CustomEventsRequest(); // CustomEventsRequest | try { - CreateSegmentSuccessResponse result = apiInstance.createSegment(appId, segment); + Object result = apiInstance.createCustomEvents(appId, customEventsRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createSegment"); + System.err.println("Exception when calling DefaultApi#createCustomEvents"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -446,12 +533,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **segment** | [**Segment**](Segment.md)| | [optional] | +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **customEventsRequest** | [**CustomEventsRequest**](CustomEventsRequest.md)| | | ### Return type -[**CreateSegmentSuccessResponse**](CreateSegmentSuccessResponse.md) +**Object** ### Authorization @@ -465,18 +552,18 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **201** | Created | - | +| **200** | OK | - | | **400** | Bad Request | - | -| **409** | Conflict | - | +| **401** | Unauthorized | - | | **429** | Rate Limit Exceeded | - | - -# **createSubscription** -> SubscriptionBody createSubscription(appId, aliasLabel, aliasId, subscriptionBody) - + +# **createNotification** +> CreateNotificationSuccessResponse createNotification(notification) +Create notification -Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. +Sends notifications to your users ### Example ```java @@ -498,15 +585,12 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | - SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | + Notification notification = new Notification(); // Notification | try { - SubscriptionBody result = apiInstance.createSubscription(appId, aliasLabel, aliasId, subscriptionBody); + CreateNotificationSuccessResponse result = apiInstance.createNotification(notification); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createSubscription"); + System.err.println("Exception when calling DefaultApi#createNotification"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -520,14 +604,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | -| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | +| **notification** | [**Notification**](Notification.md)| | | ### Return type -[**SubscriptionBody**](SubscriptionBody.md) +[**CreateNotificationSuccessResponse**](CreateNotificationSuccessResponse.md) ### Authorization @@ -541,20 +622,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **201** | CREATED | - | -| **202** | ACCEPTED | - | +| **200** | OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. | - | | **400** | Bad Request | - | -| **404** | Not Found | - | -| **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - | | **429** | Rate Limit Exceeded | - | - -# **createUser** -> User createUser(appId, user) - + +# **createSegment** +> CreateSegmentSuccessResponse createSegment(appId, segment) +Create Segment -Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. +Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. ### Example ```java @@ -576,13 +654,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - User user = new User(); // User | + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + Segment segment = new Segment(); // Segment | try { - User result = apiInstance.createUser(appId, user); + CreateSegmentSuccessResponse result = apiInstance.createSegment(appId, segment); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createUser"); + System.err.println("Exception when calling DefaultApi#createSegment"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -596,12 +674,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **user** | [**User**](User.md)| | | +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segment** | [**Segment**](Segment.md)| | [optional] | ### Return type -[**User**](User.md) +[**CreateSegmentSuccessResponse**](CreateSegmentSuccessResponse.md) ### Authorization @@ -615,20 +693,18 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | CREATED | - | -| **201** | CREATED | - | -| **202** | ACCEPTED | - | +| **201** | Created | - | | **400** | Bad Request | - | -| **409** | Multiple User Identity Conflict | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **deleteAlias** -> UserIdentityBody deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete) + +# **createSubscription** +> SubscriptionBody createSubscription(appId, aliasLabel, aliasId, subscriptionBody) -Deletes an alias by alias label +Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. ### Example ```java @@ -653,12 +729,12 @@ public class Example { String appId = "appId_example"; // String | String aliasLabel = "aliasLabel_example"; // String | String aliasId = "aliasId_example"; // String | - String aliasLabelToDelete = "aliasLabelToDelete_example"; // String | + SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - UserIdentityBody result = apiInstance.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete); + SubscriptionBody result = apiInstance.createSubscription(appId, aliasLabel, aliasId, subscriptionBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteAlias"); + System.err.println("Exception when calling DefaultApi#createSubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -675,11 +751,11 @@ public class Example { | **appId** | **String**| | | | **aliasLabel** | **String**| | | | **aliasId** | **String**| | | -| **aliasLabelToDelete** | **String**| | | +| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +[**SubscriptionBody**](SubscriptionBody.md) ### Authorization @@ -687,25 +763,26 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **201** | CREATED | - | +| **202** | ACCEPTED | - | | **400** | Bad Request | - | | **404** | Not Found | - | -| **409** | Conflict | - | +| **409** | Operation is not permitted due to user having the maximum number of subscriptions assigned | - | | **429** | Rate Limit Exceeded | - | - -# **deleteSegment** -> GenericSuccessBoolResponse deleteSegment(appId, segmentId) + +# **createTemplate** +> TemplateResource createTemplate(createTemplateRequest) -Delete Segment +Create template -Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. +Create reusable message templates for push, email, and SMS channels. ### Example ```java @@ -727,13 +804,12 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String segmentId = "segmentId_example"; // String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. + CreateTemplateRequest createTemplateRequest = new CreateTemplateRequest(); // CreateTemplateRequest | try { - GenericSuccessBoolResponse result = apiInstance.deleteSegment(appId, segmentId); + TemplateResource result = apiInstance.createTemplate(createTemplateRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteSegment"); + System.err.println("Exception when calling DefaultApi#createTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -747,12 +823,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **segmentId** | **String**| The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | +| **createTemplateRequest** | [**CreateTemplateRequest**](CreateTemplateRequest.md)| | | ### Return type -[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) +[**TemplateResource**](TemplateResource.md) ### Authorization @@ -760,7 +835,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -768,16 +843,15 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **404** | Not Found | - | -| **429** | Rate Limit Exceeded | - | +| **422** | Unprocessable Entity | - | - -# **deleteSubscription** -> deleteSubscription(appId, subscriptionId) + +# **createUser** +> User createUser(appId, user) -Deletes the Subscription. +Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. ### Example ```java @@ -800,11 +874,12 @@ public class Example { DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | + User user = new User(); // User | try { - apiInstance.deleteSubscription(appId, subscriptionId); + User result = apiInstance.createUser(appId, user); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteSubscription"); + System.err.println("Exception when calling DefaultApi#createUser"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -819,11 +894,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | -| **subscriptionId** | **String**| | | +| **user** | [**User**](User.md)| | | ### Return type -null (empty response body) +[**User**](User.md) ### Authorization @@ -831,25 +906,26 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | CREATED | - | +| **201** | CREATED | - | | **202** | ACCEPTED | - | | **400** | Bad Request | - | -| **404** | Not Found | - | -| **409** | Conflict | - | +| **409** | Multiple User Identity Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **deleteUser** -> deleteUser(appId, aliasLabel, aliasId) + +# **deleteAlias** +> UserIdentityBody deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete) -Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases +Deletes an alias by alias label ### Example ```java @@ -874,10 +950,12 @@ public class Example { String appId = "appId_example"; // String | String aliasLabel = "aliasLabel_example"; // String | String aliasId = "aliasId_example"; // String | + String aliasLabelToDelete = "aliasLabelToDelete_example"; // String | try { - apiInstance.deleteUser(appId, aliasLabel, aliasId); + UserIdentityBody result = apiInstance.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteUser"); + System.err.println("Exception when calling DefaultApi#deleteAlias"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -894,10 +972,11 @@ public class Example { | **appId** | **String**| | | | **aliasLabel** | **String**| | | | **aliasId** | **String**| | | +| **aliasLabelToDelete** | **String**| | | ### Return type -null (empty response body) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization @@ -913,16 +992,17 @@ null (empty response body) |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **exportEvents** -> ExportEventsSuccessResponse exportEvents(notificationId, appId) + +# **deleteApiKey** +> Object deleteApiKey(appId, tokenId) -Export CSV of Events +Delete API key -Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. +Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. ### Example ```java @@ -939,18 +1019,18 @@ public class Example { 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("BEARER TOKEN"); + // Configure HTTP bearer authorization: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String notificationId = "notificationId_example"; // String | The ID of the notification to export events from. - String appId = "appId_example"; // String | The ID of the app that the notification belongs to. + String appId = "appId_example"; // String | + String tokenId = "tokenId_example"; // String | try { - ExportEventsSuccessResponse result = apiInstance.exportEvents(notificationId, appId); + Object result = apiInstance.deleteApiKey(appId, tokenId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#exportEvents"); + System.err.println("Exception when calling DefaultApi#deleteApiKey"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -964,16 +1044,16 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **notificationId** | **String**| The ID of the notification to export events from. | | -| **appId** | **String**| The ID of the app that the notification belongs to. | | +| **appId** | **String**| | | +| **tokenId** | **String**| | | ### Return type -[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md) +**Object** ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers @@ -985,16 +1065,14 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **404** | Not Found | - | -| **429** | Rate Limit Exceeded | - | - -# **exportSubscriptions** -> ExportSubscriptionsSuccessResponse exportSubscriptions(appId, exportSubscriptionsRequestBody) + +# **deleteSegment** +> GenericSuccessBoolResponse deleteSegment(appId, segmentId) -Export CSV of Subscriptions +Delete Segment -Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | +Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. ### Example ```java @@ -1016,13 +1094,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The app ID that you want to export devices from - ExportSubscriptionsRequestBody exportSubscriptionsRequestBody = new ExportSubscriptionsRequestBody(); // ExportSubscriptionsRequestBody | + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String segmentId = "segmentId_example"; // String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. try { - ExportSubscriptionsSuccessResponse result = apiInstance.exportSubscriptions(appId, exportSubscriptionsRequestBody); + GenericSuccessBoolResponse result = apiInstance.deleteSegment(appId, segmentId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#exportSubscriptions"); + System.err.println("Exception when calling DefaultApi#deleteSegment"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1036,12 +1114,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The app ID that you want to export devices from | | -| **exportSubscriptionsRequestBody** | [**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md)| | [optional] | +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segmentId** | **String**| The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | ### Return type -[**ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization @@ -1049,7 +1127,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -1057,15 +1135,16 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **getAliases** -> UserIdentityBody getAliases(appId, aliasLabel, aliasId) + +# **deleteSubscription** +> deleteSubscription(appId, subscriptionId) -Lists all Aliases for the User identified by (:alias_label, :alias_id). +Deletes the Subscription. ### Example ```java @@ -1088,13 +1167,11 @@ public class Example { DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | + String subscriptionId = "subscriptionId_example"; // String | try { - UserIdentityBody result = apiInstance.getAliases(appId, aliasLabel, aliasId); - System.out.println(result); + apiInstance.deleteSubscription(appId, subscriptionId); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getAliases"); + System.err.println("Exception when calling DefaultApi#deleteSubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1109,12 +1186,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | +| **subscriptionId** | **String**| | | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +null (empty response body) ### Authorization @@ -1128,18 +1204,19 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **202** | ACCEPTED | - | | **400** | Bad Request | - | | **404** | Not Found | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **getAliasesBySubscription** -> UserIdentityBody getAliasesBySubscription(appId, subscriptionId) - + +# **deleteTemplate** +> GenericSuccessBoolResponse deleteTemplate(templateId, appId) +Delete template -Lists all Aliases for the User identified by :subscription_id. +Delete a template by id. ### Example ```java @@ -1161,13 +1238,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); + String templateId = "templateId_example"; // String | String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | try { - UserIdentityBody result = apiInstance.getAliasesBySubscription(appId, subscriptionId); + GenericSuccessBoolResponse result = apiInstance.deleteTemplate(templateId, appId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getAliasesBySubscription"); + System.err.println("Exception when calling DefaultApi#deleteTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1181,12 +1258,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **templateId** | **String**| | | | **appId** | **String**| | | -| **subscriptionId** | **String**| | | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) ### Authorization @@ -1204,13 +1281,13 @@ public class Example { | **400** | Bad Request | - | | **404** | Not Found | - | - -# **getApp** -> App getApp(appId) + +# **deleteUser** +> deleteUser(appId, aliasLabel, aliasId) -View an app -View the details of a single OneSignal app + +Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases ### Example ```java @@ -1227,17 +1304,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: organization_api_key - HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); - organization_api_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | An app id + String appId = "appId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | try { - App result = apiInstance.getApp(appId); - System.out.println(result); + apiInstance.deleteUser(appId, aliasLabel, aliasId); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getApp"); + System.err.println("Exception when calling DefaultApi#deleteUser"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1251,15 +1329,17 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| An app id | | +| **appId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | ### Return type -[**App**](App.md) +null (empty response body) ### Authorization -[organization_api_key](../README.md#organization_api_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1271,15 +1351,16 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **getApps** -> List<App> getApps() + +# **exportEvents** +> ExportEventsSuccessResponse exportEvents(notificationId, appId) -View apps +Export CSV of Events -View the details of all of your current OneSignal apps +Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. ### Example ```java @@ -1296,16 +1377,18 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: organization_api_key - HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); - organization_api_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); + String notificationId = "notificationId_example"; // String | The ID of the notification to export events from. + String appId = "appId_example"; // String | The ID of the app that the notification belongs to. try { - List result = apiInstance.getApps(); + ExportEventsSuccessResponse result = apiInstance.exportEvents(notificationId, appId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getApps"); + System.err.println("Exception when calling DefaultApi#exportEvents"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1316,15 +1399,19 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **notificationId** | **String**| The ID of the notification to export events from. | | +| **appId** | **String**| The ID of the app that the notification belongs to. | | ### Return type -[**List<App>**](App.md) +[**ExportEventsSuccessResponse**](ExportEventsSuccessResponse.md) ### Authorization -[organization_api_key](../README.md#organization_api_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1336,15 +1423,16 @@ This endpoint does not need any parameter. |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | +| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **getNotification** -> NotificationWithMeta getNotification(appId, notificationId) + +# **exportSubscriptions** +> ExportSubscriptionsSuccessResponse exportSubscriptions(appId, exportSubscriptionsRequestBody) -View notification +Export CSV of Subscriptions -View the details of a single notification and outcomes associated with it +Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | ### Example ```java @@ -1366,13 +1454,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String notificationId = "notificationId_example"; // String | + String appId = "appId_example"; // String | The app ID that you want to export devices from + ExportSubscriptionsRequestBody exportSubscriptionsRequestBody = new ExportSubscriptionsRequestBody(); // ExportSubscriptionsRequestBody | try { - NotificationWithMeta result = apiInstance.getNotification(appId, notificationId); + ExportSubscriptionsSuccessResponse result = apiInstance.exportSubscriptions(appId, exportSubscriptionsRequestBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getNotification"); + System.err.println("Exception when calling DefaultApi#exportSubscriptions"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1386,12 +1474,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **notificationId** | **String**| | | +| **appId** | **String**| The app ID that you want to export devices from | | +| **exportSubscriptionsRequestBody** | [**ExportSubscriptionsRequestBody**](ExportSubscriptionsRequestBody.md)| | [optional] | ### Return type -[**NotificationWithMeta**](NotificationWithMeta.md) +[**ExportSubscriptionsSuccessResponse**](ExportSubscriptionsSuccessResponse.md) ### Authorization @@ -1399,7 +1487,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1407,16 +1495,15 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **getNotificationHistory** -> NotificationHistorySuccessResponse getNotificationHistory(notificationId, getNotificationHistoryRequestBody) + +# **getAliases** +> UserIdentityBody getAliases(appId, aliasLabel, aliasId) -Notification History --> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + +Lists all Aliases for the User identified by (:alias_label, :alias_id). ### Example ```java @@ -1438,13 +1525,14 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String notificationId = "notificationId_example"; // String | The \"id\" of the message found in the Notification object - GetNotificationHistoryRequestBody getNotificationHistoryRequestBody = new GetNotificationHistoryRequestBody(); // GetNotificationHistoryRequestBody | + String appId = "appId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | try { - NotificationHistorySuccessResponse result = apiInstance.getNotificationHistory(notificationId, getNotificationHistoryRequestBody); + UserIdentityBody result = apiInstance.getAliases(appId, aliasLabel, aliasId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getNotificationHistory"); + System.err.println("Exception when calling DefaultApi#getAliases"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1458,12 +1546,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **notificationId** | **String**| The \"id\" of the message found in the Notification object | | -| **getNotificationHistoryRequestBody** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md)| | | +| **appId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | ### Return type -[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization @@ -1471,7 +1560,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -1482,13 +1571,13 @@ public class Example { | **404** | Not Found | - | | **429** | Rate Limit Exceeded | - | - -# **getNotifications** -> NotificationSlice getNotifications(appId, limit, offset, kind) + +# **getAliasesBySubscription** +> UserIdentityBody getAliasesBySubscription(appId, subscriptionId) -View notifications -View the details of multiple notifications + +Lists all Aliases for the User identified by :subscription_id. ### Example ```java @@ -1510,15 +1599,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The app ID that you want to view notifications from - Integer limit = 56; // Integer | How many notifications to return. Max is 50. Default is 50. - Integer offset = 56; // Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. - Integer kind = 0; // Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only + String appId = "appId_example"; // String | + String subscriptionId = "subscriptionId_example"; // String | try { - NotificationSlice result = apiInstance.getNotifications(appId, limit, offset, kind); + UserIdentityBody result = apiInstance.getAliasesBySubscription(appId, subscriptionId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getNotifications"); + System.err.println("Exception when calling DefaultApi#getAliasesBySubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1532,14 +1619,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The app ID that you want to view notifications from | | -| **limit** | **Integer**| How many notifications to return. Max is 50. Default is 50. | [optional] | -| **offset** | **Integer**| Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] | -| **kind** | **Integer**| Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] [enum: 0, 1, 3] | +| **appId** | **String**| | | +| **subscriptionId** | **String**| | | ### Return type -[**NotificationSlice**](NotificationSlice.md) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization @@ -1555,15 +1640,812 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | +| **404** | Not Found | - | - -# **getOutcomes** -> OutcomesData getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution) + +# **getApp** +> App getApp(appId) -View Outcomes +View an app -View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. +View the details of a single OneSignal app + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | An app id + try { + App result = apiInstance.getApp(appId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getApp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| An app id | | + +### Return type + +[**App**](App.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **getApps** +> List<App> getApps() + +View apps + +View the details of all of your current OneSignal apps + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + List result = apiInstance.getApps(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getApps"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<App>**](App.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **getNotification** +> NotificationWithMeta getNotification(appId, notificationId) + +View notification + +View the details of a single notification and outcomes associated with it + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String notificationId = "notificationId_example"; // String | + try { + NotificationWithMeta result = apiInstance.getNotification(appId, notificationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getNotification"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **notificationId** | **String**| | | + +### Return type + +[**NotificationWithMeta**](NotificationWithMeta.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### 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 | - | + + +# **getNotificationHistory** +> NotificationHistorySuccessResponse getNotificationHistory(notificationId, getNotificationHistoryRequestBody) + +Notification History + +-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String notificationId = "notificationId_example"; // String | The \"id\" of the message found in the Notification object + GetNotificationHistoryRequestBody getNotificationHistoryRequestBody = new GetNotificationHistoryRequestBody(); // GetNotificationHistoryRequestBody | + try { + NotificationHistorySuccessResponse result = apiInstance.getNotificationHistory(notificationId, getNotificationHistoryRequestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getNotificationHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **notificationId** | **String**| The \"id\" of the message found in the Notification object | | +| **getNotificationHistoryRequestBody** | [**GetNotificationHistoryRequestBody**](GetNotificationHistoryRequestBody.md)| | | + +### Return type + +[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | + + +# **getNotifications** +> NotificationSlice getNotifications(appId, limit, offset, kind) + +View notifications + +View the details of multiple notifications + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The app ID that you want to view notifications from + Integer limit = 56; // Integer | How many notifications to return. Max is 50. Default is 50. + Integer offset = 56; // Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. + Integer kind = 0; // Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only + try { + NotificationSlice result = apiInstance.getNotifications(appId, limit, offset, kind); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getNotifications"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The app ID that you want to view notifications from | | +| **limit** | **Integer**| How many notifications to return. Max is 50. Default is 50. | [optional] | +| **offset** | **Integer**| Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] | +| **kind** | **Integer**| Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] [enum: 0, 1, 3] | + +### Return type + +[**NotificationSlice**](NotificationSlice.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **getOutcomes** +> OutcomesData getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution) + +View Outcomes + +View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String outcomeNames = "outcomeNames_example"; // String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + String outcomeNames2 = "outcomeNames_example"; // String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. + String outcomeTimeRange = "outcomeTimeRange_example"; // String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. + String outcomePlatforms = "outcomePlatforms_example"; // String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. + String outcomeAttribution = "outcomeAttribution_example"; // String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. + try { + OutcomesData result = apiInstance.getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getOutcomes"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **outcomeNames** | **String**| Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | +| **outcomeNames2** | **String**| Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] | +| **outcomeTimeRange** | **String**| Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] | +| **outcomePlatforms** | **String**| Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] | +| **outcomeAttribution** | **String**| Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] | + +### Return type + +[**OutcomesData**](OutcomesData.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **getSegments** +> GetSegmentsSuccessResponse getSegments(appId, offset, limit) + +Get Segments + +Returns an array of segments from an app. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + Integer offset = 56; // Integer | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. + Integer limit = 56; // Integer | The amount of Segments in the response. Maximum 300. + try { + GetSegmentsSuccessResponse result = apiInstance.getSegments(appId, offset, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSegments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **offset** | **Integer**| Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] | +| **limit** | **Integer**| The amount of Segments in the response. Maximum 300. | [optional] | + +### Return type + +[**GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **getUser** +> User getUser(appId, aliasLabel, aliasId) + + + +Returns the User’s properties, Aliases, and Subscriptions. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | + try { + User result = apiInstance.getUser(appId, aliasLabel, aliasId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | + +### Return type + +[**User**](User.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### 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 | - | + + +# **rotateApiKey** +> CreateApiKeyResponse rotateApiKey(appId, tokenId) + +Rotate API key + +Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String tokenId = "tokenId_example"; // String | + try { + CreateApiKeyResponse result = apiInstance.rotateApiKey(appId, tokenId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#rotateApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **tokenId** | **String**| | | + +### Return type + +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | + + +# **startLiveActivity** +> StartLiveActivitySuccessResponse startLiveActivity(appId, activityType, startLiveActivityRequest) + +Start Live Activity + +Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | Your OneSignal App ID in UUID v4 format. + String activityType = "activityType_example"; // String | The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + StartLiveActivityRequest startLiveActivityRequest = new StartLiveActivityRequest(); // StartLiveActivityRequest | + try { + StartLiveActivitySuccessResponse result = apiInstance.startLiveActivity(appId, activityType, startLiveActivityRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#startLiveActivity"); + System.err.println("Status code: " + e.getCode()); + 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. | | +| **activityType** | **String**| The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. | | +| **startLiveActivityRequest** | [**StartLiveActivityRequest**](StartLiveActivityRequest.md)| | | + +### Return type + +[**StartLiveActivitySuccessResponse**](StartLiveActivitySuccessResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **transferSubscription** +> UserIdentityBody transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody) + + + +Transfers this Subscription to the User identified by the identity in the payload. + +### 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.models.*; +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("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String subscriptionId = "subscriptionId_example"; // String | + TransferSubscriptionRequestBody transferSubscriptionRequestBody = new TransferSubscriptionRequestBody(); // TransferSubscriptionRequestBody | + try { + UserIdentityBody result = apiInstance.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transferSubscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **subscriptionId** | **String**| | | +| **transferSubscriptionRequestBody** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | | + +### Return type + +[**UserIdentityBody**](UserIdentityBody.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **409** | Conflict | - | +| **429** | Rate Limit Exceeded | - | + + +# **unsubscribeEmailWithToken** +> GenericSuccessBoolResponse unsubscribeEmailWithToken(appId, notificationId, token) + +Unsubscribe with token + +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Example ```java @@ -1585,17 +2467,158 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String outcomeNames = "outcomeNames_example"; // String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum - String outcomeNames2 = "outcomeNames_example"; // String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. - String outcomeTimeRange = "outcomeTimeRange_example"; // String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. - String outcomePlatforms = "outcomePlatforms_example"; // String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. - String outcomeAttribution = "outcomeAttribution_example"; // String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. + String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String notificationId = "notificationId_example"; // String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + String token = "token_example"; // String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. + try { + GenericSuccessBoolResponse result = apiInstance.unsubscribeEmailWithToken(appId, notificationId, token); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#unsubscribeEmailWithToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **notificationId** | **String**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | +| **token** | **String**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | OK | - | +| **400** | Bad Request | - | +| **429** | Rate Limit Exceeded | - | + + +# **updateApiKey** +> Object updateApiKey(appId, tokenId, updateApiKeyRequest) + +Update API key + +Update a Rich Authentication Token (App API Key) for a OneSignal app. + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String tokenId = "tokenId_example"; // String | + UpdateApiKeyRequest updateApiKeyRequest = new UpdateApiKeyRequest(); // UpdateApiKeyRequest | + try { + Object result = apiInstance.updateApiKey(appId, tokenId, updateApiKeyRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updateApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **tokenId** | **String**| | | +| **updateApiKeyRequest** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md)| | | + +### Return type + +**Object** + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | + + +# **updateApp** +> App updateApp(appId, app) + +Update an app + +Updates the name or configuration settings of an existing OneSignal app + +### 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.models.*; +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: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | An app id + App app = new App(); // App | try { - OutcomesData result = apiInstance.getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); + App result = apiInstance.updateApp(appId, app); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getOutcomes"); + System.err.println("Exception when calling DefaultApi#updateApp"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1609,24 +2632,20 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **outcomeNames** | **String**| Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | -| **outcomeNames2** | **String**| Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] | -| **outcomeTimeRange** | **String**| Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] | -| **outcomePlatforms** | **String**| Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] | -| **outcomeAttribution** | **String**| Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] | +| **appId** | **String**| An app id | | +| **app** | [**App**](App.md)| | | ### Return type -[**OutcomesData**](OutcomesData.md) +[**App**](App.md) ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1636,13 +2655,13 @@ public class Example { | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **getSegments** -> GetSegmentsSuccessResponse getSegments(appId, offset, limit) + +# **updateLiveActivity** +> UpdateLiveActivitySuccessResponse updateLiveActivity(appId, activityId, updateLiveActivityRequest) -Get Segments +Update a Live Activity via Push -Returns an array of segments from an app. +Updates a specified live activity. ### Example ```java @@ -1665,13 +2684,13 @@ public class Example { DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - Integer offset = 56; // Integer | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. - Integer limit = 56; // Integer | The amount of Segments in the response. Maximum 300. + String activityId = "activityId_example"; // String | Live Activity record ID + UpdateLiveActivityRequest updateLiveActivityRequest = new UpdateLiveActivityRequest(); // UpdateLiveActivityRequest | try { - GetSegmentsSuccessResponse result = apiInstance.getSegments(appId, offset, limit); + UpdateLiveActivitySuccessResponse result = apiInstance.updateLiveActivity(appId, activityId, updateLiveActivityRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getSegments"); + System.err.println("Exception when calling DefaultApi#updateLiveActivity"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1686,12 +2705,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **offset** | **Integer**| Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] | -| **limit** | **Integer**| The amount of Segments in the response. Maximum 300. | [optional] | +| **activityId** | **String**| Live Activity record ID | | +| **updateLiveActivityRequest** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md)| | | ### Return type -[**GetSegmentsSuccessResponse**](GetSegmentsSuccessResponse.md) +[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md) ### Authorization @@ -1699,23 +2718,23 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **201** | OK | - | +| **200** | OK | - | | **400** | Bad Request | - | | **429** | Rate Limit Exceeded | - | - -# **getUser** -> User getUser(appId, aliasLabel, aliasId) + +# **updateSubscription** +> updateSubscription(appId, subscriptionId, subscriptionBody) -Returns the User’s properties, Aliases, and Subscriptions. +Updates an existing Subscription’s properties. ### Example ```java @@ -1738,13 +2757,12 @@ public class Example { DefaultApi apiInstance = new DefaultApi(defaultClient); String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | + String subscriptionId = "subscriptionId_example"; // String | + SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - User result = apiInstance.getUser(appId, aliasLabel, aliasId); - System.out.println(result); + apiInstance.updateSubscription(appId, subscriptionId, subscriptionBody); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#getUser"); + System.err.println("Exception when calling DefaultApi#updateSubscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1759,12 +2777,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | +| **subscriptionId** | **String**| | | +| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type -[**User**](User.md) +null (empty response body) ### Authorization @@ -1772,7 +2790,7 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1781,15 +2799,16 @@ public class Example { | **200** | OK | - | | **400** | Bad Request | - | | **404** | Not Found | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **transferSubscription** -> UserIdentityBody transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody) - + +# **updateSubscriptionByToken** +> Object updateSubscriptionByToken(appId, tokenType, token, subscriptionBody) +Update subscription by token -Transfers this Subscription to the User identified by the identity in the payload. +Update properties on an existing OneSignal subscription using its token. ### Example ```java @@ -1811,14 +2830,15 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | - TransferSubscriptionRequestBody transferSubscriptionRequestBody = new TransferSubscriptionRequestBody(); // TransferSubscriptionRequestBody | + String appId = "appId_example"; // String | Your OneSignal App ID in UUID v4 format. + String tokenType = "tokenType_example"; // String | The type of token to use when looking up the subscription. See Subscription Types. + String token = "token_example"; // String | The value of the token to lookup by (e.g., email address, phone number). + SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - UserIdentityBody result = apiInstance.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody); + Object result = apiInstance.updateSubscriptionByToken(appId, tokenType, token, subscriptionBody); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#transferSubscription"); + System.err.println("Exception when calling DefaultApi#updateSubscriptionByToken"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1832,13 +2852,14 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **subscriptionId** | **String**| | | -| **transferSubscriptionRequestBody** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | | +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **tokenType** | **String**| The type of token to use when looking up the subscription. See Subscription Types. | | +| **token** | **String**| The value of the token to lookup by (e.g., email address, phone number). | | +| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +**Object** ### Authorization @@ -1852,19 +2873,17 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **202** | ACCEPTED | - | | **400** | Bad Request | - | | **404** | Not Found | - | -| **409** | Conflict | - | -| **429** | Rate Limit Exceeded | - | - -# **unsubscribeEmailWithToken** -> GenericSuccessBoolResponse unsubscribeEmailWithToken(appId, notificationId, token) + +# **updateTemplate** +> TemplateResource updateTemplate(templateId, appId, updateTemplateRequest) -Unsubscribe with token +Update template -Unsubscribe an email with a token when using your own custom email unsubscribe landing page +Update an existing template. ### Example ```java @@ -1886,14 +2905,14 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String notificationId = "notificationId_example"; // String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. - String token = "token_example"; // String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. + String templateId = "templateId_example"; // String | + String appId = "appId_example"; // String | + UpdateTemplateRequest updateTemplateRequest = new UpdateTemplateRequest(); // UpdateTemplateRequest | try { - GenericSuccessBoolResponse result = apiInstance.unsubscribeEmailWithToken(appId, notificationId, token); + TemplateResource result = apiInstance.updateTemplate(templateId, appId, updateTemplateRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#unsubscribeEmailWithToken"); + System.err.println("Exception when calling DefaultApi#updateTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1907,13 +2926,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **notificationId** | **String**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | | -| **token** | **String**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | | +| **templateId** | **String**| | | +| **appId** | **String**| | | +| **updateTemplateRequest** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md)| | | ### Return type -[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) +[**TemplateResource**](TemplateResource.md) ### Authorization @@ -1921,23 +2940,22 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **202** | OK | - | +| **200** | OK | - | | **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - -# **updateApp** -> App updateApp(appId, app) + +# **updateUser** +> PropertiesBody updateUser(appId, aliasLabel, aliasId, updateUserRequest) -Update an app -Updates the name or configuration settings of an existing OneSignal app + +Updates an existing User’s properties. ### Example ```java @@ -1954,18 +2972,20 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.onesignal.com"); - // Configure HTTP bearer authorization: organization_api_key - HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); - organization_api_key.setBearerToken("BEARER TOKEN"); + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | An app id - App app = new App(); // App | + String appId = "appId_example"; // String | + String aliasLabel = "aliasLabel_example"; // String | + String aliasId = "aliasId_example"; // String | + UpdateUserRequest updateUserRequest = new UpdateUserRequest(); // UpdateUserRequest | try { - App result = apiInstance.updateApp(appId, app); + PropertiesBody result = apiInstance.updateUser(appId, aliasLabel, aliasId, updateUserRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updateApp"); + System.err.println("Exception when calling DefaultApi#updateUser"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1979,16 +2999,18 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| An app id | | -| **app** | [**App**](App.md)| | | +| **appId** | **String**| | | +| **aliasLabel** | **String**| | | +| **aliasId** | **String**| | | +| **updateUserRequest** | [**UpdateUserRequest**](UpdateUserRequest.md)| | | ### Return type -[**App**](App.md) +[**PropertiesBody**](PropertiesBody.md) ### Authorization -[organization_api_key](../README.md#organization_api_key) +[rest_api_key](../README.md#rest_api_key) ### HTTP request headers @@ -1998,17 +3020,18 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **202** | ACCEPTED | - | | **400** | Bad Request | - | +| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | - -# **updateLiveActivity** -> UpdateLiveActivitySuccessResponse updateLiveActivity(appId, activityId, updateLiveActivityRequest) + +# **viewApiKeys** +> ApiKeyTokensListResponse viewApiKeys(appId) -Update a Live Activity via Push +View API keys -Updates a specified live activity. +View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. ### Example ```java @@ -2025,19 +3048,17 @@ public class Example { 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("BEARER TOKEN"); + // Configure HTTP bearer authorization: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | The OneSignal App ID for your app. Available in Keys & IDs. - String activityId = "activityId_example"; // String | Live Activity record ID - UpdateLiveActivityRequest updateLiveActivityRequest = new UpdateLiveActivityRequest(); // UpdateLiveActivityRequest | + String appId = "appId_example"; // String | try { - UpdateLiveActivitySuccessResponse result = apiInstance.updateLiveActivity(appId, activityId, updateLiveActivityRequest); + ApiKeyTokensListResponse result = apiInstance.viewApiKeys(appId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updateLiveActivity"); + System.err.println("Exception when calling DefaultApi#viewApiKeys"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2051,21 +3072,19 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activityId** | **String**| Live Activity record ID | | -| **updateLiveActivityRequest** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md)| | | +| **appId** | **String**| | | ### Return type -[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md) +[**ApiKeyTokensListResponse**](ApiKeyTokensListResponse.md) ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -2073,15 +3092,14 @@ public class Example { |-------------|-------------|------------------| | **200** | OK | - | | **400** | Bad Request | - | -| **429** | Rate Limit Exceeded | - | - - -# **updateSubscription** -> updateSubscription(appId, subscriptionId, subscriptionBody) + +# **viewTemplate** +> TemplateResource viewTemplate(templateId, appId) +View template -Updates an existing Subscription’s properties. +Fetch a single template by id. ### Example ```java @@ -2103,13 +3121,13 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); + String templateId = "templateId_example"; // String | String appId = "appId_example"; // String | - String subscriptionId = "subscriptionId_example"; // String | - SubscriptionBody subscriptionBody = new SubscriptionBody(); // SubscriptionBody | try { - apiInstance.updateSubscription(appId, subscriptionId, subscriptionBody); + TemplateResource result = apiInstance.viewTemplate(templateId, appId); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updateSubscription"); + System.err.println("Exception when calling DefaultApi#viewTemplate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2123,13 +3141,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **templateId** | **String**| | | | **appId** | **String**| | | -| **subscriptionId** | **String**| | | -| **subscriptionBody** | [**SubscriptionBody**](SubscriptionBody.md)| | | ### Return type -null (empty response body) +[**TemplateResource**](TemplateResource.md) ### Authorization @@ -2137,7 +3154,7 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -2146,16 +3163,14 @@ null (empty response body) | **200** | OK | - | | **400** | Bad Request | - | | **404** | Not Found | - | -| **409** | Conflict | - | -| **429** | Rate Limit Exceeded | - | - - -# **updateUser** -> PropertiesBody updateUser(appId, aliasLabel, aliasId, updateUserRequest) + +# **viewTemplates** +> TemplatesListResponse viewTemplates(appId, limit, offset, channel) +View templates -Updates an existing User’s properties. +List templates for an app. ### Example ```java @@ -2177,15 +3192,15 @@ public class Example { rest_api_key.setBearerToken("BEARER TOKEN"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String appId = "appId_example"; // String | - String aliasLabel = "aliasLabel_example"; // String | - String aliasId = "aliasId_example"; // String | - UpdateUserRequest updateUserRequest = new UpdateUserRequest(); // UpdateUserRequest | + String appId = "appId_example"; // String | Your OneSignal App ID in UUID v4 format. + Integer limit = 50; // Integer | Maximum number of templates. Default and max is 50. + Integer offset = 0; // Integer | Pagination offset. + String channel = "push"; // String | Filter by delivery channel. try { - PropertiesBody result = apiInstance.updateUser(appId, aliasLabel, aliasId, updateUserRequest); + TemplatesListResponse result = apiInstance.viewTemplates(appId, limit, offset, channel); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#updateUser"); + System.err.println("Exception when calling DefaultApi#viewTemplates"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -2199,14 +3214,14 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **aliasLabel** | **String**| | | -| **aliasId** | **String**| | | -| **updateUserRequest** | [**UpdateUserRequest**](UpdateUserRequest.md)| | | +| **appId** | **String**| Your OneSignal App ID in UUID v4 format. | | +| **limit** | **Integer**| Maximum number of templates. Default and max is 50. | [optional] [default to 50] | +| **offset** | **Integer**| Pagination offset. | [optional] [default to 0] | +| **channel** | **String**| Filter by delivery channel. | [optional] [enum: push, email, sms] | ### Return type -[**PropertiesBody**](PropertiesBody.md) +[**TemplatesListResponse**](TemplatesListResponse.md) ### Authorization @@ -2214,14 +3229,13 @@ public class Example { ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **202** | ACCEPTED | - | +| **200** | OK | - | | **400** | Bad Request | - | -| **409** | Conflict | - | | **429** | Rate Limit Exceeded | - | diff --git a/docs/StartLiveActivityRequest.md b/docs/StartLiveActivityRequest.md new file mode 100644 index 0000000..ed9a1a4 --- /dev/null +++ b/docs/StartLiveActivityRequest.md @@ -0,0 +1,36 @@ + + +# StartLiveActivityRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | | +|**event** | [**EventEnum**](#EventEnum) | | | +|**activityId** | **String** | Set a unique activity_id to track and manage the Live Activity. | | +|**eventAttributes** | **Object** | Default/static data to initialize the Live Activity upon start. | | +|**eventUpdates** | **Object** | Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. | | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | | +|**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | | +|**staleDate** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] | +|**priority** | **Integer** | Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. | [optional] | +|**iosRelevanceScore** | **BigDecimal** | iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. | [optional] | +|**idempotencyKey** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [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\"] } 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] | +|**includeSubscriptionIds** | **List<String>** | Specific subscription ids to target. Not compatible with other targeting parameters. | [optional] | +|**includedSegments** | **List<String>** | Segment names to include. Only compatible with excluded_segments. | [optional] | +|**excludedSegments** | **List<String>** | Segment names to exclude. Only compatible with included_segments. | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| START | "start" | + + + diff --git a/docs/StartLiveActivitySuccessResponse.md b/docs/StartLiveActivitySuccessResponse.md new file mode 100644 index 0000000..9602e81 --- /dev/null +++ b/docs/StartLiveActivitySuccessResponse.md @@ -0,0 +1,13 @@ + + +# StartLiveActivitySuccessResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**notificationId** | **String** | | [optional] | + + + diff --git a/docs/TemplateResource.md b/docs/TemplateResource.md new file mode 100644 index 0000000..b71dc52 --- /dev/null +++ b/docs/TemplateResource.md @@ -0,0 +1,28 @@ + + +# TemplateResource + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**createdAt** | **OffsetDateTime** | | [optional] | +|**updatedAt** | **OffsetDateTime** | | [optional] | +|**channel** | [**ChannelEnum**](#ChannelEnum) | | [optional] | +|**content** | **Map<String, Object>** | Rendered content and channel/platform flags for the template. | [optional] | + + + +## Enum: ChannelEnum + +| Name | Value | +|---- | -----| +| PUSH | "push" | +| EMAIL | "email" | +| SMS | "sms" | + + + diff --git a/docs/TemplatesListResponse.md b/docs/TemplatesListResponse.md new file mode 100644 index 0000000..502d841 --- /dev/null +++ b/docs/TemplatesListResponse.md @@ -0,0 +1,13 @@ + + +# TemplatesListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**templates** | [**List<TemplateResource>**](TemplateResource.md) | | [optional] | + + + diff --git a/docs/UpdateApiKeyRequest.md b/docs/UpdateApiKeyRequest.md new file mode 100644 index 0000000..1bb6be3 --- /dev/null +++ b/docs/UpdateApiKeyRequest.md @@ -0,0 +1,24 @@ + + +# UpdateApiKeyRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**ipAllowlistMode** | [**IpAllowlistModeEnum**](#IpAllowlistModeEnum) | | [optional] | +|**ipAllowlist** | **List<String>** | | [optional] | + + + +## Enum: IpAllowlistModeEnum + +| Name | Value | +|---- | -----| +| DISABLED | "disabled" | +| EXPLICIT | "explicit" | + + + diff --git a/docs/UpdateTemplateRequest.md b/docs/UpdateTemplateRequest.md new file mode 100644 index 0000000..255097e --- /dev/null +++ b/docs/UpdateTemplateRequest.md @@ -0,0 +1,19 @@ + + +# UpdateTemplateRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Updated name of the template. | [optional] | +|**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] | +|**isEmail** | **Boolean** | Set true for an Email template. | [optional] | +|**emailSubject** | **String** | Subject of the email. | [optional] | +|**emailBody** | **String** | Body of the email (HTML supported). | [optional] | +|**isSMS** | **Boolean** | Set true for an SMS template. | [optional] | +|**dynamicContent** | **String** | JSON string for dynamic content personalization. | [optional] | + + + diff --git a/pom.xml b/pom.xml index 64a2a1e..8a43258 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ onesignal-java-client jar onesignal-java-client - 5.2.1 + 5.3.0 https://github.com/OneSignal/onesignal-java-api OneSignal Java API Client diff --git a/src/main/java/com/onesignal/client/ApiCallback.java b/src/main/java/com/onesignal/client/ApiCallback.java index 4d7db69..cccae2e 100644 --- a/src/main/java/com/onesignal/client/ApiCallback.java +++ b/src/main/java/com/onesignal/client/ApiCallback.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java index b53f4b5..8cb39e5 100644 --- a/src/main/java/com/onesignal/client/ApiClient.java +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -133,7 +133,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/5.2.1/java"); + setUserAgent("OpenAPI-Generator/5.3.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/onesignal/client/ApiException.java b/src/main/java/com/onesignal/client/ApiException.java index 66052a1..94aaad6 100644 --- a/src/main/java/com/onesignal/client/ApiException.java +++ b/src/main/java/com/onesignal/client/ApiException.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ApiResponse.java b/src/main/java/com/onesignal/client/ApiResponse.java index 5d3db1b..19fa961 100644 --- a/src/main/java/com/onesignal/client/ApiResponse.java +++ b/src/main/java/com/onesignal/client/ApiResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/Configuration.java b/src/main/java/com/onesignal/client/Configuration.java index ec726ce..0ce62d4 100644 --- a/src/main/java/com/onesignal/client/Configuration.java +++ b/src/main/java/com/onesignal/client/Configuration.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java index b69eaa6..1e0b1da 100644 --- a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java +++ b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index 76ce075..73d616a 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,17 +93,25 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new com.onesignal.client.model.ApiKeyToken.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.ApiKeyTokensListResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.App.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotification.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Button.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CopyTemplateRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CreateApiKeyRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CreateApiKeyResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateNotificationSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentConflictResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateSegmentSuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CreateTemplateRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponseErrorsInner.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.CreateUserConflictResponseErrorsItemsMeta.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CustomEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.CustomEventsRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportEventsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ExportSubscriptionsRequestBody.CustomTypeAdapterFactory()) @@ -136,12 +144,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.Segment.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentData.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentNotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.StartLiveActivityRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.StartLiveActivitySuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Subscription.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SubscriptionBody.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SubscriptionNotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.TemplateResource.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.TemplatesListResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.TransferSubscriptionRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateApiKeyRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivitySuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateTemplateRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateUserRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.User.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UserIdentityBody.CustomTypeAdapterFactory()) diff --git a/src/main/java/com/onesignal/client/Pair.java b/src/main/java/com/onesignal/client/Pair.java index 7aa5ca8..48e080a 100644 --- a/src/main/java/com/onesignal/client/Pair.java +++ b/src/main/java/com/onesignal/client/Pair.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ProgressRequestBody.java b/src/main/java/com/onesignal/client/ProgressRequestBody.java index 92efc40..b7090a3 100644 --- a/src/main/java/com/onesignal/client/ProgressRequestBody.java +++ b/src/main/java/com/onesignal/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ProgressResponseBody.java b/src/main/java/com/onesignal/client/ProgressResponseBody.java index 8a5511d..c7aed3f 100644 --- a/src/main/java/com/onesignal/client/ProgressResponseBody.java +++ b/src/main/java/com/onesignal/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/StringUtil.java b/src/main/java/com/onesignal/client/StringUtil.java index 6031fff..dadee4b 100644 --- a/src/main/java/com/onesignal/client/StringUtil.java +++ b/src/main/java/com/onesignal/client/StringUtil.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index deebc29..c364330 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,11 +27,17 @@ import java.io.IOException; +import com.onesignal.client.model.ApiKeyTokensListResponse; import com.onesignal.client.model.App; +import com.onesignal.client.model.CopyTemplateRequest; +import com.onesignal.client.model.CreateApiKeyRequest; +import com.onesignal.client.model.CreateApiKeyResponse; import com.onesignal.client.model.CreateNotificationSuccessResponse; import com.onesignal.client.model.CreateSegmentConflictResponse; import com.onesignal.client.model.CreateSegmentSuccessResponse; +import com.onesignal.client.model.CreateTemplateRequest; import com.onesignal.client.model.CreateUserConflictResponse; +import com.onesignal.client.model.CustomEventsRequest; import com.onesignal.client.model.ExportEventsSuccessResponse; import com.onesignal.client.model.ExportSubscriptionsRequestBody; import com.onesignal.client.model.ExportSubscriptionsSuccessResponse; @@ -47,10 +53,16 @@ import com.onesignal.client.model.PropertiesBody; import com.onesignal.client.model.RateLimitError; import com.onesignal.client.model.Segment; +import com.onesignal.client.model.StartLiveActivityRequest; +import com.onesignal.client.model.StartLiveActivitySuccessResponse; import com.onesignal.client.model.SubscriptionBody; +import com.onesignal.client.model.TemplateResource; +import com.onesignal.client.model.TemplatesListResponse; import com.onesignal.client.model.TransferSubscriptionRequestBody; +import com.onesignal.client.model.UpdateApiKeyRequest; import com.onesignal.client.model.UpdateLiveActivityRequest; import com.onesignal.client.model.UpdateLiveActivitySuccessResponse; +import com.onesignal.client.model.UpdateTemplateRequest; import com.onesignal.client.model.UpdateUserRequest; import com.onesignal.client.model.User; import com.onesignal.client.model.UserIdentityBody; @@ -142,7 +154,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -254,6 +266,162 @@ public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for copyTemplateToApp + * @param templateId (required) + * @param appId (required) + * @param copyTemplateRequest (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 -
+ */ + public okhttp3.Call copyTemplateToAppCall(String templateId, String appId, CopyTemplateRequest copyTemplateRequest, 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 = copyTemplateRequest; + + // create path and map variables + String localVarPath = "/templates/{template_id}/copy_to_app" + .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.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.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + 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[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call copyTemplateToAppValidateBeforeCall(String templateId, String appId, CopyTemplateRequest copyTemplateRequest, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException("Missing the required parameter 'templateId' when calling copyTemplateToApp(Async)"); + } + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling copyTemplateToApp(Async)"); + } + + // verify the required parameter 'copyTemplateRequest' is set + if (copyTemplateRequest == null) { + throw new ApiException("Missing the required parameter 'copyTemplateRequest' when calling copyTemplateToApp(Async)"); + } + + + okhttp3.Call localVarCall = copyTemplateToAppCall(templateId, appId, copyTemplateRequest, _callback); + return localVarCall; + + } + + /** + * Copy template to another app + * Copy a template to a destination app. + * @param templateId (required) + * @param appId (required) + * @param copyTemplateRequest (required) + * @return TemplateResource + * @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 -
+ */ + public TemplateResource copyTemplateToApp(String templateId, String appId, CopyTemplateRequest copyTemplateRequest) throws ApiException { + ApiResponse localVarResp = copyTemplateToAppWithHttpInfo(templateId, appId, copyTemplateRequest); + return localVarResp.getData(); + } + + /** + * Copy template to another app + * Copy a template to a destination app. + * @param templateId (required) + * @param appId (required) + * @param copyTemplateRequest (required) + * @return ApiResponse<TemplateResource> + * @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 -
+ */ + public ApiResponse copyTemplateToAppWithHttpInfo(String templateId, String appId, CopyTemplateRequest copyTemplateRequest) throws ApiException { + okhttp3.Call localVarCall = copyTemplateToAppValidateBeforeCall(templateId, appId, copyTemplateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Copy template to another app (asynchronously) + * Copy a template to a destination app. + * @param templateId (required) + * @param appId (required) + * @param copyTemplateRequest (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 -
+ */ + public okhttp3.Call copyTemplateToAppAsync(String templateId, String appId, CopyTemplateRequest copyTemplateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = copyTemplateToAppValidateBeforeCall(templateId, appId, copyTemplateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for createAlias * @param appId (required) @@ -302,7 +470,7 @@ public okhttp3.Call createAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -475,7 +643,7 @@ public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscript Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -595,8 +763,9 @@ public okhttp3.Call createAliasBySubscriptionAsync(String appId, String subscrip return localVarCall; } /** - * Build call for createApp - * @param app (required) + * Build call for createApiKey + * @param appId (required) + * @param createApiKeyRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -605,10 +774,9 @@ public okhttp3.Call createAliasBySubscriptionAsync(String appId, String subscrip Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - */ - public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createApiKeyCall(String appId, CreateApiKeyRequest createApiKeyRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -622,10 +790,11 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A basePath = null; } - Object localVarPostBody = app; + Object localVarPostBody = createApiKeyRequest; // create path and map variables - String localVarPath = "/apps"; + String localVarPath = "/apps/{app_id}/auth/tokens" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -634,7 +803,7 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -657,62 +826,68 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A } @SuppressWarnings("rawtypes") - private okhttp3.Call createAppValidateBeforeCall(App app, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createApiKeyValidateBeforeCall(String appId, CreateApiKeyRequest createApiKeyRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'app' is set - if (app == null) { - throw new ApiException("Missing the required parameter 'app' when calling createApp(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling createApiKey(Async)"); + } + + // verify the required parameter 'createApiKeyRequest' is set + if (createApiKeyRequest == null) { + throw new ApiException("Missing the required parameter 'createApiKeyRequest' when calling createApiKey(Async)"); } - okhttp3.Call localVarCall = createAppCall(app, _callback); + okhttp3.Call localVarCall = createApiKeyCall(appId, createApiKeyRequest, _callback); return localVarCall; } /** - * Create an app - * Creates a new OneSignal app - * @param app (required) - * @return App + * Create API key + * Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + * @param appId (required) + * @param createApiKeyRequest (required) + * @return CreateApiKeyResponse * @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 -
*/ - public App createApp(App app) throws ApiException { - ApiResponse localVarResp = createAppWithHttpInfo(app); + public CreateApiKeyResponse createApiKey(String appId, CreateApiKeyRequest createApiKeyRequest) throws ApiException { + ApiResponse localVarResp = createApiKeyWithHttpInfo(appId, createApiKeyRequest); return localVarResp.getData(); } /** - * Create an app - * Creates a new OneSignal app - * @param app (required) - * @return ApiResponse<App> + * Create API key + * Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + * @param appId (required) + * @param createApiKeyRequest (required) + * @return ApiResponse<CreateApiKeyResponse> * @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 -
*/ - public ApiResponse createAppWithHttpInfo(App app) throws ApiException { - okhttp3.Call localVarCall = createAppValidateBeforeCall(app, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createApiKeyWithHttpInfo(String appId, CreateApiKeyRequest createApiKeyRequest) throws ApiException { + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(appId, createApiKeyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create an app (asynchronously) - * Creates a new OneSignal app - * @param app (required) + * Create API key (asynchronously) + * Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + * @param appId (required) + * @param createApiKeyRequest (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 @@ -721,31 +896,30 @@ public ApiResponse createAppWithHttpInfo(App app) throws ApiException { Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - */ - public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createApiKeyAsync(String appId, CreateApiKeyRequest createApiKeyRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAppValidateBeforeCall(app, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(appId, createApiKeyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNotification - * @param notification (required) + * Build call for createApp + * @param app (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, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createNotificationCall(Notification notification, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -759,10 +933,10 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC basePath = null; } - Object localVarPostBody = notification; + Object localVarPostBody = app; // create path and map variables - String localVarPath = "/notifications"; + String localVarPath = "/apps"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -771,7 +945,7 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -789,102 +963,102 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "rest_api_key" }; + String[] localVarAuthNames = new String[] { "organization_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createNotificationValidateBeforeCall(Notification notification, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createAppValidateBeforeCall(App app, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'notification' is set - if (notification == null) { - throw new ApiException("Missing the required parameter 'notification' when calling createNotification(Async)"); + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException("Missing the required parameter 'app' when calling createApp(Async)"); } - okhttp3.Call localVarCall = createNotificationCall(notification, _callback); + okhttp3.Call localVarCall = createAppCall(app, _callback); return localVarCall; } /** - * Create notification - * Sends notifications to your users - * @param notification (required) - * @return CreateNotificationSuccessResponse + * Create an app + * Creates a new OneSignal app + * @param app (required) + * @return App * @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, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public CreateNotificationSuccessResponse createNotification(Notification notification) throws ApiException { - ApiResponse localVarResp = createNotificationWithHttpInfo(notification); + public App createApp(App app) throws ApiException { + ApiResponse localVarResp = createAppWithHttpInfo(app); return localVarResp.getData(); } /** - * Create notification - * Sends notifications to your users - * @param notification (required) - * @return ApiResponse<CreateNotificationSuccessResponse> + * Create an app + * Creates a new OneSignal app + * @param app (required) + * @return ApiResponse<App> * @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, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public ApiResponse createNotificationWithHttpInfo(Notification notification) throws ApiException { - okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createAppWithHttpInfo(App app) throws ApiException { + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create notification (asynchronously) - * Sends notifications to your users - * @param notification (required) + * Create an app (asynchronously) + * Creates a new OneSignal app + * @param app (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, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createNotificationAsync(Notification notification, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSegment - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segment (optional) + * Build call for createCustomEvents + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param customEventsRequest (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
201 Created -
200 OK -
400 Bad Request -
409 Conflict -
401 Unauthorized -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCustomEventsCall(String appId, CustomEventsRequest customEventsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -898,10 +1072,10 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa basePath = null; } - Object localVarPostBody = segment; + Object localVarPostBody = customEventsRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/segments" + String localVarPath = "/apps/{app_id}/integrations/custom_events" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); @@ -911,7 +1085,7 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -934,107 +1108,106 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa } @SuppressWarnings("rawtypes") - private okhttp3.Call createSegmentValidateBeforeCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createCustomEventsValidateBeforeCall(String appId, CustomEventsRequest customEventsRequest, 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 createSegment(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createCustomEvents(Async)"); + } + + // verify the required parameter 'customEventsRequest' is set + if (customEventsRequest == null) { + throw new ApiException("Missing the required parameter 'customEventsRequest' when calling createCustomEvents(Async)"); } - okhttp3.Call localVarCall = createSegmentCall(appId, segment, _callback); + okhttp3.Call localVarCall = createCustomEventsCall(appId, customEventsRequest, _callback); return localVarCall; } /** - * Create Segment - * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segment (optional) - * @return CreateSegmentSuccessResponse + * Create custom events + * The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param customEventsRequest (required) + * @return Object * @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
201 Created -
200 OK -
400 Bad Request -
409 Conflict -
401 Unauthorized -
429 Rate Limit Exceeded -
*/ - public CreateSegmentSuccessResponse createSegment(String appId, Segment segment) throws ApiException { - ApiResponse localVarResp = createSegmentWithHttpInfo(appId, segment); + public Object createCustomEvents(String appId, CustomEventsRequest customEventsRequest) throws ApiException { + ApiResponse localVarResp = createCustomEventsWithHttpInfo(appId, customEventsRequest); return localVarResp.getData(); } /** - * Create Segment - * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segment (optional) - * @return ApiResponse<CreateSegmentSuccessResponse> + * Create custom events + * The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param customEventsRequest (required) + * @return ApiResponse<Object> * @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
201 Created -
200 OK -
400 Bad Request -
409 Conflict -
401 Unauthorized -
429 Rate Limit Exceeded -
*/ - public ApiResponse createSegmentWithHttpInfo(String appId, Segment segment) throws ApiException { - okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createCustomEventsWithHttpInfo(String appId, CustomEventsRequest customEventsRequest) throws ApiException { + okhttp3.Call localVarCall = createCustomEventsValidateBeforeCall(appId, customEventsRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Segment (asynchronously) - * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segment (optional) + * Create custom events (asynchronously) + * The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param customEventsRequest (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
201 Created -
200 OK -
400 Bad Request -
409 Conflict -
401 Unauthorized -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createSegmentAsync(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCustomEventsAsync(String appId, CustomEventsRequest customEventsRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createCustomEventsValidateBeforeCall(appId, customEventsRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSubscription - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param subscriptionBody (required) + * Build call for createNotification + * @param notification (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
201 CREATED -
202 ACCEPTED -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createNotificationCall(Notification notification, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1048,13 +1221,10 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri basePath = null; } - Object localVarPostBody = subscriptionBody; + Object localVarPostBody = notification; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + String localVarPath = "/notifications"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1063,7 +1233,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1086,132 +1256,97 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri } @SuppressWarnings("rawtypes") - private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, 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 createSubscription(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling createSubscription(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling createSubscription(Async)"); - } + private okhttp3.Call createNotificationValidateBeforeCall(Notification notification, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'subscriptionBody' is set - if (subscriptionBody == null) { - throw new ApiException("Missing the required parameter 'subscriptionBody' when calling createSubscription(Async)"); + // verify the required parameter 'notification' is set + if (notification == null) { + throw new ApiException("Missing the required parameter 'notification' when calling createNotification(Async)"); } - okhttp3.Call localVarCall = createSubscriptionCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); + okhttp3.Call localVarCall = createNotificationCall(notification, _callback); return localVarCall; } /** - * - * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param subscriptionBody (required) - * @return SubscriptionBody + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return CreateNotificationSuccessResponse * @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
201 CREATED -
202 ACCEPTED -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public SubscriptionBody createSubscription(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { - ApiResponse localVarResp = createSubscriptionWithHttpInfo(appId, aliasLabel, aliasId, subscriptionBody); + public CreateNotificationSuccessResponse createNotification(Notification notification) throws ApiException { + ApiResponse localVarResp = createNotificationWithHttpInfo(notification); return localVarResp.getData(); } /** - * - * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param subscriptionBody (required) - * @return ApiResponse<SubscriptionBody> + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return ApiResponse<CreateNotificationSuccessResponse> * @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
201 CREATED -
202 ACCEPTED -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public ApiResponse createSubscriptionWithHttpInfo(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { - okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createNotificationWithHttpInfo(Notification notification) throws ApiException { + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param subscriptionBody (required) + * Create notification (asynchronously) + * Sends notifications to your users + * @param notification (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
201 CREATED -
202 ACCEPTED -
200 OK, invalid_aliases, or No Subscribed Players If a message was successfully created, you will get a 200 response and an id for the notification. If the 200 response contains \"invalid_aliases\" this will mark devices that exist in the provided app_id but are no longer subscribed. If no id is returned, then a message was not created and the targeted User IDs do not exist under the provided app_id. Any User IDs sent in the request that do not exist under the specified app_id will be ignored. -
400 Bad Request -
404 Not Found -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createSubscriptionAsync(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createNotificationAsync(Notification notification, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createUser - * @param appId (required) - * @param user (required) + * Build call for createSegment + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segment (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 CREATED -
201 CREATED -
202 ACCEPTED -
201 Created -
400 Bad Request -
409 Multiple User Identity Conflict -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1225,10 +1360,10 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c basePath = null; } - Object localVarPostBody = user; + Object localVarPostBody = segment; // create path and map variables - String localVarPath = "/apps/{app_id}/users" + String localVarPath = "/apps/{app_id}/segments" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); @@ -1238,7 +1373,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1261,117 +1396,107 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c } @SuppressWarnings("rawtypes") - private okhttp3.Call createUserValidateBeforeCall(String appId, User user, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createSegmentValidateBeforeCall(String appId, Segment segment, 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 createUser(Async)"); - } - - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createSegment(Async)"); } - okhttp3.Call localVarCall = createUserCall(appId, user, _callback); + okhttp3.Call localVarCall = createSegmentCall(appId, segment, _callback); return localVarCall; } /** - * - * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. - * @param appId (required) - * @param user (required) - * @return User + * Create Segment + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segment (optional) + * @return CreateSegmentSuccessResponse * @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 CREATED -
201 CREATED -
202 ACCEPTED -
201 Created -
400 Bad Request -
409 Multiple User Identity Conflict -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public User createUser(String appId, User user) throws ApiException { - ApiResponse localVarResp = createUserWithHttpInfo(appId, user); + public CreateSegmentSuccessResponse createSegment(String appId, Segment segment) throws ApiException { + ApiResponse localVarResp = createSegmentWithHttpInfo(appId, segment); return localVarResp.getData(); } /** - * - * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. - * @param appId (required) - * @param user (required) - * @return ApiResponse<User> + * Create Segment + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segment (optional) + * @return ApiResponse<CreateSegmentSuccessResponse> * @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 CREATED -
201 CREATED -
202 ACCEPTED -
201 Created -
400 Bad Request -
409 Multiple User Identity Conflict -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse createUserWithHttpInfo(String appId, User user) throws ApiException { - okhttp3.Call localVarCall = createUserValidateBeforeCall(appId, user, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createSegmentWithHttpInfo(String appId, Segment segment) throws ApiException { + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. - * @param appId (required) - * @param user (required) + * Create Segment (asynchronously) + * Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segment (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 CREATED -
201 CREATED -
202 ACCEPTED -
201 Created -
400 Bad Request -
409 Multiple User Identity Conflict -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call createUserAsync(String appId, User user, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSegmentAsync(String appId, Segment segment, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUserValidateBeforeCall(appId, user, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createSegmentValidateBeforeCall(appId, segment, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteAlias + * Build call for createSubscription * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param aliasLabelToDelete (required) + * @param subscriptionBody (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 -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1385,14 +1510,13 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = subscriptionBody; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}" + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())) - .replaceAll("\\{" + "alias_label_to_delete" + "\\}", localVarApiClient.escapeString(aliasLabelToDelete.toString())); + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1401,7 +1525,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1412,7 +1536,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1420,118 +1544,120 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAliasValidateBeforeCall(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createSubscriptionValidateBeforeCall(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, 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 deleteAlias(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createSubscription(Async)"); } // verify the required parameter 'aliasLabel' is set if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling deleteAlias(Async)"); + throw new ApiException("Missing the required parameter 'aliasLabel' when calling createSubscription(Async)"); } // verify the required parameter 'aliasId' is set if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling deleteAlias(Async)"); + throw new ApiException("Missing the required parameter 'aliasId' when calling createSubscription(Async)"); } - // verify the required parameter 'aliasLabelToDelete' is set - if (aliasLabelToDelete == null) { - throw new ApiException("Missing the required parameter 'aliasLabelToDelete' when calling deleteAlias(Async)"); + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling createSubscription(Async)"); } - okhttp3.Call localVarCall = deleteAliasCall(appId, aliasLabel, aliasId, aliasLabelToDelete, _callback); + okhttp3.Call localVarCall = createSubscriptionCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); return localVarCall; } /** * - * Deletes an alias by alias label + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param aliasLabelToDelete (required) - * @return UserIdentityBody + * @param subscriptionBody (required) + * @return SubscriptionBody * @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 -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public UserIdentityBody deleteAlias(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { - ApiResponse localVarResp = deleteAliasWithHttpInfo(appId, aliasLabel, aliasId, aliasLabelToDelete); + public SubscriptionBody createSubscription(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { + ApiResponse localVarResp = createSubscriptionWithHttpInfo(appId, aliasLabel, aliasId, subscriptionBody); return localVarResp.getData(); } /** * - * Deletes an alias by alias label + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param aliasLabelToDelete (required) - * @return ApiResponse<UserIdentityBody> + * @param subscriptionBody (required) + * @return ApiResponse<SubscriptionBody> * @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 -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public ApiResponse deleteAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { - okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createSubscriptionWithHttpInfo(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Deletes an alias by alias label + * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @param aliasLabelToDelete (required) + * @param subscriptionBody (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 -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Operation is not permitted due to user having the maximum number of subscriptions assigned -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call deleteAliasAsync(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSubscriptionAsync(String appId, String aliasLabel, String aliasId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(appId, aliasLabel, aliasId, subscriptionBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteSegment - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) + * Build call for createTemplate + * @param createTemplateRequest (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1540,11 +1666,10 @@ public okhttp3.Call deleteAliasAsync(String appId, String aliasLabel, String ali Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 429 Rate Limit Exceeded - + 422 Unprocessable Entity - */ - public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createTemplateCall(CreateTemplateRequest createTemplateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1558,12 +1683,10 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createTemplateRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/segments/{segment_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); + String localVarPath = "/templates"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1572,7 +1695,7 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1583,7 +1706,7 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1591,76 +1714,66 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSegmentValidateBeforeCall(String appId, String segmentId, 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 deleteSegment(Async)"); - } + private okhttp3.Call createTemplateValidateBeforeCall(CreateTemplateRequest createTemplateRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'segmentId' is set - if (segmentId == null) { - throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegment(Async)"); + // verify the required parameter 'createTemplateRequest' is set + if (createTemplateRequest == null) { + throw new ApiException("Missing the required parameter 'createTemplateRequest' when calling createTemplate(Async)"); } - okhttp3.Call localVarCall = deleteSegmentCall(appId, segmentId, _callback); + okhttp3.Call localVarCall = createTemplateCall(createTemplateRequest, _callback); return localVarCall; } /** - * Delete Segment - * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * @return GenericSuccessBoolResponse + * Create template + * Create reusable message templates for push, email, and SMS channels. + * @param createTemplateRequest (required) + * @return TemplateResource * @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 -
422 Unprocessable Entity -
*/ - public GenericSuccessBoolResponse deleteSegment(String appId, String segmentId) throws ApiException { - ApiResponse localVarResp = deleteSegmentWithHttpInfo(appId, segmentId); + public TemplateResource createTemplate(CreateTemplateRequest createTemplateRequest) throws ApiException { + ApiResponse localVarResp = createTemplateWithHttpInfo(createTemplateRequest); return localVarResp.getData(); } /** - * Delete Segment - * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * @return ApiResponse<GenericSuccessBoolResponse> + * Create template + * Create reusable message templates for push, email, and SMS channels. + * @param createTemplateRequest (required) + * @return ApiResponse<TemplateResource> * @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 -
422 Unprocessable Entity -
*/ - public ApiResponse deleteSegmentWithHttpInfo(String appId, String segmentId) throws ApiException { - okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createTemplateWithHttpInfo(CreateTemplateRequest createTemplateRequest) throws ApiException { + okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Segment (asynchronously) - * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) + * Create template (asynchronously) + * Create reusable message templates for push, email, and SMS channels. + * @param createTemplateRequest (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 @@ -1669,35 +1782,35 @@ public ApiResponse deleteSegmentWithHttpInfo(String Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 429 Rate Limit Exceeded - + 422 Unprocessable Entity - */ - public okhttp3.Call deleteSegmentAsync(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createTemplateAsync(CreateTemplateRequest createTemplateRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteSubscription + * Build call for createUser * @param appId (required) - * @param subscriptionId (required) + * @param user (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 CREATED -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Multiple User Identity Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1711,12 +1824,11 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = user; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + String localVarPath = "/apps/{app_id}/users" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1725,7 +1837,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1736,7 +1848,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1744,99 +1856,107 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSubscriptionValidateBeforeCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createUserValidateBeforeCall(String appId, User user, 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 deleteSubscription(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling createUser(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling deleteSubscription(Async)"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - okhttp3.Call localVarCall = deleteSubscriptionCall(appId, subscriptionId, _callback); + okhttp3.Call localVarCall = createUserCall(appId, user, _callback); return localVarCall; } /** * - * Deletes the Subscription. + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. * @param appId (required) - * @param subscriptionId (required) + * @param user (required) + * @return User * @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 CREATED -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Multiple User Identity Conflict -
429 Rate Limit Exceeded -
*/ - public void deleteSubscription(String appId, String subscriptionId) throws ApiException { - deleteSubscriptionWithHttpInfo(appId, subscriptionId); + public User createUser(String appId, User user) throws ApiException { + ApiResponse localVarResp = createUserWithHttpInfo(appId, user); + return localVarResp.getData(); } /** * - * Deletes the Subscription. + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. * @param appId (required) - * @param subscriptionId (required) - * @return ApiResponse<Void> + * @param user (required) + * @return ApiResponse<User> * @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 CREATED -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Multiple User Identity Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse deleteSubscriptionWithHttpInfo(String appId, String subscriptionId) throws ApiException { - okhttp3.Call localVarCall = deleteSubscriptionValidateBeforeCall(appId, subscriptionId, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse createUserWithHttpInfo(String appId, User user) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(appId, user, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Deletes the Subscription. + * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. * @param appId (required) - * @param subscriptionId (required) + * @param user (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 CREATED -
201 CREATED -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
409 Multiple User Identity Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call deleteSubscriptionAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUserAsync(String appId, User user, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteSubscriptionValidateBeforeCall(appId, subscriptionId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = createUserValidateBeforeCall(appId, user, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteUser + * Build call for deleteAlias * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) + * @param aliasLabelToDelete (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1845,11 +1965,12 @@ public okhttp3.Call deleteSubscriptionAsync(String appId, String subscriptionId, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1866,10 +1987,11 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())) + .replaceAll("\\{" + "alias_label_to_delete" + "\\}", localVarApiClient.escapeString(aliasLabelToDelete.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1878,7 +2000,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -1901,77 +2023,90 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteAliasValidateBeforeCall(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, 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 deleteUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteAlias(Async)"); } // verify the required parameter 'aliasLabel' is set if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling deleteUser(Async)"); + throw new ApiException("Missing the required parameter 'aliasLabel' when calling deleteAlias(Async)"); } // verify the required parameter 'aliasId' is set if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling deleteUser(Async)"); + throw new ApiException("Missing the required parameter 'aliasId' when calling deleteAlias(Async)"); + } + + // verify the required parameter 'aliasLabelToDelete' is set + if (aliasLabelToDelete == null) { + throw new ApiException("Missing the required parameter 'aliasLabelToDelete' when calling deleteAlias(Async)"); } - okhttp3.Call localVarCall = deleteUserCall(appId, aliasLabel, aliasId, _callback); + okhttp3.Call localVarCall = deleteAliasCall(appId, aliasLabel, aliasId, aliasLabelToDelete, _callback); return localVarCall; } /** * - * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * Deletes an alias by alias label * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) + * @param aliasLabelToDelete (required) + * @return UserIdentityBody * @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 -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public void deleteUser(String appId, String aliasLabel, String aliasId) throws ApiException { - deleteUserWithHttpInfo(appId, aliasLabel, aliasId); + public UserIdentityBody deleteAlias(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { + ApiResponse localVarResp = deleteAliasWithHttpInfo(appId, aliasLabel, aliasId, aliasLabelToDelete); + return localVarResp.getData(); } /** * - * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * Deletes an alias by alias label * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) - * @return ApiResponse<Void> + * @param aliasLabelToDelete (required) + * @return ApiResponse<UserIdentityBody> * @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 -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse deleteUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { - okhttp3.Call localVarCall = deleteUserValidateBeforeCall(appId, aliasLabel, aliasId, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse deleteAliasWithHttpInfo(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete) throws ApiException { + okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * Deletes an alias by alias label * @param appId (required) * @param aliasLabel (required) * @param aliasId (required) + * @param aliasLabelToDelete (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 @@ -1980,20 +2115,22 @@ public ApiResponse deleteUserWithHttpInfo(String appId, String aliasLabel, Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call deleteUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAliasAsync(String appId, String aliasLabel, String aliasId, String aliasLabelToDelete, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(appId, aliasLabel, aliasId, aliasLabelToDelete, _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) - * @param appId The ID of the app that the notification belongs to. (required) + * Build call for deleteApiKey + * @param appId (required) + * @param tokenId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2002,11 +2139,9 @@ public okhttp3.Call deleteUserAsync(String appId, String aliasLabel, String alia Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportEventsCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteApiKeyCall(String appId, String tokenId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2023,8 +2158,9 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/notifications/{notification_id}/export_events?app_id={app_id}" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/apps/{app_id}/auth/tokens/{token_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "token_id" + "\\}", localVarApiClient.escapeString(tokenId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2033,11 +2169,7 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2055,77 +2187,73 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final 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); - } + String[] localVarAuthNames = new String[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } @SuppressWarnings("rawtypes") - private okhttp3.Call exportEventsValidateBeforeCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling exportEvents(Async)"); - } + private okhttp3.Call deleteApiKeyValidateBeforeCall(String appId, String tokenId, 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 exportEvents(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteApiKey(Async)"); + } + + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + throw new ApiException("Missing the required parameter 'tokenId' when calling deleteApiKey(Async)"); } - okhttp3.Call localVarCall = exportEventsCall(notificationId, appId, _callback); + okhttp3.Call localVarCall = deleteApiKeyCall(appId, tokenId, _callback); return localVarCall; } /** - * Export CSV of Events - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) - * @return ExportEventsSuccessResponse + * Delete API key + * Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + * @param appId (required) + * @param tokenId (required) + * @return Object * @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 -
*/ - public ExportEventsSuccessResponse exportEvents(String notificationId, String appId) throws ApiException { - ApiResponse localVarResp = exportEventsWithHttpInfo(notificationId, appId); + public Object deleteApiKey(String appId, String tokenId) throws ApiException { + ApiResponse localVarResp = deleteApiKeyWithHttpInfo(appId, tokenId); return localVarResp.getData(); } /** - * Export CSV of Events - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) - * @return ApiResponse<ExportEventsSuccessResponse> + * Delete API key + * Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + * @param appId (required) + * @param tokenId (required) + * @return ApiResponse<Object> * @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 -
*/ - public ApiResponse exportEventsWithHttpInfo(String notificationId, String appId) throws ApiException { - okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse deleteApiKeyWithHttpInfo(String appId, String tokenId) throws ApiException { + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(appId, tokenId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Export CSV of Events (asynchronously) - * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. - * @param notificationId The ID of the notification to export events from. (required) - * @param appId The ID of the app that the notification belongs to. (required) + * Delete API key (asynchronously) + * Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + * @param appId (required) + * @param tokenId (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 @@ -2134,21 +2262,19 @@ public ApiResponse exportEventsWithHttpInfo(String Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportEventsAsync(String notificationId, String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteApiKeyAsync(String appId, String tokenId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(appId, tokenId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for exportSubscriptions - * @param appId The app ID that you want to export devices from (required) - * @param exportSubscriptionsRequestBody (optional) + * Build call for deleteSegment + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2157,10 +2283,11 @@ public okhttp3.Call exportEventsAsync(String notificationId, String appId, final Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2174,11 +2301,12 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq basePath = null; } - Object localVarPostBody = exportSubscriptionsRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/players/csv_export?app_id={app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/segments/{segment_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2187,7 +2315,7 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2198,7 +2326,7 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2206,69 +2334,76 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call exportSubscriptionsValidateBeforeCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteSegmentValidateBeforeCall(String appId, String segmentId, 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 exportSubscriptions(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteSegment(Async)"); + } + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegment(Async)"); } - okhttp3.Call localVarCall = exportSubscriptionsCall(appId, exportSubscriptionsRequestBody, _callback); + okhttp3.Call localVarCall = deleteSegmentCall(appId, segmentId, _callback); return localVarCall; } /** - * Export CSV of Subscriptions - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportSubscriptionsRequestBody (optional) - * @return ExportSubscriptionsSuccessResponse + * Delete Segment + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) + * @return GenericSuccessBoolResponse * @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 -
*/ - public ExportSubscriptionsSuccessResponse exportSubscriptions(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { - ApiResponse localVarResp = exportSubscriptionsWithHttpInfo(appId, exportSubscriptionsRequestBody); + public GenericSuccessBoolResponse deleteSegment(String appId, String segmentId) throws ApiException { + ApiResponse localVarResp = deleteSegmentWithHttpInfo(appId, segmentId); return localVarResp.getData(); } /** - * Export CSV of Subscriptions - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportSubscriptionsRequestBody (optional) - * @return ApiResponse<ExportSubscriptionsSuccessResponse> + * Delete Segment + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) + * @return ApiResponse<GenericSuccessBoolResponse> * @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 -
*/ - public ApiResponse exportSubscriptionsWithHttpInfo(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { - okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse deleteSegmentWithHttpInfo(String appId, String segmentId) throws ApiException { + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Export CSV of Subscriptions (asynchronously) - * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - * @param appId The app ID that you want to export devices from (required) - * @param exportSubscriptionsRequestBody (optional) + * Delete Segment (asynchronously) + * Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. (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 @@ -2277,34 +2412,35 @@ public ApiResponse exportSubscriptionsWithHt Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call exportSubscriptionsAsync(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSegmentAsync(String appId, String segmentId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = deleteSegmentValidateBeforeCall(appId, segmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAliases + * Build call for deleteSubscription * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * @param subscriptionId (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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2321,10 +2457,9 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2333,7 +2468,7 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2352,107 +2487,98 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAliasesValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteSubscriptionValidateBeforeCall(String appId, String subscriptionId, 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 getAliases(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling getAliases(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteSubscription(Async)"); } - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling getAliases(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling deleteSubscription(Async)"); } - okhttp3.Call localVarCall = getAliasesCall(appId, aliasLabel, aliasId, _callback); + okhttp3.Call localVarCall = deleteSubscriptionCall(appId, subscriptionId, _callback); return localVarCall; } /** * - * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * Deletes the Subscription. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return UserIdentityBody + * @param subscriptionId (required) * @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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public UserIdentityBody getAliases(String appId, String aliasLabel, String aliasId) throws ApiException { - ApiResponse localVarResp = getAliasesWithHttpInfo(appId, aliasLabel, aliasId); - return localVarResp.getData(); + public void deleteSubscription(String appId, String subscriptionId) throws ApiException { + deleteSubscriptionWithHttpInfo(appId, subscriptionId); } /** * - * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * Deletes the Subscription. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return ApiResponse<UserIdentityBody> + * @param subscriptionId (required) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + +
Status Code Description Response Headers
200 OK -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse getAliasesWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { - okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse deleteSubscriptionWithHttpInfo(String appId, String subscriptionId) throws ApiException { + okhttp3.Call localVarCall = deleteSubscriptionValidateBeforeCall(appId, subscriptionId, null); + return localVarApiClient.execute(localVarCall); } /** * (asynchronously) - * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * Deletes the Subscription. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * @param subscriptionId (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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call getAliasesAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSubscriptionAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = deleteSubscriptionValidateBeforeCall(appId, subscriptionId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAliasesBySubscription + * Build call for deleteTemplate + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2464,7 +2590,7 @@ public okhttp3.Call getAliasesAsync(String appId, String aliasLabel, String alia 404 Not Found - */ - public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTemplateCall(String templateId, String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2481,9 +2607,8 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + String localVarPath = "/templates/{template_id}" + .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2492,7 +2617,11 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -2511,34 +2640,34 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAliasesBySubscriptionValidateBeforeCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteTemplateValidateBeforeCall(String templateId, String appId, 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 getAliasesBySubscription(Async)"); + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException("Missing the required parameter 'templateId' when calling deleteTemplate(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling getAliasesBySubscription(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling deleteTemplate(Async)"); } - okhttp3.Call localVarCall = getAliasesBySubscriptionCall(appId, subscriptionId, _callback); + okhttp3.Call localVarCall = deleteTemplateCall(templateId, appId, _callback); return localVarCall; } /** - * - * Lists all Aliases for the User identified by :subscription_id. + * Delete template + * Delete a template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @return UserIdentityBody + * @return GenericSuccessBoolResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2548,17 +2677,17 @@ private okhttp3.Call getAliasesBySubscriptionValidateBeforeCall(String appId, St
404 Not Found -
*/ - public UserIdentityBody getAliasesBySubscription(String appId, String subscriptionId) throws ApiException { - ApiResponse localVarResp = getAliasesBySubscriptionWithHttpInfo(appId, subscriptionId); + public GenericSuccessBoolResponse deleteTemplate(String templateId, String appId) throws ApiException { + ApiResponse localVarResp = deleteTemplateWithHttpInfo(templateId, appId); return localVarResp.getData(); } /** - * - * Lists all Aliases for the User identified by :subscription_id. + * Delete template + * Delete a template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @return ApiResponse<UserIdentityBody> + * @return ApiResponse<GenericSuccessBoolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2568,17 +2697,17 @@ public UserIdentityBody getAliasesBySubscription(String appId, String subscripti
404 Not Found -
*/ - public ApiResponse getAliasesBySubscriptionWithHttpInfo(String appId, String subscriptionId) throws ApiException { - okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse deleteTemplateWithHttpInfo(String templateId, String appId) throws ApiException { + okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Lists all Aliases for the User identified by :subscription_id. + * Delete template (asynchronously) + * Delete a template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (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 @@ -2590,16 +2719,18 @@ public ApiResponse getAliasesBySubscriptionWithHttpInfo(String 404 Not Found - */ - public okhttp3.Call getAliasesBySubscriptionAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTemplateAsync(String templateId, String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getApp - * @param appId An app id (required) + * Build call for deleteUser + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2608,10 +2739,11 @@ public okhttp3.Call getAliasesBySubscriptionAsync(String appId, String subscript Status Code Description Response Headers 200 OK - 400 Bad Request - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2628,8 +2760,10 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2638,7 +2772,7 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2656,67 +2790,82 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "organization_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAppValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, 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 getApp(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling deleteUser(Async)"); + } + + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling deleteUser(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling deleteUser(Async)"); } - okhttp3.Call localVarCall = getAppCall(appId, _callback); + okhttp3.Call localVarCall = deleteUserCall(appId, aliasLabel, aliasId, _callback); return localVarCall; } /** - * View an app - * View the details of a single OneSignal app - * @param appId An app id (required) - * @return App + * + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) * @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 -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public App getApp(String appId) throws ApiException { - ApiResponse localVarResp = getAppWithHttpInfo(appId); - return localVarResp.getData(); + public void deleteUser(String appId, String aliasLabel, String aliasId) throws ApiException { + deleteUserWithHttpInfo(appId, aliasLabel, aliasId); } /** - * View an app - * View the details of a single OneSignal app - * @param appId An app id (required) - * @return ApiResponse<App> + * + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details +
Status Code Description Response Headers
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse getAppWithHttpInfo(String appId) throws ApiException { - okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse deleteUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(appId, aliasLabel, aliasId, null); + return localVarApiClient.execute(localVarCall); } /** - * View an app (asynchronously) - * View the details of a single OneSignal app - * @param appId An app id (required) + * (asynchronously) + * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (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 @@ -2725,18 +2874,20 @@ public ApiResponse getAppWithHttpInfo(String appId) throws ApiException { Status Code Description Response Headers 200 OK - 400 Bad Request - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call getAppAsync(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getApps + * Build call for exportEvents + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2745,10 +2896,11 @@ public okhttp3.Call getAppAsync(String appId, final ApiCallback _callback) Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportEventsCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2765,7 +2917,8 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps"; + String localVarPath = "/notifications/{notification_id}/export_events?app_id={app_id}" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2774,7 +2927,11 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -2792,59 +2949,77 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "organization_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + 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 getAppsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + private okhttp3.Call exportEventsValidateBeforeCall(String notificationId, String appId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling exportEvents(Async)"); + } + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling exportEvents(Async)"); + } - okhttp3.Call localVarCall = getAppsCall(_callback); + okhttp3.Call localVarCall = exportEventsCall(notificationId, appId, _callback); return localVarCall; } /** - * View apps - * View the details of all of your current OneSignal apps - * @return List<App> + * Export CSV of Events + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) + * @return ExportEventsSuccessResponse * @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 -
*/ - public List getApps() throws ApiException { - ApiResponse> localVarResp = getAppsWithHttpInfo(); + public ExportEventsSuccessResponse exportEvents(String notificationId, String appId) throws ApiException { + ApiResponse localVarResp = exportEventsWithHttpInfo(notificationId, appId); return localVarResp.getData(); } /** - * View apps - * View the details of all of your current OneSignal apps - * @return ApiResponse<List<App>> + * Export CSV of Events + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (required) + * @return ApiResponse<ExportEventsSuccessResponse> * @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 -
*/ - public ApiResponse> getAppsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getAppsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); + public ApiResponse exportEventsWithHttpInfo(String notificationId, String appId) throws ApiException { + okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View apps (asynchronously) - * View the details of all of your current OneSignal apps + * Export CSV of Events (asynchronously) + * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. + * @param notificationId The ID of the notification to export events from. (required) + * @param appId The ID of the app that the notification belongs to. (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 @@ -2853,20 +3028,21 @@ public ApiResponse> getAppsWithHttpInfo() throws ApiException { Status Code Description Response Headers 200 OK - 400 Bad Request - + 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws ApiException { + public okhttp3.Call exportEventsAsync(String notificationId, String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAppsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + okhttp3.Call localVarCall = exportEventsValidateBeforeCall(notificationId, appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNotification - * @param appId (required) - * @param notificationId (required) + * Build call for exportSubscriptions + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2875,11 +3051,10 @@ public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2893,11 +3068,11 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = exportSubscriptionsRequestBody; // create path and map variables - String localVarPath = "/notifications/{notification_id}" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/players/csv_export?app_id={app_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2906,11 +3081,7 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); - - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -2921,7 +3092,7 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2929,76 +3100,69 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationValidateBeforeCall(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call exportSubscriptionsValidateBeforeCall(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, 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 getNotification(Async)"); - } - - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling getNotification(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling exportSubscriptions(Async)"); } - okhttp3.Call localVarCall = getNotificationCall(appId, notificationId, _callback); + okhttp3.Call localVarCall = exportSubscriptionsCall(appId, exportSubscriptionsRequestBody, _callback); return localVarCall; } /** - * View notification - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) - * @return NotificationWithMeta + * Export CSV of Subscriptions + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) + * @return ExportSubscriptionsSuccessResponse * @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 -
*/ - public NotificationWithMeta getNotification(String appId, String notificationId) throws ApiException { - ApiResponse localVarResp = getNotificationWithHttpInfo(appId, notificationId); + public ExportSubscriptionsSuccessResponse exportSubscriptions(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { + ApiResponse localVarResp = exportSubscriptionsWithHttpInfo(appId, exportSubscriptionsRequestBody); return localVarResp.getData(); } /** - * View notification - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) - * @return ApiResponse<NotificationWithMeta> + * Export CSV of Subscriptions + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (optional) + * @return ApiResponse<ExportSubscriptionsSuccessResponse> * @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 -
*/ - public ApiResponse getNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { - okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse exportSubscriptionsWithHttpInfo(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody) throws ApiException { + okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View notification (asynchronously) - * View the details of a single notification and outcomes associated with it - * @param appId (required) - * @param notificationId (required) + * Export CSV of Subscriptions (asynchronously) + * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + * @param appId The app ID that you want to export devices from (required) + * @param exportSubscriptionsRequestBody (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 @@ -3007,21 +3171,21 @@ public ApiResponse getNotificationWithHttpInfo(String appI Status Code Description Response Headers 200 OK - 400 Bad Request - - 404 Not Found - 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call exportSubscriptionsAsync(String appId, ExportSubscriptionsRequestBody exportSubscriptionsRequestBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = exportSubscriptionsValidateBeforeCall(appId, exportSubscriptionsRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNotificationHistory - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationHistoryRequestBody (required) + * Build call for getAliases + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3034,7 +3198,7 @@ public okhttp3.Call getNotificationAsync(String appId, String notificationId, fi 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3048,11 +3212,13 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific basePath = null; } - Object localVarPostBody = getNotificationHistoryRequestBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/notifications/{notification_id}/history" - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3061,7 +3227,7 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3072,7 +3238,7 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -3080,34 +3246,40 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationHistoryValidateBeforeCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAliasesValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling getNotificationHistory(Async)"); - } + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getAliases(Async)"); + } - // verify the required parameter 'getNotificationHistoryRequestBody' is set - if (getNotificationHistoryRequestBody == null) { - throw new ApiException("Missing the required parameter 'getNotificationHistoryRequestBody' when calling getNotificationHistory(Async)"); + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling getAliases(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling getAliases(Async)"); } - okhttp3.Call localVarCall = getNotificationHistoryCall(notificationId, getNotificationHistoryRequestBody, _callback); + okhttp3.Call localVarCall = getAliasesCall(appId, aliasLabel, aliasId, _callback); return localVarCall; } /** - * Notification History - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationHistoryRequestBody (required) - * @return NotificationHistorySuccessResponse + * + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return UserIdentityBody * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3118,17 +3290,18 @@ private okhttp3.Call getNotificationHistoryValidateBeforeCall(String notificatio
429 Rate Limit Exceeded -
*/ - public NotificationHistorySuccessResponse getNotificationHistory(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { - ApiResponse localVarResp = getNotificationHistoryWithHttpInfo(notificationId, getNotificationHistoryRequestBody); + public UserIdentityBody getAliases(String appId, String aliasLabel, String aliasId) throws ApiException { + ApiResponse localVarResp = getAliasesWithHttpInfo(appId, aliasLabel, aliasId); return localVarResp.getData(); } /** - * Notification History - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationHistoryRequestBody (required) - * @return ApiResponse<NotificationHistorySuccessResponse> + * + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return ApiResponse<UserIdentityBody> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3139,17 +3312,18 @@ public NotificationHistorySuccessResponse getNotificationHistory(String notifica
429 Rate Limit Exceeded -
*/ - public ApiResponse getNotificationHistoryWithHttpInfo(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { - okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getAliasesWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { + okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Notification History (asynchronously) - * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. - * @param notificationId The \"id\" of the message found in the Notification object (required) - * @param getNotificationHistoryRequestBody (required) + * (asynchronously) + * Lists all Aliases for the User identified by (:alias_label, :alias_id). + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (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 @@ -3162,19 +3336,17 @@ public ApiResponse getNotificationHistoryWit 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationHistoryAsync(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getAliasesValidateBeforeCall(appId, aliasLabel, aliasId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNotifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * Build call for getAliasesBySubscription + * @param appId (required) + * @param subscriptionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3183,10 +3355,10 @@ public okhttp3.Call getNotificationHistoryAsync(String notificationId, GetNotifi Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - + 404 Not Found - */ - public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3203,7 +3375,9 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of Object localVarPostBody = null; // create path and map variables - String localVarPath = "/notifications"; + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3212,24 +3386,154 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); - if (appId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); } - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); } - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + 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 getAliasesBySubscriptionValidateBeforeCall(String appId, String subscriptionId, 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 getAliasesBySubscription(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling getAliasesBySubscription(Async)"); } + - if (kind != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("kind", kind)); + okhttp3.Call localVarCall = getAliasesBySubscriptionCall(appId, subscriptionId, _callback); + return localVarCall; + + } + + /** + * + * Lists all Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (required) + * @return UserIdentityBody + * @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 -
+ */ + public UserIdentityBody getAliasesBySubscription(String appId, String subscriptionId) throws ApiException { + ApiResponse localVarResp = getAliasesBySubscriptionWithHttpInfo(appId, subscriptionId); + return localVarResp.getData(); + } + + /** + * + * Lists all Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (required) + * @return ApiResponse<UserIdentityBody> + * @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 -
+ */ + public ApiResponse getAliasesBySubscriptionWithHttpInfo(String appId, String subscriptionId) throws ApiException { + okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists all Aliases for the User identified by :subscription_id. + * @param appId (required) + * @param subscriptionId (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 -
+ */ + public okhttp3.Call getAliasesBySubscriptionAsync(String appId, String subscriptionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAliasesBySubscriptionValidateBeforeCall(appId, subscriptionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getApp + * @param appId An app id (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 -
+ */ + public okhttp3.Call getAppCall(String appId, 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}" + .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.3.0-beta1"); + final String[] localVarAccepts = { "application/json" }; @@ -3246,32 +3550,29 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "rest_api_key" }; + String[] localVarAuthNames = new String[] { "organization_api_key" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getNotificationsValidateBeforeCall(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAppValidateBeforeCall(String appId, 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 getNotifications(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling getApp(Async)"); } - okhttp3.Call localVarCall = getNotificationsCall(appId, limit, offset, kind, _callback); + okhttp3.Call localVarCall = getAppCall(appId, _callback); return localVarCall; } /** - * View notifications - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - * @return NotificationSlice + * View an app + * View the details of a single OneSignal app + * @param appId An app id (required) + * @return App * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3281,41 +3582,1914 @@ private okhttp3.Call getNotificationsValidateBeforeCall(String appId, Integer li
429 Rate Limit Exceeded -
*/ - public NotificationSlice getNotifications(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { - ApiResponse localVarResp = getNotificationsWithHttpInfo(appId, limit, offset, kind); + public App getApp(String appId) throws ApiException { + ApiResponse localVarResp = getAppWithHttpInfo(appId); return localVarResp.getData(); } /** - * View notifications - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) - * @return ApiResponse<NotificationSlice> + * View an app + * View the details of a single OneSignal app + * @param appId An app id (required) + * @return ApiResponse<App> + * @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 -
+ */ + public ApiResponse getAppWithHttpInfo(String appId) throws ApiException { + okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View an app (asynchronously) + * View the details of a single OneSignal app + * @param appId An app id (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 -
+ */ + public okhttp3.Call getAppAsync(String appId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAppValidateBeforeCall(appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getApps + * @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 -
+ */ + public okhttp3.Call getAppsCall(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"; + + 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.3.0-beta1"); + + 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[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAppsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getAppsCall(_callback); + return localVarCall; + + } + + /** + * View apps + * View the details of all of your current OneSignal apps + * @return List<App> + * @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 -
+ */ + public List getApps() throws ApiException { + ApiResponse> localVarResp = getAppsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * View apps + * View the details of all of your current OneSignal apps + * @return ApiResponse<List<App>> + * @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 -
+ */ + public ApiResponse> getAppsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAppsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View apps (asynchronously) + * View the details of all of your current OneSignal apps + * @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 -
+ */ + public okhttp3.Call getAppsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAppsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNotification + * @param appId (required) + * @param notificationId (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 -
+ */ + public okhttp3.Call getNotificationCall(String appId, String notificationId, 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 = "/notifications/{notification_id}" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.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.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + 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 getNotificationValidateBeforeCall(String appId, String notificationId, 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 getNotification(Async)"); + } + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling getNotification(Async)"); + } + + + okhttp3.Call localVarCall = getNotificationCall(appId, notificationId, _callback); + return localVarCall; + + } + + /** + * View notification + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (required) + * @return NotificationWithMeta + * @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 -
+ */ + public NotificationWithMeta getNotification(String appId, String notificationId) throws ApiException { + ApiResponse localVarResp = getNotificationWithHttpInfo(appId, notificationId); + return localVarResp.getData(); + } + + /** + * View notification + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (required) + * @return ApiResponse<NotificationWithMeta> + * @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 -
+ */ + public ApiResponse getNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { + okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View notification (asynchronously) + * View the details of a single notification and outcomes associated with it + * @param appId (required) + * @param notificationId (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 -
+ */ + public okhttp3.Call getNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationValidateBeforeCall(appId, notificationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNotificationHistory + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (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 -
+ */ + public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, 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 = getNotificationHistoryRequestBody; + + // create path and map variables + String localVarPath = "/notifications/{notification_id}/history" + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.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.3.0-beta1"); + + 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 getNotificationHistoryValidateBeforeCall(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling getNotificationHistory(Async)"); + } + + // verify the required parameter 'getNotificationHistoryRequestBody' is set + if (getNotificationHistoryRequestBody == null) { + throw new ApiException("Missing the required parameter 'getNotificationHistoryRequestBody' when calling getNotificationHistory(Async)"); + } + + + okhttp3.Call localVarCall = getNotificationHistoryCall(notificationId, getNotificationHistoryRequestBody, _callback); + return localVarCall; + + } + + /** + * Notification History + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) + * @return NotificationHistorySuccessResponse + * @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 -
+ */ + public NotificationHistorySuccessResponse getNotificationHistory(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { + ApiResponse localVarResp = getNotificationHistoryWithHttpInfo(notificationId, getNotificationHistoryRequestBody); + return localVarResp.getData(); + } + + /** + * Notification History + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (required) + * @return ApiResponse<NotificationHistorySuccessResponse> + * @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 -
+ */ + public ApiResponse getNotificationHistoryWithHttpInfo(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody) throws ApiException { + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Notification History (asynchronously) + * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + * @param notificationId The \"id\" of the message found in the Notification object (required) + * @param getNotificationHistoryRequestBody (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 -
+ */ + public okhttp3.Call getNotificationHistoryAsync(String notificationId, GetNotificationHistoryRequestBody getNotificationHistoryRequestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationHistoryRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNotifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (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 -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer offset, Integer kind, 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 = "/notifications"; + + 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.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (kind != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("kind", kind)); + } + + 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 getNotificationsValidateBeforeCall(String appId, Integer limit, Integer offset, Integer kind, 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 getNotifications(Async)"); + } + + + okhttp3.Call localVarCall = getNotificationsCall(appId, limit, offset, kind, _callback); + return localVarCall; + + } + + /** + * View notifications + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @return NotificationSlice + * @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 -
+ */ + public NotificationSlice getNotifications(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { + ApiResponse localVarResp = getNotificationsWithHttpInfo(appId, limit, offset, kind); + return localVarResp.getData(); + } + + /** + * View notifications + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @return ApiResponse<NotificationSlice> + * @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 -
+ */ + public ApiResponse getNotificationsWithHttpInfo(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { + okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View notifications (asynchronously) + * View the details of multiple notifications + * @param appId The app ID that you want to view notifications from (required) + * @param limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (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 -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOutcomes + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) + * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (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 -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, 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}/outcomes" + .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.3.0-beta1"); + + if (outcomeNames != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); + } + + if (outcomeNames2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names[]", outcomeNames2)); + } + + if (outcomeTimeRange != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_time_range", outcomeTimeRange)); + } + + if (outcomePlatforms != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_platforms", outcomePlatforms)); + } + + if (outcomeAttribution != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_attribution", outcomeAttribution)); + } + + 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 getOutcomesValidateBeforeCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, 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 getOutcomes(Async)"); + } + + // verify the required parameter 'outcomeNames' is set + if (outcomeNames == null) { + throw new ApiException("Missing the required parameter 'outcomeNames' when calling getOutcomes(Async)"); + } + + + okhttp3.Call localVarCall = getOutcomesCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); + return localVarCall; + + } + + /** + * View Outcomes + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) + * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + * @return OutcomesData + * @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 -
+ */ + public OutcomesData getOutcomes(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { + ApiResponse localVarResp = getOutcomesWithHttpInfo(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); + return localVarResp.getData(); + } + + /** + * View Outcomes + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) + * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + * @return ApiResponse<OutcomesData> + * @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 -
+ */ + public ApiResponse getOutcomesWithHttpInfo(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { + okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View Outcomes (asynchronously) + * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) + * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (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 -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getOutcomesAsync(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSegments + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (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
201 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, 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}/segments" + .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.3.0-beta1"); + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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 getSegmentsValidateBeforeCall(String appId, Integer offset, Integer limit, 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 getSegments(Async)"); + } + + + okhttp3.Call localVarCall = getSegmentsCall(appId, offset, limit, _callback); + return localVarCall; + + } + + /** + * Get Segments + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @return GetSegmentsSuccessResponse + * @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
201 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public GetSegmentsSuccessResponse getSegments(String appId, Integer offset, Integer limit) throws ApiException { + ApiResponse localVarResp = getSegmentsWithHttpInfo(appId, offset, limit); + return localVarResp.getData(); + } + + /** + * Get Segments + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @return ApiResponse<GetSegmentsSuccessResponse> + * @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
201 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public ApiResponse getSegmentsWithHttpInfo(String appId, Integer offset, Integer limit) throws ApiException { + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Segments (asynchronously) + * Returns an array of segments from an app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param limit The amount of Segments in the response. Maximum 300. (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
201 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call getSegmentsAsync(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getUser + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (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 -
+ */ + public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, 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}/users/by/{alias_label}/{alias_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.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.3.0-beta1"); + + 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 getUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, 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 getUser(Async)"); + } + + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling getUser(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling getUser(Async)"); + } + + + okhttp3.Call localVarCall = getUserCall(appId, aliasLabel, aliasId, _callback); + return localVarCall; + + } + + /** + * + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return User + * @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 -
+ */ + public User getUser(String appId, String aliasLabel, String aliasId) throws ApiException { + ApiResponse localVarResp = getUserWithHttpInfo(appId, aliasLabel, aliasId); + return localVarResp.getData(); + } + + /** + * + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @return ApiResponse<User> + * @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 -
+ */ + public ApiResponse getUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { + okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns the User’s properties, Aliases, and Subscriptions. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (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 -
+ */ + public okhttp3.Call getUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for rotateApiKey + * @param appId (required) + * @param tokenId (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 -
+ */ + public okhttp3.Call rotateApiKeyCall(String appId, String tokenId, 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}/auth/tokens/{token_id}/rotate" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "token_id" + "\\}", localVarApiClient.escapeString(tokenId.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.3.0-beta1"); + + 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[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rotateApiKeyValidateBeforeCall(String appId, String tokenId, 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 rotateApiKey(Async)"); + } + + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + throw new ApiException("Missing the required parameter 'tokenId' when calling rotateApiKey(Async)"); + } + + + okhttp3.Call localVarCall = rotateApiKeyCall(appId, tokenId, _callback); + return localVarCall; + + } + + /** + * Rotate API key + * Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + * @param appId (required) + * @param tokenId (required) + * @return CreateApiKeyResponse + * @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 -
+ */ + public CreateApiKeyResponse rotateApiKey(String appId, String tokenId) throws ApiException { + ApiResponse localVarResp = rotateApiKeyWithHttpInfo(appId, tokenId); + return localVarResp.getData(); + } + + /** + * Rotate API key + * Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + * @param appId (required) + * @param tokenId (required) + * @return ApiResponse<CreateApiKeyResponse> + * @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 -
+ */ + public ApiResponse rotateApiKeyWithHttpInfo(String appId, String tokenId) throws ApiException { + okhttp3.Call localVarCall = rotateApiKeyValidateBeforeCall(appId, tokenId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Rotate API key (asynchronously) + * Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. + * @param appId (required) + * @param tokenId (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 -
+ */ + public okhttp3.Call rotateApiKeyAsync(String appId, String tokenId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rotateApiKeyValidateBeforeCall(appId, tokenId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for startLiveActivity + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param startLiveActivityRequest (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
201 Created -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call startLiveActivityCall(String appId, String activityType, StartLiveActivityRequest startLiveActivityRequest, 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 = startLiveActivityRequest; + + // create path and map variables + String localVarPath = "/apps/{app_id}/activities/activity/{activity_type}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "activity_type" + "\\}", localVarApiClient.escapeString(activityType.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.3.0-beta1"); + + 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 startLiveActivityValidateBeforeCall(String appId, String activityType, StartLiveActivityRequest startLiveActivityRequest, 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 startLiveActivity(Async)"); + } + + // verify the required parameter 'activityType' is set + if (activityType == null) { + throw new ApiException("Missing the required parameter 'activityType' when calling startLiveActivity(Async)"); + } + + // verify the required parameter 'startLiveActivityRequest' is set + if (startLiveActivityRequest == null) { + throw new ApiException("Missing the required parameter 'startLiveActivityRequest' when calling startLiveActivity(Async)"); + } + + + okhttp3.Call localVarCall = startLiveActivityCall(appId, activityType, startLiveActivityRequest, _callback); + return localVarCall; + + } + + /** + * Start Live Activity + * Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param startLiveActivityRequest (required) + * @return StartLiveActivitySuccessResponse + * @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
201 Created -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public StartLiveActivitySuccessResponse startLiveActivity(String appId, String activityType, StartLiveActivityRequest startLiveActivityRequest) throws ApiException { + ApiResponse localVarResp = startLiveActivityWithHttpInfo(appId, activityType, startLiveActivityRequest); + return localVarResp.getData(); + } + + /** + * Start Live Activity + * Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param startLiveActivityRequest (required) + * @return ApiResponse<StartLiveActivitySuccessResponse> + * @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
201 Created -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public ApiResponse startLiveActivityWithHttpInfo(String appId, String activityType, StartLiveActivityRequest startLiveActivityRequest) throws ApiException { + okhttp3.Call localVarCall = startLiveActivityValidateBeforeCall(appId, activityType, startLiveActivityRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Start Live Activity (asynchronously) + * Remotely start a Live Activity on iOS devices via OneSignal’s REST API. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param startLiveActivityRequest (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
201 Created -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call startLiveActivityAsync(String appId, String activityType, StartLiveActivityRequest startLiveActivityRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = startLiveActivityValidateBeforeCall(appId, activityType, startLiveActivityRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for transferSubscription + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (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 -
409 Conflict -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, 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 = transferSubscriptionRequestBody; + + // create path and map variables + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/owner" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.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.3.0-beta1"); + + 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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call transferSubscriptionValidateBeforeCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, 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 transferSubscription(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling transferSubscription(Async)"); + } + + // verify the required parameter 'transferSubscriptionRequestBody' is set + if (transferSubscriptionRequestBody == null) { + throw new ApiException("Missing the required parameter 'transferSubscriptionRequestBody' when calling transferSubscription(Async)"); + } + + + okhttp3.Call localVarCall = transferSubscriptionCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); + return localVarCall; + + } + + /** + * + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) + * @return UserIdentityBody + * @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 -
409 Conflict -
429 Rate Limit Exceeded -
+ */ + public UserIdentityBody transferSubscription(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { + ApiResponse localVarResp = transferSubscriptionWithHttpInfo(appId, subscriptionId, transferSubscriptionRequestBody); + return localVarResp.getData(); + } + + /** + * + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (required) + * @return ApiResponse<UserIdentityBody> + * @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 -
409 Conflict -
429 Rate Limit Exceeded -
+ */ + public ApiResponse transferSubscriptionWithHttpInfo(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { + okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Transfers this Subscription to the User identified by the identity in the payload. + * @param appId (required) + * @param subscriptionId (required) + * @param transferSubscriptionRequestBody (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 -
409 Conflict -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call transferSubscriptionAsync(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for unsubscribeEmailWithToken + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (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
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificationId, String token, 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}/notifications/{notification_id}/unsubscribe" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.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.3.0-beta1"); + + if (token != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); + } + + 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call unsubscribeEmailWithTokenValidateBeforeCall(String appId, String notificationId, String token, 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 unsubscribeEmailWithToken(Async)"); + } + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling unsubscribeEmailWithToken(Async)"); + } + + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException("Missing the required parameter 'token' when calling unsubscribeEmailWithToken(Async)"); + } + + + okhttp3.Call localVarCall = unsubscribeEmailWithTokenCall(appId, notificationId, token, _callback); + return localVarCall; + + } + + /** + * Unsubscribe with token + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @return GenericSuccessBoolResponse + * @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
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public GenericSuccessBoolResponse unsubscribeEmailWithToken(String appId, String notificationId, String token) throws ApiException { + ApiResponse localVarResp = unsubscribeEmailWithTokenWithHttpInfo(appId, notificationId, token); + return localVarResp.getData(); + } + + /** + * Unsubscribe with token + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @return ApiResponse<GenericSuccessBoolResponse> + * @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
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public ApiResponse unsubscribeEmailWithTokenWithHttpInfo(String appId, String notificationId, String token) throws ApiException { + okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Unsubscribe with token (asynchronously) + * Unsubscribe an email with a token when using your own custom email unsubscribe landing page + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (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
202 OK -
400 Bad Request -
429 Rate Limit Exceeded -
+ */ + public okhttp3.Call unsubscribeEmailWithTokenAsync(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateApiKey + * @param appId (required) + * @param tokenId (required) + * @param updateApiKeyRequest (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 -
+ */ + public okhttp3.Call updateApiKeyCall(String appId, String tokenId, UpdateApiKeyRequest updateApiKeyRequest, 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 = updateApiKeyRequest; + + // create path and map variables + String localVarPath = "/apps/{app_id}/auth/tokens/{token_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "token_id" + "\\}", localVarApiClient.escapeString(tokenId.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.3.0-beta1"); + + 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[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateApiKeyValidateBeforeCall(String appId, String tokenId, UpdateApiKeyRequest updateApiKeyRequest, 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 updateApiKey(Async)"); + } + + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + throw new ApiException("Missing the required parameter 'tokenId' when calling updateApiKey(Async)"); + } + + // verify the required parameter 'updateApiKeyRequest' is set + if (updateApiKeyRequest == null) { + throw new ApiException("Missing the required parameter 'updateApiKeyRequest' when calling updateApiKey(Async)"); + } + + + okhttp3.Call localVarCall = updateApiKeyCall(appId, tokenId, updateApiKeyRequest, _callback); + return localVarCall; + + } + + /** + * Update API key + * Update a Rich Authentication Token (App API Key) for a OneSignal app. + * @param appId (required) + * @param tokenId (required) + * @param updateApiKeyRequest (required) + * @return Object + * @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 -
+ */ + public Object updateApiKey(String appId, String tokenId, UpdateApiKeyRequest updateApiKeyRequest) throws ApiException { + ApiResponse localVarResp = updateApiKeyWithHttpInfo(appId, tokenId, updateApiKeyRequest); + return localVarResp.getData(); + } + + /** + * Update API key + * Update a Rich Authentication Token (App API Key) for a OneSignal app. + * @param appId (required) + * @param tokenId (required) + * @param updateApiKeyRequest (required) + * @return ApiResponse<Object> * @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 -
*/ - public ApiResponse getNotificationsWithHttpInfo(String appId, Integer limit, Integer offset, Integer kind) throws ApiException { - okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateApiKeyWithHttpInfo(String appId, String tokenId, UpdateApiKeyRequest updateApiKeyRequest) throws ApiException { + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(appId, tokenId, updateApiKeyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View notifications (asynchronously) - * View the details of multiple notifications - * @param appId The app ID that you want to view notifications from (required) - * @param limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) - * @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * Update API key (asynchronously) + * Update a Rich Authentication Token (App API Key) for a OneSignal app. + * @param appId (required) + * @param tokenId (required) + * @param updateApiKeyRequest (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 @@ -3324,24 +5498,19 @@ public ApiResponse getNotificationsWithHttpInfo(String appId, Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - */ - public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer offset, Integer kind, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateApiKeyAsync(String appId, String tokenId, UpdateApiKeyRequest updateApiKeyRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getNotificationsValidateBeforeCall(appId, limit, offset, kind, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(appId, tokenId, updateApiKeyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getOutcomes - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) - * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + * Build call for updateApp + * @param appId An app id (required) + * @param app (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3353,7 +5522,7 @@ public okhttp3.Call getNotificationsAsync(String appId, Integer limit, Integer o 429 Rate Limit Exceeded - */ - public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3367,10 +5536,10 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = app; // create path and map variables - String localVarPath = "/apps/{app_id}/outcomes" + String localVarPath = "/apps/{app_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); @@ -3380,27 +5549,7 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); - - if (outcomeNames != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); - } - - if (outcomeNames2 != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names[]", outcomeNames2)); - } - - if (outcomeTimeRange != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_time_range", outcomeTimeRange)); - } - - if (outcomePlatforms != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_platforms", outcomePlatforms)); - } - - if (outcomeAttribution != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_attribution", outcomeAttribution)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3411,46 +5560,42 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou } 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getOutcomesValidateBeforeCall(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateAppValidateBeforeCall(String appId, App app, 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 getOutcomes(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateApp(Async)"); } - // verify the required parameter 'outcomeNames' is set - if (outcomeNames == null) { - throw new ApiException("Missing the required parameter 'outcomeNames' when calling getOutcomes(Async)"); + // verify the required parameter 'app' is set + if (app == null) { + throw new ApiException("Missing the required parameter 'app' when calling updateApp(Async)"); } - okhttp3.Call localVarCall = getOutcomesCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); + okhttp3.Call localVarCall = updateAppCall(appId, app, _callback); return localVarCall; } /** - * View Outcomes - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) - * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) - * @return OutcomesData + * Update an app + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (required) + * @return App * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3460,21 +5605,17 @@ private okhttp3.Call getOutcomesValidateBeforeCall(String appId, String outcomeN
429 Rate Limit Exceeded -
*/ - public OutcomesData getOutcomes(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { - ApiResponse localVarResp = getOutcomesWithHttpInfo(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution); + public App updateApp(String appId, App app) throws ApiException { + ApiResponse localVarResp = updateAppWithHttpInfo(appId, app); return localVarResp.getData(); } /** - * View Outcomes - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) - * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) - * @return ApiResponse<OutcomesData> + * Update an app + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (required) + * @return ApiResponse<App> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3484,21 +5625,17 @@ public OutcomesData getOutcomes(String appId, String outcomeNames, String outcom
429 Rate Limit Exceeded -
*/ - public ApiResponse getOutcomesWithHttpInfo(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution) throws ApiException { - okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateAppWithHttpInfo(String appId, App app) throws ApiException { + okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * View Outcomes (asynchronously) - * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum (required) - * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - * @param outcomePlatforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + * Update an app (asynchronously) + * Updates the name or configuration settings of an existing OneSignal app + * @param appId An app id (required) + * @param app (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 @@ -3510,30 +5647,30 @@ public ApiResponse getOutcomesWithHttpInfo(String appId, String ou 429 Rate Limit Exceeded - */ - public okhttp3.Call getOutcomesAsync(String appId, String outcomeNames, String outcomeNames2, String outcomeTimeRange, String outcomePlatforms, String outcomeAttribution, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getOutcomesValidateBeforeCall(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSegments + * Build call for updateLiveActivity * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (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
201 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3547,11 +5684,12 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = updateLiveActivityRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/segments" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3560,15 +5698,7 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3579,7 +5709,7 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -3587,95 +5717,105 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSegmentsValidateBeforeCall(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, 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 getSegments(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateLiveActivity(Async)"); + } + + // verify the required parameter 'activityId' is set + if (activityId == null) { + throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); + } + + // verify the required parameter 'updateLiveActivityRequest' is set + if (updateLiveActivityRequest == null) { + throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); } - okhttp3.Call localVarCall = getSegmentsCall(appId, offset, limit, _callback); + okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); return localVarCall; } /** - * Get Segments - * Returns an array of segments from an app. + * Update a Live Activity via Push + * Updates a specified live activity. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param limit The amount of Segments in the response. Maximum 300. (optional) - * @return GetSegmentsSuccessResponse + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return UpdateLiveActivitySuccessResponse * @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
201 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public GetSegmentsSuccessResponse getSegments(String appId, Integer offset, Integer limit) throws ApiException { - ApiResponse localVarResp = getSegmentsWithHttpInfo(appId, offset, limit); + public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); return localVarResp.getData(); } /** - * Get Segments - * Returns an array of segments from an app. + * Update a Live Activity via Push + * Updates a specified live activity. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param limit The amount of Segments in the response. Maximum 300. (optional) - * @return ApiResponse<GetSegmentsSuccessResponse> + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (required) + * @return ApiResponse<UpdateLiveActivitySuccessResponse> * @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
201 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public ApiResponse getSegmentsWithHttpInfo(String appId, Integer offset, Integer limit) throws ApiException { - okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Segments (asynchronously) - * Returns an array of segments from an app. + * Update a Live Activity via Push (asynchronously) + * Updates a specified live activity. * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param limit The amount of Segments in the response. Maximum 300. (optional) + * @param activityId Live Activity record ID (required) + * @param updateLiveActivityRequest (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
201 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call getSegmentsAsync(String appId, Integer offset, Integer limit, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getSegmentsValidateBeforeCall(appId, offset, limit, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getUser + * Build call for updateSubscription * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * @param subscriptionId (required) + * @param subscriptionBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3685,10 +5825,11 @@ public okhttp3.Call getSegmentsAsync(String appId, Integer offset, Integer limit 200 OK - 400 Bad Request - 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3702,13 +5843,12 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = subscriptionBody; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3717,7 +5857,7 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3728,7 +5868,7 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -3736,40 +5876,39 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, 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 getUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateSubscription(Async)"); } - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling getUser(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling updateSubscription(Async)"); } - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling getUser(Async)"); + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscription(Async)"); } - okhttp3.Call localVarCall = getUserCall(appId, aliasLabel, aliasId, _callback); + okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, subscriptionBody, _callback); return localVarCall; } /** * - * Returns the User’s properties, Aliases, and Subscriptions. + * Updates an existing Subscription’s properties. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return User + * @param subscriptionId (required) + * @param subscriptionBody (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3777,21 +5916,21 @@ private okhttp3.Call getUserValidateBeforeCall(String appId, String aliasLabel, +
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public User getUser(String appId, String aliasLabel, String aliasId) throws ApiException { - ApiResponse localVarResp = getUserWithHttpInfo(appId, aliasLabel, aliasId); - return localVarResp.getData(); + public void updateSubscription(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + updateSubscriptionWithHttpInfo(appId, subscriptionId, subscriptionBody); } /** * - * Returns the User’s properties, Aliases, and Subscriptions. + * Updates an existing Subscription’s properties. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @return ApiResponse<User> + * @param subscriptionId (required) + * @param subscriptionBody (required) + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3799,21 +5938,21 @@ public User getUser(String appId, String aliasLabel, String aliasId) throws ApiE +
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse getUserWithHttpInfo(String appId, String aliasLabel, String aliasId) throws ApiException { - okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, null); + return localVarApiClient.execute(localVarCall); } /** * (asynchronously) - * Returns the User’s properties, Aliases, and Subscriptions. + * Updates an existing Subscription’s properties. * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) + * @param subscriptionId (required) + * @param subscriptionBody (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 @@ -3823,35 +5962,34 @@ public ApiResponse getUserWithHttpInfo(String appId, String aliasLabel, St 200 OK - 400 Bad Request - 404 Not Found - + 409 Conflict - 429 Rate Limit Exceeded - */ - public okhttp3.Call getUserAsync(String appId, String aliasLabel, String aliasId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getUserValidateBeforeCall(appId, aliasLabel, aliasId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for transferSubscription - * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) + * Build call for updateSubscriptionByToken + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -3865,12 +6003,13 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId basePath = null; } - Object localVarPostBody = transferSubscriptionRequestBody; + Object localVarPostBody = subscriptionBody; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}/owner" + String localVarPath = "/apps/{app_id}/subscriptions_by_token/{token_type}/{token}" .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + .replaceAll("\\{" + "token_type" + "\\}", localVarApiClient.escapeString(tokenType.toString())) + .replaceAll("\\{" + "token" + "\\}", localVarApiClient.escapeString(token.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3879,7 +6018,7 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -3902,119 +6041,120 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId } @SuppressWarnings("rawtypes") - private okhttp3.Call transferSubscriptionValidateBeforeCall(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateSubscriptionByTokenValidateBeforeCall(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, 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 transferSubscription(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateSubscriptionByToken(Async)"); } - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling transferSubscription(Async)"); + // verify the required parameter 'tokenType' is set + if (tokenType == null) { + throw new ApiException("Missing the required parameter 'tokenType' when calling updateSubscriptionByToken(Async)"); } - // verify the required parameter 'transferSubscriptionRequestBody' is set - if (transferSubscriptionRequestBody == null) { - throw new ApiException("Missing the required parameter 'transferSubscriptionRequestBody' when calling transferSubscription(Async)"); + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException("Missing the required parameter 'token' when calling updateSubscriptionByToken(Async)"); + } + + // verify the required parameter 'subscriptionBody' is set + if (subscriptionBody == null) { + throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscriptionByToken(Async)"); } - okhttp3.Call localVarCall = transferSubscriptionCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); + okhttp3.Call localVarCall = updateSubscriptionByTokenCall(appId, tokenType, token, subscriptionBody, _callback); return localVarCall; } /** - * - * Transfers this Subscription to the User identified by the identity in the payload. - * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) - * @return UserIdentityBody + * Update subscription by token + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (required) + * @return Object * @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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public UserIdentityBody transferSubscription(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { - ApiResponse localVarResp = transferSubscriptionWithHttpInfo(appId, subscriptionId, transferSubscriptionRequestBody); + public Object updateSubscriptionByToken(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { + ApiResponse localVarResp = updateSubscriptionByTokenWithHttpInfo(appId, tokenType, token, subscriptionBody); return localVarResp.getData(); } /** - * - * Transfers this Subscription to the User identified by the identity in the payload. - * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) - * @return ApiResponse<UserIdentityBody> + * Update subscription by token + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (required) + * @return ApiResponse<Object> * @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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse transferSubscriptionWithHttpInfo(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody) throws ApiException { - okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateSubscriptionByTokenWithHttpInfo(String appId, String tokenType, String token, SubscriptionBody subscriptionBody) throws ApiException { + okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Transfers this Subscription to the User identified by the identity in the payload. - * @param appId (required) - * @param subscriptionId (required) - * @param transferSubscriptionRequestBody (required) + * Update subscription by token (asynchronously) + * Update properties on an existing OneSignal subscription using its token. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param tokenType The type of token to use when looking up the subscription. See Subscription Types. (required) + * @param token The value of the token to lookup by (e.g., email address, phone number). (required) + * @param subscriptionBody (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 -
202 ACCEPTED -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call transferSubscriptionAsync(String appId, String subscriptionId, TransferSubscriptionRequestBody transferSubscriptionRequestBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionByTokenAsync(String appId, String tokenType, String token, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = transferSubscriptionValidateBeforeCall(appId, subscriptionId, transferSubscriptionRequestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateSubscriptionByTokenValidateBeforeCall(appId, tokenType, token, subscriptionBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for unsubscribeEmailWithToken - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * Build call for updateTemplate + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (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
202 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4028,12 +6168,11 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = updateTemplateRequest; // create path and map variables - String localVarPath = "/apps/{app_id}/notifications/{notification_id}/unsubscribe" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "notification_id" + "\\}", localVarApiClient.escapeString(notificationId.toString())); + String localVarPath = "/templates/{template_id}" + .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4042,10 +6181,10 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); - if (token != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); } final String[] localVarAccepts = { @@ -4057,7 +6196,7 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat } final String[] localVarContentTypes = { - + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4065,116 +6204,116 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call unsubscribeEmailWithTokenValidateBeforeCall(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateTemplateValidateBeforeCall(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, 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 unsubscribeEmailWithToken(Async)"); + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException("Missing the required parameter 'templateId' when calling updateTemplate(Async)"); } - // verify the required parameter 'notificationId' is set - if (notificationId == null) { - throw new ApiException("Missing the required parameter 'notificationId' when calling unsubscribeEmailWithToken(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateTemplate(Async)"); } - // verify the required parameter 'token' is set - if (token == null) { - throw new ApiException("Missing the required parameter 'token' when calling unsubscribeEmailWithToken(Async)"); + // verify the required parameter 'updateTemplateRequest' is set + if (updateTemplateRequest == null) { + throw new ApiException("Missing the required parameter 'updateTemplateRequest' when calling updateTemplate(Async)"); } - okhttp3.Call localVarCall = unsubscribeEmailWithTokenCall(appId, notificationId, token, _callback); + okhttp3.Call localVarCall = updateTemplateCall(templateId, appId, updateTemplateRequest, _callback); return localVarCall; } /** - * Unsubscribe with token - * Unsubscribe an email with a token when using your own custom email unsubscribe landing page - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) - * @return GenericSuccessBoolResponse + * Update template + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @return TemplateResource * @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
202 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public GenericSuccessBoolResponse unsubscribeEmailWithToken(String appId, String notificationId, String token) throws ApiException { - ApiResponse localVarResp = unsubscribeEmailWithTokenWithHttpInfo(appId, notificationId, token); + public TemplateResource updateTemplate(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { + ApiResponse localVarResp = updateTemplateWithHttpInfo(templateId, appId, updateTemplateRequest); return localVarResp.getData(); } /** - * Unsubscribe with token - * Unsubscribe an email with a token when using your own custom email unsubscribe landing page - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) - * @return ApiResponse<GenericSuccessBoolResponse> + * Update template + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (required) + * @return ApiResponse<TemplateResource> * @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
202 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public ApiResponse unsubscribeEmailWithTokenWithHttpInfo(String appId, String notificationId, String token) throws ApiException { - okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateTemplateWithHttpInfo(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest) throws ApiException { + okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Unsubscribe with token (asynchronously) - * Unsubscribe an email with a token when using your own custom email unsubscribe landing page - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * Update template (asynchronously) + * Update an existing template. + * @param templateId (required) + * @param appId (required) + * @param updateTemplateRequest (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
202 OK -
200 OK -
400 Bad Request -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call unsubscribeEmailWithTokenAsync(String appId, String notificationId, String token, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateTemplateAsync(String templateId, String appId, UpdateTemplateRequest updateTemplateRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = unsubscribeEmailWithTokenValidateBeforeCall(appId, notificationId, token, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, appId, updateTemplateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateApp - * @param appId An app id (required) - * @param app (required) + * Build call for updateUser + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (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 -
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4188,11 +6327,13 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call basePath = null; } - Object localVarPostBody = app; + Object localVarPostBody = updateUserRequest; // create path and map variables - String localVarPath = "/apps/{app_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); + String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) + .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4201,7 +6342,7 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -4219,98 +6360,115 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "organization_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAppValidateBeforeCall(String appId, App app, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, 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 updateApp(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling updateUser(Async)"); } - // verify the required parameter 'app' is set - if (app == null) { - throw new ApiException("Missing the required parameter 'app' when calling updateApp(Async)"); + // verify the required parameter 'aliasLabel' is set + if (aliasLabel == null) { + throw new ApiException("Missing the required parameter 'aliasLabel' when calling updateUser(Async)"); + } + + // verify the required parameter 'aliasId' is set + if (aliasId == null) { + throw new ApiException("Missing the required parameter 'aliasId' when calling updateUser(Async)"); + } + + // verify the required parameter 'updateUserRequest' is set + if (updateUserRequest == null) { + throw new ApiException("Missing the required parameter 'updateUserRequest' when calling updateUser(Async)"); } - okhttp3.Call localVarCall = updateAppCall(appId, app, _callback); + okhttp3.Call localVarCall = updateUserCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); return localVarCall; } /** - * Update an app - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) - * @return App + * + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @return PropertiesBody * @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 -
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public App updateApp(String appId, App app) throws ApiException { - ApiResponse localVarResp = updateAppWithHttpInfo(appId, app); + public PropertiesBody updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); return localVarResp.getData(); } /** - * Update an app - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) - * @return ApiResponse<App> + * + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (required) + * @return ApiResponse<PropertiesBody> * @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 -
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateAppWithHttpInfo(String appId, App app) throws ApiException { - okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update an app (asynchronously) - * Updates the name or configuration settings of an existing OneSignal app - * @param appId An app id (required) - * @param app (required) + * (asynchronously) + * Updates an existing User’s properties. + * @param appId (required) + * @param aliasLabel (required) + * @param aliasId (required) + * @param updateUserRequest (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 -
202 ACCEPTED -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateLiveActivity - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * Build call for viewApiKeys + * @param appId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4319,10 +6477,9 @@ public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateLiveActivityCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4336,12 +6493,11 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda basePath = null; } - Object localVarPostBody = updateLiveActivityRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/live_activities/{activity_id}/notifications" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); + String localVarPath = "/apps/{app_id}/auth/tokens" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4350,7 +6506,7 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); final String[] localVarAccepts = { "application/json" @@ -4361,90 +6517,72 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda } 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); + String[] localVarAuthNames = new String[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateLiveActivityValidateBeforeCall(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call viewApiKeysValidateBeforeCall(String appId, 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 updateLiveActivity(Async)"); - } - - // verify the required parameter 'activityId' is set - if (activityId == null) { - throw new ApiException("Missing the required parameter 'activityId' when calling updateLiveActivity(Async)"); - } - - // verify the required parameter 'updateLiveActivityRequest' is set - if (updateLiveActivityRequest == null) { - throw new ApiException("Missing the required parameter 'updateLiveActivityRequest' when calling updateLiveActivity(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling viewApiKeys(Async)"); } - okhttp3.Call localVarCall = updateLiveActivityCall(appId, activityId, updateLiveActivityRequest, _callback); + okhttp3.Call localVarCall = viewApiKeysCall(appId, _callback); return localVarCall; } /** - * Update a Live Activity via Push - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return UpdateLiveActivitySuccessResponse + * View API keys + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (required) + * @return ApiKeyTokensListResponse * @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 -
*/ - public UpdateLiveActivitySuccessResponse updateLiveActivity(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - ApiResponse localVarResp = updateLiveActivityWithHttpInfo(appId, activityId, updateLiveActivityRequest); + public ApiKeyTokensListResponse viewApiKeys(String appId) throws ApiException { + ApiResponse localVarResp = viewApiKeysWithHttpInfo(appId); return localVarResp.getData(); } /** - * Update a Live Activity via Push - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) - * @return ApiResponse<UpdateLiveActivitySuccessResponse> + * View API keys + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (required) + * @return ApiResponse<ApiKeyTokensListResponse> * @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 -
*/ - public ApiResponse updateLiveActivityWithHttpInfo(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewApiKeysWithHttpInfo(String appId) throws ApiException { + okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a Live Activity via Push (asynchronously) - * Updates a specified live activity. - * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param activityId Live Activity record ID (required) - * @param updateLiveActivityRequest (required) + * View API keys (asynchronously) + * View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + * @param appId (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 @@ -4453,21 +6591,19 @@ public ApiResponse updateLiveActivityWithHttp Status Code Description Response Headers 200 OK - 400 Bad Request - - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, UpdateLiveActivityRequest updateLiveActivityRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewApiKeysAsync(String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateLiveActivityValidateBeforeCall(appId, activityId, updateLiveActivityRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewApiKeysValidateBeforeCall(appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateSubscription + * Build call for viewTemplate + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4477,11 +6613,9 @@ public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, Upd 200 OK - 400 Bad Request - 404 Not Found - - 409 Conflict - - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewTemplateCall(String templateId, String appId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4495,12 +6629,11 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, basePath = null; } - Object localVarPostBody = subscriptionBody; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/subscriptions/{subscription_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "subscription_id" + "\\}", localVarApiClient.escapeString(subscriptionId.toString())); + String localVarPath = "/templates/{template_id}" + .replaceAll("\\{" + "template_id" + "\\}", localVarApiClient.escapeString(templateId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4509,7 +6642,11 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } final String[] localVarAccepts = { "application/json" @@ -4520,7 +6657,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4528,39 +6665,34 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String subscriptionId, SubscriptionBody subscriptionBody, 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 updateSubscription(Async)"); - } + private okhttp3.Call viewTemplateValidateBeforeCall(String templateId, String appId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException("Missing the required parameter 'subscriptionId' when calling updateSubscription(Async)"); + // verify the required parameter 'templateId' is set + if (templateId == null) { + throw new ApiException("Missing the required parameter 'templateId' when calling viewTemplate(Async)"); } - // verify the required parameter 'subscriptionBody' is set - if (subscriptionBody == null) { - throw new ApiException("Missing the required parameter 'subscriptionBody' when calling updateSubscription(Async)"); + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling viewTemplate(Async)"); } - okhttp3.Call localVarCall = updateSubscriptionCall(appId, subscriptionId, subscriptionBody, _callback); + okhttp3.Call localVarCall = viewTemplateCall(templateId, appId, _callback); return localVarCall; } /** - * - * Updates an existing Subscription’s properties. + * View template + * Fetch a single template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) + * @return TemplateResource * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4568,21 +6700,19 @@ private okhttp3.Call updateSubscriptionValidateBeforeCall(String appId, String s - -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public void updateSubscription(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { - updateSubscriptionWithHttpInfo(appId, subscriptionId, subscriptionBody); + public TemplateResource viewTemplate(String templateId, String appId) throws ApiException { + ApiResponse localVarResp = viewTemplateWithHttpInfo(templateId, appId); + return localVarResp.getData(); } /** - * - * Updates an existing Subscription’s properties. + * View template + * Fetch a single template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (required) - * @return ApiResponse<Void> + * @return ApiResponse<TemplateResource> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -4590,21 +6720,19 @@ public void updateSubscription(String appId, String subscriptionId, Subscription - -
200 OK -
400 Bad Request -
404 Not Found -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateSubscriptionWithHttpInfo(String appId, String subscriptionId, SubscriptionBody subscriptionBody) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse viewTemplateWithHttpInfo(String templateId, String appId) throws ApiException { + okhttp3.Call localVarCall = viewTemplateValidateBeforeCall(templateId, appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Updates an existing Subscription’s properties. + * View template (asynchronously) + * Fetch a single template by id. + * @param templateId (required) * @param appId (required) - * @param subscriptionId (required) - * @param subscriptionBody (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 @@ -4614,35 +6742,33 @@ public ApiResponse updateSubscriptionWithHttpInfo(String appId, String sub 200 OK - 400 Bad Request - 404 Not Found - - 409 Conflict - - 429 Rate Limit Exceeded - */ - public okhttp3.Call updateSubscriptionAsync(String appId, String subscriptionId, SubscriptionBody subscriptionBody, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewTemplateAsync(String templateId, String appId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionValidateBeforeCall(appId, subscriptionId, subscriptionBody, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = viewTemplateValidateBeforeCall(templateId, appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateUser - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) + * Build call for viewTemplates + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param limit Maximum number of templates. Default and max is 50. (optional, default to 50) + * @param offset Pagination offset. (optional, default to 0) + * @param channel Filter by delivery channel. (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
202 ACCEPTED -
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateUserCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewTemplatesCall(String appId, Integer limit, Integer offset, String channel, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -4656,13 +6782,10 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias basePath = null; } - Object localVarPostBody = updateUserRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apps/{app_id}/users/by/{alias_label}/{alias_id}" - .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) - .replaceAll("\\{" + "alias_label" + "\\}", localVarApiClient.escapeString(aliasLabel.toString())) - .replaceAll("\\{" + "alias_id" + "\\}", localVarApiClient.escapeString(aliasId.toString())); + String localVarPath = "/templates"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4671,7 +6794,23 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.2.1-beta1"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.3.0-beta1"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (channel != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("channel", channel)); + } final String[] localVarAccepts = { "application/json" @@ -4682,7 +6821,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias } final String[] localVarContentTypes = { - "application/json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4690,108 +6829,90 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias } String[] localVarAuthNames = new String[] { "rest_api_key" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateUserValidateBeforeCall(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + private okhttp3.Call viewTemplatesValidateBeforeCall(String appId, Integer limit, Integer offset, String channel, 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 updateUser(Async)"); - } - - // verify the required parameter 'aliasLabel' is set - if (aliasLabel == null) { - throw new ApiException("Missing the required parameter 'aliasLabel' when calling updateUser(Async)"); - } - - // verify the required parameter 'aliasId' is set - if (aliasId == null) { - throw new ApiException("Missing the required parameter 'aliasId' when calling updateUser(Async)"); - } - - // verify the required parameter 'updateUserRequest' is set - if (updateUserRequest == null) { - throw new ApiException("Missing the required parameter 'updateUserRequest' when calling updateUser(Async)"); + throw new ApiException("Missing the required parameter 'appId' when calling viewTemplates(Async)"); } - okhttp3.Call localVarCall = updateUserCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); + okhttp3.Call localVarCall = viewTemplatesCall(appId, limit, offset, channel, _callback); return localVarCall; } /** - * - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) - * @return PropertiesBody + * View templates + * List templates for an app. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param limit Maximum number of templates. Default and max is 50. (optional, default to 50) + * @param offset Pagination offset. (optional, default to 0) + * @param channel Filter by delivery channel. (optional) + * @return TemplatesListResponse * @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
202 ACCEPTED -
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public PropertiesBody updateUser(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { - ApiResponse localVarResp = updateUserWithHttpInfo(appId, aliasLabel, aliasId, updateUserRequest); + public TemplatesListResponse viewTemplates(String appId, Integer limit, Integer offset, String channel) throws ApiException { + ApiResponse localVarResp = viewTemplatesWithHttpInfo(appId, limit, offset, channel); return localVarResp.getData(); } /** - * - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) - * @return ApiResponse<PropertiesBody> + * View templates + * List templates for an app. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param limit Maximum number of templates. Default and max is 50. (optional, default to 50) + * @param offset Pagination offset. (optional, default to 0) + * @param channel Filter by delivery channel. (optional) + * @return ApiResponse<TemplatesListResponse> * @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
202 ACCEPTED -
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public ApiResponse updateUserWithHttpInfo(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse viewTemplatesWithHttpInfo(String appId, Integer limit, Integer offset, String channel) throws ApiException { + okhttp3.Call localVarCall = viewTemplatesValidateBeforeCall(appId, limit, offset, channel, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * (asynchronously) - * Updates an existing User’s properties. - * @param appId (required) - * @param aliasLabel (required) - * @param aliasId (required) - * @param updateUserRequest (required) + * View templates (asynchronously) + * List templates for an app. + * @param appId Your OneSignal App ID in UUID v4 format. (required) + * @param limit Maximum number of templates. Default and max is 50. (optional, default to 50) + * @param offset Pagination offset. (optional, default to 0) + * @param channel Filter by delivery channel. (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
202 ACCEPTED -
200 OK -
400 Bad Request -
409 Conflict -
429 Rate Limit Exceeded -
*/ - public okhttp3.Call updateUserAsync(String appId, String aliasLabel, String aliasId, UpdateUserRequest updateUserRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call viewTemplatesAsync(String appId, Integer limit, Integer offset, String channel, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateUserValidateBeforeCall(appId, aliasLabel, aliasId, updateUserRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = viewTemplatesValidateBeforeCall(appId, limit, offset, channel, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java index 4456c85..ee8a40d 100644 --- a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java +++ b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/Authentication.java b/src/main/java/com/onesignal/client/auth/Authentication.java index bbbc398..e1bd4e1 100644 --- a/src/main/java/com/onesignal/client/auth/Authentication.java +++ b/src/main/java/com/onesignal/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java index e72f9ea..de7b1b7 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java index 8e4d847..d2bedd7 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java index b142a53..ff4ccf7 100644 --- a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ApiKeyToken.java b/src/main/java/com/onesignal/client/model/ApiKeyToken.java new file mode 100644 index 0000000..1ee3fdb --- /dev/null +++ b/src/main/java/com/onesignal/client/model/ApiKeyToken.java @@ -0,0 +1,392 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.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; + +/** + * ApiKeyToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyToken { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TOKEN_ID = "token_id"; + @SerializedName(SERIALIZED_NAME_TOKEN_ID) + private String tokenId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Gets or Sets ipAllowlistMode + */ + @JsonAdapter(IpAllowlistModeEnum.Adapter.class) + public enum IpAllowlistModeEnum { + DISABLED("disabled"), + + EXPLICIT("explicit"); + + private String value; + + IpAllowlistModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IpAllowlistModeEnum fromValue(String value) { + for (IpAllowlistModeEnum b : IpAllowlistModeEnum.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 IpAllowlistModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IpAllowlistModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IpAllowlistModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_IP_ALLOWLIST_MODE = "ip_allowlist_mode"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST_MODE) + private IpAllowlistModeEnum ipAllowlistMode; + + public static final String SERIALIZED_NAME_IP_ALLOWLIST = "ip_allowlist"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST) + private List ipAllowlist = null; + + public ApiKeyToken() { + } + + public ApiKeyToken tokenId(String tokenId) { + + this.tokenId = tokenId; + return this; + } + + /** + * Get tokenId + * @return tokenId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getTokenId() { + return tokenId; + } + + + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } + + + public ApiKeyToken updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ApiKeyToken createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public ApiKeyToken name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ApiKeyToken ipAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + + this.ipAllowlistMode = ipAllowlistMode; + return this; + } + + /** + * Get ipAllowlistMode + * @return ipAllowlistMode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public IpAllowlistModeEnum getIpAllowlistMode() { + return ipAllowlistMode; + } + + + public void setIpAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + this.ipAllowlistMode = ipAllowlistMode; + } + + + public ApiKeyToken ipAllowlist(List ipAllowlist) { + + this.ipAllowlist = ipAllowlist; + return this; + } + + public ApiKeyToken addIpAllowlistItem(String ipAllowlistItem) { + if (this.ipAllowlist == null) { + this.ipAllowlist = new ArrayList<>(); + } + this.ipAllowlist.add(ipAllowlistItem); + return this; + } + + /** + * Get ipAllowlist + * @return ipAllowlist + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getIpAllowlist() { + return ipAllowlist; + } + + + public void setIpAllowlist(List ipAllowlist) { + this.ipAllowlist = ipAllowlist; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyToken apiKeyToken = (ApiKeyToken) o; + return Objects.equals(this.tokenId, apiKeyToken.tokenId) && + Objects.equals(this.updatedAt, apiKeyToken.updatedAt) && + Objects.equals(this.createdAt, apiKeyToken.createdAt) && + Objects.equals(this.name, apiKeyToken.name) && + Objects.equals(this.ipAllowlistMode, apiKeyToken.ipAllowlistMode) && + Objects.equals(this.ipAllowlist, apiKeyToken.ipAllowlist); + } + + @Override + public int hashCode() { + return Objects.hash(tokenId, updatedAt, createdAt, name, ipAllowlistMode, ipAllowlist); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyToken {\n"); + sb.append(" tokenId: ").append(toIndentedString(tokenId)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ipAllowlistMode: ").append(toIndentedString(ipAllowlistMode)).append("\n"); + sb.append(" ipAllowlist: ").append(toIndentedString(ipAllowlist)).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("token_id"); + openapiFields.add("updated_at"); + openapiFields.add("created_at"); + openapiFields.add("name"); + openapiFields.add("ip_allowlist_mode"); + openapiFields.add("ip_allowlist"); + + // 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 (!ApiKeyToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyToken + * @throws IOException if the JSON string is invalid with respect to ApiKeyToken + */ + public static ApiKeyToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyToken.class); + } + + /** + * Convert an instance of ApiKeyToken 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/ApiKeyTokensListResponse.java b/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java new file mode 100644 index 0000000..be981a1 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.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 + * + * The version of the OpenAPI document: 5.3.0 + * 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.ApiKeyToken; +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; + +/** + * ApiKeyTokensListResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyTokensListResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TOKENS = "tokens"; + @SerializedName(SERIALIZED_NAME_TOKENS) + private List tokens = null; + + public ApiKeyTokensListResponse() { + } + + public ApiKeyTokensListResponse tokens(List tokens) { + + this.tokens = tokens; + return this; + } + + public ApiKeyTokensListResponse addTokensItem(ApiKeyToken tokensItem) { + if (this.tokens == null) { + this.tokens = new ArrayList<>(); + } + this.tokens.add(tokensItem); + return this; + } + + /** + * Get tokens + * @return tokens + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getTokens() { + return tokens; + } + + + public void setTokens(List tokens) { + this.tokens = tokens; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyTokensListResponse apiKeyTokensListResponse = (ApiKeyTokensListResponse) o; + return Objects.equals(this.tokens, apiKeyTokensListResponse.tokens); + } + + @Override + public int hashCode() { + return Objects.hash(tokens); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyTokensListResponse {\n"); + sb.append(" tokens: ").append(toIndentedString(tokens)).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("tokens"); + + // 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 (!ApiKeyTokensListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyTokensListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyTokensListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyTokensListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyTokensListResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyTokensListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyTokensListResponse + * @throws IOException if the JSON string is invalid with respect to ApiKeyTokensListResponse + */ + public static ApiKeyTokensListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyTokensListResponse.class); + } + + /** + * Convert an instance of ApiKeyTokensListResponse 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/App.java b/src/main/java/com/onesignal/client/model/App.java index 1668d23..fe289af 100644 --- a/src/main/java/com/onesignal/client/model/App.java +++ b/src/main/java/com/onesignal/client/model/App.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/BasicNotification.java b/src/main/java/com/onesignal/client/model/BasicNotification.java index 9266297..86650ae 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotification.java +++ b/src/main/java/com/onesignal/client/model/BasicNotification.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java index 579b2ae..6c0c35e 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java +++ b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java b/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java index 3257c5e..aaf8dc3 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java +++ b/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Button.java b/src/main/java/com/onesignal/client/model/Button.java index 8517250..c35ec44 100644 --- a/src/main/java/com/onesignal/client/model/Button.java +++ b/src/main/java/com/onesignal/client/model/Button.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java b/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java new file mode 100644 index 0000000..64c4da7 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java @@ -0,0 +1,186 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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; + +/** + * CopyTemplateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CopyTemplateRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TARGET_APP_ID = "target_app_id"; + @SerializedName(SERIALIZED_NAME_TARGET_APP_ID) + private String targetAppId; + + public CopyTemplateRequest() { + } + + public CopyTemplateRequest targetAppId(String targetAppId) { + + this.targetAppId = targetAppId; + return this; + } + + /** + * Destination OneSignal App ID in UUID v4 format. + * @return targetAppId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Destination OneSignal App ID in UUID v4 format.") + + public String getTargetAppId() { + return targetAppId; + } + + + public void setTargetAppId(String targetAppId) { + this.targetAppId = targetAppId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CopyTemplateRequest copyTemplateRequest = (CopyTemplateRequest) o; + return Objects.equals(this.targetAppId, copyTemplateRequest.targetAppId); + } + + @Override + public int hashCode() { + return Objects.hash(targetAppId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CopyTemplateRequest {\n"); + sb.append(" targetAppId: ").append(toIndentedString(targetAppId)).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("target_app_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("target_app_id"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CopyTemplateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CopyTemplateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CopyTemplateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CopyTemplateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CopyTemplateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CopyTemplateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CopyTemplateRequest + * @throws IOException if the JSON string is invalid with respect to CopyTemplateRequest + */ + public static CopyTemplateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CopyTemplateRequest.class); + } + + /** + * Convert an instance of CopyTemplateRequest 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/CreateApiKeyRequest.java b/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java new file mode 100644 index 0000000..df6d969 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java @@ -0,0 +1,302 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.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; + +/** + * CreateApiKeyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateApiKeyRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Gets or Sets ipAllowlistMode + */ + @JsonAdapter(IpAllowlistModeEnum.Adapter.class) + public enum IpAllowlistModeEnum { + DISABLED("disabled"), + + EXPLICIT("explicit"); + + private String value; + + IpAllowlistModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IpAllowlistModeEnum fromValue(String value) { + for (IpAllowlistModeEnum b : IpAllowlistModeEnum.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 IpAllowlistModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IpAllowlistModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IpAllowlistModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_IP_ALLOWLIST_MODE = "ip_allowlist_mode"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST_MODE) + private IpAllowlistModeEnum ipAllowlistMode; + + public static final String SERIALIZED_NAME_IP_ALLOWLIST = "ip_allowlist"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST) + private List ipAllowlist = null; + + public CreateApiKeyRequest() { + } + + public CreateApiKeyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateApiKeyRequest ipAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + + this.ipAllowlistMode = ipAllowlistMode; + return this; + } + + /** + * Get ipAllowlistMode + * @return ipAllowlistMode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public IpAllowlistModeEnum getIpAllowlistMode() { + return ipAllowlistMode; + } + + + public void setIpAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + this.ipAllowlistMode = ipAllowlistMode; + } + + + public CreateApiKeyRequest ipAllowlist(List ipAllowlist) { + + this.ipAllowlist = ipAllowlist; + return this; + } + + public CreateApiKeyRequest addIpAllowlistItem(String ipAllowlistItem) { + if (this.ipAllowlist == null) { + this.ipAllowlist = new ArrayList<>(); + } + this.ipAllowlist.add(ipAllowlistItem); + return this; + } + + /** + * Get ipAllowlist + * @return ipAllowlist + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getIpAllowlist() { + return ipAllowlist; + } + + + public void setIpAllowlist(List ipAllowlist) { + this.ipAllowlist = ipAllowlist; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateApiKeyRequest createApiKeyRequest = (CreateApiKeyRequest) o; + return Objects.equals(this.name, createApiKeyRequest.name) && + Objects.equals(this.ipAllowlistMode, createApiKeyRequest.ipAllowlistMode) && + Objects.equals(this.ipAllowlist, createApiKeyRequest.ipAllowlist); + } + + @Override + public int hashCode() { + return Objects.hash(name, ipAllowlistMode, ipAllowlist); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateApiKeyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ipAllowlistMode: ").append(toIndentedString(ipAllowlistMode)).append("\n"); + sb.append(" ipAllowlist: ").append(toIndentedString(ipAllowlist)).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("name"); + openapiFields.add("ip_allowlist_mode"); + openapiFields.add("ip_allowlist"); + + // 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 (!CreateApiKeyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateApiKeyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateApiKeyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateApiKeyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateApiKeyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateApiKeyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateApiKeyRequest + * @throws IOException if the JSON string is invalid with respect to CreateApiKeyRequest + */ + public static CreateApiKeyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateApiKeyRequest.class); + } + + /** + * Convert an instance of CreateApiKeyRequest 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/CreateApiKeyResponse.java b/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java new file mode 100644 index 0000000..64841b0 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java @@ -0,0 +1,215 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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; + +/** + * CreateApiKeyResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateApiKeyResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TOKEN_ID = "token_id"; + @SerializedName(SERIALIZED_NAME_TOKEN_ID) + private String tokenId; + + public static final String SERIALIZED_NAME_FORMATTED_TOKEN = "formatted_token"; + @SerializedName(SERIALIZED_NAME_FORMATTED_TOKEN) + private String formattedToken; + + public CreateApiKeyResponse() { + } + + public CreateApiKeyResponse tokenId(String tokenId) { + + this.tokenId = tokenId; + return this; + } + + /** + * Get tokenId + * @return tokenId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getTokenId() { + return tokenId; + } + + + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } + + + public CreateApiKeyResponse formattedToken(String formattedToken) { + + this.formattedToken = formattedToken; + return this; + } + + /** + * Get formattedToken + * @return formattedToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getFormattedToken() { + return formattedToken; + } + + + public void setFormattedToken(String formattedToken) { + this.formattedToken = formattedToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateApiKeyResponse createApiKeyResponse = (CreateApiKeyResponse) o; + return Objects.equals(this.tokenId, createApiKeyResponse.tokenId) && + Objects.equals(this.formattedToken, createApiKeyResponse.formattedToken); + } + + @Override + public int hashCode() { + return Objects.hash(tokenId, formattedToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateApiKeyResponse {\n"); + sb.append(" tokenId: ").append(toIndentedString(tokenId)).append("\n"); + sb.append(" formattedToken: ").append(toIndentedString(formattedToken)).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("token_id"); + openapiFields.add("formatted_token"); + + // 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 (!CreateApiKeyResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateApiKeyResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateApiKeyResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateApiKeyResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateApiKeyResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateApiKeyResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateApiKeyResponse + * @throws IOException if the JSON string is invalid with respect to CreateApiKeyResponse + */ + public static CreateApiKeyResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateApiKeyResponse.class); + } + + /** + * Convert an instance of CreateApiKeyResponse 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/CreateNotificationSuccessResponse.java b/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java index 113b419..3e2c2c2 100644 --- a/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java b/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java index 04e4a81..9766392 100644 --- a/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java b/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java index ad176b4..eefa4b3 100644 --- a/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java b/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java new file mode 100644 index 0000000..fd017d6 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java @@ -0,0 +1,411 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.LanguageStringMap; +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; + +/** + * CreateTemplateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateTemplateRequest { + 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_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CONTENTS = "contents"; + @SerializedName(SERIALIZED_NAME_CONTENTS) + private LanguageStringMap contents; + + public static final String SERIALIZED_NAME_IS_EMAIL = "isEmail"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL) + private Boolean isEmail; + + public static final String SERIALIZED_NAME_EMAIL_SUBJECT = "email_subject"; + @SerializedName(SERIALIZED_NAME_EMAIL_SUBJECT) + private String emailSubject; + + public static final String SERIALIZED_NAME_EMAIL_BODY = "email_body"; + @SerializedName(SERIALIZED_NAME_EMAIL_BODY) + private String emailBody; + + public static final String SERIALIZED_NAME_IS_S_M_S = "isSMS"; + @SerializedName(SERIALIZED_NAME_IS_S_M_S) + private Boolean isSMS; + + public static final String SERIALIZED_NAME_DYNAMIC_CONTENT = "dynamic_content"; + @SerializedName(SERIALIZED_NAME_DYNAMIC_CONTENT) + private String dynamicContent; + + public CreateTemplateRequest() { + } + + public CreateTemplateRequest appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * Your OneSignal App ID in UUID v4 format. + * @return appId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Your OneSignal App ID in UUID v4 format.") + + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public CreateTemplateRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the template. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the template.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateTemplateRequest contents(LanguageStringMap contents) { + + this.contents = contents; + return this; + } + + /** + * Get contents + * @return contents + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public LanguageStringMap getContents() { + return contents; + } + + + public void setContents(LanguageStringMap contents) { + this.contents = contents; + } + + + public CreateTemplateRequest isEmail(Boolean isEmail) { + + this.isEmail = isEmail; + return this; + } + + /** + * Set true for an Email template. + * @return isEmail + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Set true for an Email template.") + + public Boolean getIsEmail() { + return isEmail; + } + + + public void setIsEmail(Boolean isEmail) { + this.isEmail = isEmail; + } + + + public CreateTemplateRequest emailSubject(String emailSubject) { + + this.emailSubject = emailSubject; + return this; + } + + /** + * Subject of the email. + * @return emailSubject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of the email.") + + public String getEmailSubject() { + return emailSubject; + } + + + public void setEmailSubject(String emailSubject) { + this.emailSubject = emailSubject; + } + + + public CreateTemplateRequest emailBody(String emailBody) { + + this.emailBody = emailBody; + return this; + } + + /** + * Body of the email (HTML supported). + * @return emailBody + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Body of the email (HTML supported).") + + public String getEmailBody() { + return emailBody; + } + + + public void setEmailBody(String emailBody) { + this.emailBody = emailBody; + } + + + public CreateTemplateRequest isSMS(Boolean isSMS) { + + this.isSMS = isSMS; + return this; + } + + /** + * Set true for an SMS template. + * @return isSMS + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Set true for an SMS template.") + + public Boolean getIsSMS() { + return isSMS; + } + + + public void setIsSMS(Boolean isSMS) { + this.isSMS = isSMS; + } + + + public CreateTemplateRequest dynamicContent(String dynamicContent) { + + this.dynamicContent = dynamicContent; + return this; + } + + /** + * JSON string for dynamic content personalization. + * @return dynamicContent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "JSON string for dynamic content personalization.") + + public String getDynamicContent() { + return dynamicContent; + } + + + public void setDynamicContent(String dynamicContent) { + this.dynamicContent = dynamicContent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTemplateRequest createTemplateRequest = (CreateTemplateRequest) o; + return Objects.equals(this.appId, createTemplateRequest.appId) && + Objects.equals(this.name, createTemplateRequest.name) && + Objects.equals(this.contents, createTemplateRequest.contents) && + Objects.equals(this.isEmail, createTemplateRequest.isEmail) && + Objects.equals(this.emailSubject, createTemplateRequest.emailSubject) && + Objects.equals(this.emailBody, createTemplateRequest.emailBody) && + Objects.equals(this.isSMS, createTemplateRequest.isSMS) && + Objects.equals(this.dynamicContent, createTemplateRequest.dynamicContent); + } + + 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, name, contents, isEmail, emailSubject, emailBody, isSMS, dynamicContent); + } + + 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 CreateTemplateRequest {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" isEmail: ").append(toIndentedString(isEmail)).append("\n"); + sb.append(" emailSubject: ").append(toIndentedString(emailSubject)).append("\n"); + sb.append(" emailBody: ").append(toIndentedString(emailBody)).append("\n"); + sb.append(" isSMS: ").append(toIndentedString(isSMS)).append("\n"); + sb.append(" dynamicContent: ").append(toIndentedString(dynamicContent)).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("name"); + openapiFields.add("contents"); + openapiFields.add("isEmail"); + openapiFields.add("email_subject"); + openapiFields.add("email_body"); + openapiFields.add("isSMS"); + openapiFields.add("dynamic_content"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("app_id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("contents"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTemplateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTemplateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateTemplateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTemplateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTemplateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTemplateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTemplateRequest + * @throws IOException if the JSON string is invalid with respect to CreateTemplateRequest + */ + public static CreateTemplateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTemplateRequest.class); + } + + /** + * Convert an instance of CreateTemplateRequest 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/CreateUserConflictResponse.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java index 39b4552..ebd8e21 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java index df1a8e1..ea4501f 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java index 9720310..360f9d0 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CustomEvent.java b/src/main/java/com/onesignal/client/model/CustomEvent.java new file mode 100644 index 0000000..5fa494e --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CustomEvent.java @@ -0,0 +1,330 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.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; + +/** + * CustomEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CustomEvent { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_ID) + private String externalId; + + public static final String SERIALIZED_NAME_ONESIGNAL_ID = "onesignal_id"; + @SerializedName(SERIALIZED_NAME_ONESIGNAL_ID) + private String onesignalId; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private OffsetDateTime timestamp; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private Map payload = null; + + public CustomEvent() { + } + + public CustomEvent name(String name) { + + this.name = name; + return this; + } + + /** + * The identifier or name of the event. Maximum 128 characters. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The identifier or name of the event. Maximum 128 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CustomEvent externalId(String externalId) { + + this.externalId = externalId; + return this; + } + + /** + * The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. + * @return externalId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.") + + public String getExternalId() { + return externalId; + } + + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + + public CustomEvent onesignalId(String onesignalId) { + + this.onesignalId = onesignalId; + return this; + } + + /** + * The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. + * @return onesignalId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.") + + public String getOnesignalId() { + return onesignalId; + } + + + public void setOnesignalId(String onesignalId) { + this.onesignalId = onesignalId; + } + + + public CustomEvent timestamp(OffsetDateTime timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided. + * @return timestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided.") + + public OffsetDateTime getTimestamp() { + return timestamp; + } + + + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + } + + + public CustomEvent payload(Map payload) { + + this.payload = payload; + return this; + } + + public CustomEvent putPayloadItem(String key, Object payloadItem) { + if (this.payload == null) { + this.payload = new HashMap<>(); + } + this.payload.put(key, payloadItem); + return this; + } + + /** + * Properties or data related to the event, like {\"geography\": \"USA\"} + * @return payload + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Properties or data related to the event, like {\"geography\": \"USA\"}") + + public Map getPayload() { + return payload; + } + + + public void setPayload(Map payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomEvent customEvent = (CustomEvent) o; + return Objects.equals(this.name, customEvent.name) && + Objects.equals(this.externalId, customEvent.externalId) && + Objects.equals(this.onesignalId, customEvent.onesignalId) && + Objects.equals(this.timestamp, customEvent.timestamp) && + Objects.equals(this.payload, customEvent.payload); + } + + 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(name, externalId, onesignalId, timestamp, payload); + } + + 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 CustomEvent {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" onesignalId: ").append(toIndentedString(onesignalId)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).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("name"); + openapiFields.add("external_id"); + openapiFields.add("onesignal_id"); + openapiFields.add("timestamp"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CustomEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CustomEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CustomEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomEvent + * @throws IOException if the JSON string is invalid with respect to CustomEvent + */ + public static CustomEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomEvent.class); + } + + /** + * Convert an instance of CustomEvent 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/CustomEventsRequest.java b/src/main/java/com/onesignal/client/model/CustomEventsRequest.java new file mode 100644 index 0000000..23c7eae --- /dev/null +++ b/src/main/java/com/onesignal/client/model/CustomEventsRequest.java @@ -0,0 +1,194 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.CustomEvent; +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; + +/** + * CustomEventsRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CustomEventsRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_EVENTS = "events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + private List events = new ArrayList<>(); + + public CustomEventsRequest() { + } + + public CustomEventsRequest events(List events) { + + this.events = events; + return this; + } + + public CustomEventsRequest addEventsItem(CustomEvent eventsItem) { + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + 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; + } + CustomEventsRequest customEventsRequest = (CustomEventsRequest) o; + return Objects.equals(this.events, customEventsRequest.events); + } + + @Override + public int hashCode() { + return Objects.hash(events); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomEventsRequest {\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(); + openapiRequiredFields.add("events"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CustomEventsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomEventsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomEventsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CustomEventsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CustomEventsRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomEventsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomEventsRequest + * @throws IOException if the JSON string is invalid with respect to CustomEventsRequest + */ + public static CustomEventsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomEventsRequest.class); + } + + /** + * Convert an instance of CustomEventsRequest 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/DeliveryData.java b/src/main/java/com/onesignal/client/model/DeliveryData.java index cb364d6..15c44e3 100644 --- a/src/main/java/com/onesignal/client/model/DeliveryData.java +++ b/src/main/java/com/onesignal/client/model/DeliveryData.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java b/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java index 07395ca..ac7b89f 100644 --- a/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java b/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java index ba3fca5..1c1e9b5 100644 --- a/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java +++ b/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java b/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java index a73c600..057a543 100644 --- a/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Filter.java b/src/main/java/com/onesignal/client/model/Filter.java index ee7923d..ecf5502 100644 --- a/src/main/java/com/onesignal/client/model/Filter.java +++ b/src/main/java/com/onesignal/client/model/Filter.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/FilterExpression.java b/src/main/java/com/onesignal/client/model/FilterExpression.java index 9250566..a6e33e3 100644 --- a/src/main/java/com/onesignal/client/model/FilterExpression.java +++ b/src/main/java/com/onesignal/client/model/FilterExpression.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GenericError.java b/src/main/java/com/onesignal/client/model/GenericError.java index 860b014..b621c41 100644 --- a/src/main/java/com/onesignal/client/model/GenericError.java +++ b/src/main/java/com/onesignal/client/model/GenericError.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java b/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java index 69c9d7a..ad409ce 100644 --- a/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java +++ b/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java b/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java index dd28606..75c12b7 100644 --- a/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java +++ b/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java b/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java index 83a3257..2e672a4 100644 --- a/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/LanguageStringMap.java b/src/main/java/com/onesignal/client/model/LanguageStringMap.java index 0ed5758..47a790f 100644 --- a/src/main/java/com/onesignal/client/model/LanguageStringMap.java +++ b/src/main/java/com/onesignal/client/model/LanguageStringMap.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Notification.java b/src/main/java/com/onesignal/client/model/Notification.java index 592328d..780f8ec 100644 --- a/src/main/java/com/onesignal/client/model/Notification.java +++ b/src/main/java/com/onesignal/client/model/Notification.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationAllOf.java b/src/main/java/com/onesignal/client/model/NotificationAllOf.java index c25e6ec..83bb4cc 100644 --- a/src/main/java/com/onesignal/client/model/NotificationAllOf.java +++ b/src/main/java/com/onesignal/client/model/NotificationAllOf.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java b/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java index c973b79..9930634 100644 --- a/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationSlice.java b/src/main/java/com/onesignal/client/model/NotificationSlice.java index f1e02a6..c8e1168 100644 --- a/src/main/java/com/onesignal/client/model/NotificationSlice.java +++ b/src/main/java/com/onesignal/client/model/NotificationSlice.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationTarget.java b/src/main/java/com/onesignal/client/model/NotificationTarget.java index 748d8d0..9439a45 100644 --- a/src/main/java/com/onesignal/client/model/NotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/NotificationTarget.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java index 55d8bb6..94a2bf8 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java index 4d220b7..da42be6 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Operator.java b/src/main/java/com/onesignal/client/model/Operator.java index 9538b1d..83184d3 100644 --- a/src/main/java/com/onesignal/client/model/Operator.java +++ b/src/main/java/com/onesignal/client/model/Operator.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/OutcomeData.java b/src/main/java/com/onesignal/client/model/OutcomeData.java index a1a31be..58411b8 100644 --- a/src/main/java/com/onesignal/client/model/OutcomeData.java +++ b/src/main/java/com/onesignal/client/model/OutcomeData.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/OutcomesData.java b/src/main/java/com/onesignal/client/model/OutcomesData.java index b06bb93..0efae7e 100644 --- a/src/main/java/com/onesignal/client/model/OutcomesData.java +++ b/src/main/java/com/onesignal/client/model/OutcomesData.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java index a6042cf..398acef 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java index e2cb49a..173b90b 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java index 69460b8..083b3dc 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesBody.java b/src/main/java/com/onesignal/client/model/PropertiesBody.java index ac08f7a..6eb7c7b 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesBody.java +++ b/src/main/java/com/onesignal/client/model/PropertiesBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesDeltas.java b/src/main/java/com/onesignal/client/model/PropertiesDeltas.java index 626806b..1437fd1 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesDeltas.java +++ b/src/main/java/com/onesignal/client/model/PropertiesDeltas.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesObject.java b/src/main/java/com/onesignal/client/model/PropertiesObject.java index a1cbf6b..a9900b8 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesObject.java +++ b/src/main/java/com/onesignal/client/model/PropertiesObject.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Purchase.java b/src/main/java/com/onesignal/client/model/Purchase.java index 596c38e..25c4c7b 100644 --- a/src/main/java/com/onesignal/client/model/Purchase.java +++ b/src/main/java/com/onesignal/client/model/Purchase.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/RateLimitError.java b/src/main/java/com/onesignal/client/model/RateLimitError.java index ffd1d1b..f1da50b 100644 --- a/src/main/java/com/onesignal/client/model/RateLimitError.java +++ b/src/main/java/com/onesignal/client/model/RateLimitError.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Segment.java b/src/main/java/com/onesignal/client/model/Segment.java index 1abd5f1..e0ff320 100644 --- a/src/main/java/com/onesignal/client/model/Segment.java +++ b/src/main/java/com/onesignal/client/model/Segment.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SegmentData.java b/src/main/java/com/onesignal/client/model/SegmentData.java index 79bf172..a1942be 100644 --- a/src/main/java/com/onesignal/client/model/SegmentData.java +++ b/src/main/java/com/onesignal/client/model/SegmentData.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java index 8586a9a..aa34a33 100644 --- a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java b/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java new file mode 100644 index 0000000..4f96779 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java @@ -0,0 +1,746 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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 com.onesignal.client.model.LanguageStringMap; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +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; + +/** + * StartLiveActivityRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartLiveActivityRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Gets or Sets event + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + START("start"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.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 EventEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EventEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) + private EventEnum event = EventEnum.START; + + public static final String SERIALIZED_NAME_ACTIVITY_ID = "activity_id"; + @SerializedName(SERIALIZED_NAME_ACTIVITY_ID) + private String activityId; + + public static final String SERIALIZED_NAME_EVENT_ATTRIBUTES = "event_attributes"; + @SerializedName(SERIALIZED_NAME_EVENT_ATTRIBUTES) + private Object eventAttributes; + + public static final String SERIALIZED_NAME_EVENT_UPDATES = "event_updates"; + @SerializedName(SERIALIZED_NAME_EVENT_UPDATES) + private Object eventUpdates; + + public static final String SERIALIZED_NAME_CONTENTS = "contents"; + @SerializedName(SERIALIZED_NAME_CONTENTS) + private LanguageStringMap contents; + + public static final String SERIALIZED_NAME_HEADINGS = "headings"; + @SerializedName(SERIALIZED_NAME_HEADINGS) + private LanguageStringMap headings; + + public static final String SERIALIZED_NAME_STALE_DATE = "stale_date"; + @SerializedName(SERIALIZED_NAME_STALE_DATE) + private Integer staleDate; + + public static final String SERIALIZED_NAME_PRIORITY = "priority"; + @SerializedName(SERIALIZED_NAME_PRIORITY) + private Integer priority; + + public static final String SERIALIZED_NAME_IOS_RELEVANCE_SCORE = "ios_relevance_score"; + @SerializedName(SERIALIZED_NAME_IOS_RELEVANCE_SCORE) + private BigDecimal iosRelevanceScore; + + public static final String SERIALIZED_NAME_IDEMPOTENCY_KEY = "idempotency_key"; + @SerializedName(SERIALIZED_NAME_IDEMPOTENCY_KEY) + private String idempotencyKey; + + public static final String SERIALIZED_NAME_INCLUDE_ALIASES = "include_aliases"; + @SerializedName(SERIALIZED_NAME_INCLUDE_ALIASES) + private Map> includeAliases = null; + + public static final String SERIALIZED_NAME_INCLUDE_SUBSCRIPTION_IDS = "include_subscription_ids"; + @SerializedName(SERIALIZED_NAME_INCLUDE_SUBSCRIPTION_IDS) + private List includeSubscriptionIds = null; + + 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_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private List filters = null; + + public StartLiveActivityRequest() { + } + + public StartLiveActivityRequest name(String name) { + + this.name = name; + return this; + } + + /** + * An internal name to assist with your campaign organization. This does not get displayed in the message itself. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An internal name to assist with your campaign organization. This does not get displayed in the message itself.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public StartLiveActivityRequest event(EventEnum event) { + + this.event = event; + return this; + } + + /** + * Get event + * @return event + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public EventEnum getEvent() { + return event; + } + + + public void setEvent(EventEnum event) { + this.event = event; + } + + + public StartLiveActivityRequest activityId(String activityId) { + + this.activityId = activityId; + return this; + } + + /** + * Set a unique activity_id to track and manage the Live Activity. + * @return activityId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Set a unique activity_id to track and manage the Live Activity.") + + public String getActivityId() { + return activityId; + } + + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + + public StartLiveActivityRequest eventAttributes(Object eventAttributes) { + + this.eventAttributes = eventAttributes; + return this; + } + + /** + * Default/static data to initialize the Live Activity upon start. + * @return eventAttributes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Default/static data to initialize the Live Activity upon start.") + + public Object getEventAttributes() { + return eventAttributes; + } + + + public void setEventAttributes(Object eventAttributes) { + this.eventAttributes = eventAttributes; + } + + + public StartLiveActivityRequest eventUpdates(Object eventUpdates) { + + this.eventUpdates = eventUpdates; + return this; + } + + /** + * Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. + * @return eventUpdates + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app.") + + public Object getEventUpdates() { + return eventUpdates; + } + + + public void setEventUpdates(Object eventUpdates) { + this.eventUpdates = eventUpdates; + } + + + public StartLiveActivityRequest contents(LanguageStringMap contents) { + + this.contents = contents; + return this; + } + + /** + * Get contents + * @return contents + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public LanguageStringMap getContents() { + return contents; + } + + + public void setContents(LanguageStringMap contents) { + this.contents = contents; + } + + + public StartLiveActivityRequest headings(LanguageStringMap headings) { + + this.headings = headings; + return this; + } + + /** + * Get headings + * @return headings + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public LanguageStringMap getHeadings() { + return headings; + } + + + public void setHeadings(LanguageStringMap headings) { + this.headings = headings; + } + + + public StartLiveActivityRequest staleDate(Integer staleDate) { + + this.staleDate = staleDate; + return this; + } + + /** + * Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. + * @return staleDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.") + + public Integer getStaleDate() { + return staleDate; + } + + + public void setStaleDate(Integer staleDate) { + this.staleDate = staleDate; + } + + + public StartLiveActivityRequest priority(Integer priority) { + + this.priority = priority; + return this; + } + + /** + * Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. + * @return priority + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10.") + + public Integer getPriority() { + return priority; + } + + + public void setPriority(Integer priority) { + this.priority = priority; + } + + + public StartLiveActivityRequest iosRelevanceScore(BigDecimal iosRelevanceScore) { + + this.iosRelevanceScore = iosRelevanceScore; + return this; + } + + /** + * iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. + * @return iosRelevanceScore + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1.") + + public BigDecimal getIosRelevanceScore() { + return iosRelevanceScore; + } + + + public void setIosRelevanceScore(BigDecimal iosRelevanceScore) { + this.iosRelevanceScore = iosRelevanceScore; + } + + + public StartLiveActivityRequest idempotencyKey(String idempotencyKey) { + + this.idempotencyKey = idempotencyKey; + return this; + } + + /** + * Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true + * @return idempotencyKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true ") + + public String getIdempotencyKey() { + return idempotencyKey; + } + + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + + public StartLiveActivityRequest includeAliases(Map> includeAliases) { + + this.includeAliases = includeAliases; + return this; + } + + public StartLiveActivityRequest 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\"] } 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\"] } 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 StartLiveActivityRequest includeSubscriptionIds(List includeSubscriptionIds) { + + this.includeSubscriptionIds = includeSubscriptionIds; + return this; + } + + public StartLiveActivityRequest addIncludeSubscriptionIdsItem(String includeSubscriptionIdsItem) { + if (this.includeSubscriptionIds == null) { + this.includeSubscriptionIds = new ArrayList<>(); + } + this.includeSubscriptionIds.add(includeSubscriptionIdsItem); + return this; + } + + /** + * Specific subscription ids to target. Not compatible with other targeting parameters. + * @return includeSubscriptionIds + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Specific subscription ids to target. Not compatible with other targeting parameters.") + + public List getIncludeSubscriptionIds() { + return includeSubscriptionIds; + } + + + public void setIncludeSubscriptionIds(List includeSubscriptionIds) { + this.includeSubscriptionIds = includeSubscriptionIds; + } + + + public StartLiveActivityRequest includedSegments(List includedSegments) { + + this.includedSegments = includedSegments; + return this; + } + + public StartLiveActivityRequest addIncludedSegmentsItem(String includedSegmentsItem) { + if (this.includedSegments == null) { + this.includedSegments = new ArrayList<>(); + } + this.includedSegments.add(includedSegmentsItem); + return this; + } + + /** + * Segment names to include. Only compatible with excluded_segments. + * @return includedSegments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Segment names to include. Only compatible with excluded_segments.") + + public List getIncludedSegments() { + return includedSegments; + } + + + public void setIncludedSegments(List includedSegments) { + this.includedSegments = includedSegments; + } + + + public StartLiveActivityRequest excludedSegments(List excludedSegments) { + + this.excludedSegments = excludedSegments; + return this; + } + + public StartLiveActivityRequest addExcludedSegmentsItem(String excludedSegmentsItem) { + if (this.excludedSegments == null) { + this.excludedSegments = new ArrayList<>(); + } + this.excludedSegments.add(excludedSegmentsItem); + return this; + } + + /** + * Segment names to exclude. Only compatible with included_segments. + * @return excludedSegments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Segment names to exclude. Only compatible with included_segments.") + + public List getExcludedSegments() { + return excludedSegments; + } + + + public void setExcludedSegments(List excludedSegments) { + this.excludedSegments = excludedSegments; + } + + + public StartLiveActivityRequest filters(List filters) { + + this.filters = filters; + return this; + } + + public StartLiveActivityRequest 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; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartLiveActivityRequest startLiveActivityRequest = (StartLiveActivityRequest) o; + return Objects.equals(this.name, startLiveActivityRequest.name) && + Objects.equals(this.event, startLiveActivityRequest.event) && + Objects.equals(this.activityId, startLiveActivityRequest.activityId) && + Objects.equals(this.eventAttributes, startLiveActivityRequest.eventAttributes) && + Objects.equals(this.eventUpdates, startLiveActivityRequest.eventUpdates) && + Objects.equals(this.contents, startLiveActivityRequest.contents) && + Objects.equals(this.headings, startLiveActivityRequest.headings) && + Objects.equals(this.staleDate, startLiveActivityRequest.staleDate) && + Objects.equals(this.priority, startLiveActivityRequest.priority) && + Objects.equals(this.iosRelevanceScore, startLiveActivityRequest.iosRelevanceScore) && + Objects.equals(this.idempotencyKey, startLiveActivityRequest.idempotencyKey) && + Objects.equals(this.includeAliases, startLiveActivityRequest.includeAliases) && + Objects.equals(this.includeSubscriptionIds, startLiveActivityRequest.includeSubscriptionIds) && + Objects.equals(this.includedSegments, startLiveActivityRequest.includedSegments) && + Objects.equals(this.excludedSegments, startLiveActivityRequest.excludedSegments) && + Objects.equals(this.filters, startLiveActivityRequest.filters); + } + + 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(name, event, activityId, eventAttributes, eventUpdates, contents, headings, staleDate, priority, iosRelevanceScore, idempotencyKey, includeAliases, includeSubscriptionIds, includedSegments, excludedSegments, filters); + } + + 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 StartLiveActivityRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" activityId: ").append(toIndentedString(activityId)).append("\n"); + sb.append(" eventAttributes: ").append(toIndentedString(eventAttributes)).append("\n"); + sb.append(" eventUpdates: ").append(toIndentedString(eventUpdates)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" headings: ").append(toIndentedString(headings)).append("\n"); + sb.append(" staleDate: ").append(toIndentedString(staleDate)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" iosRelevanceScore: ").append(toIndentedString(iosRelevanceScore)).append("\n"); + sb.append(" idempotencyKey: ").append(toIndentedString(idempotencyKey)).append("\n"); + sb.append(" includeAliases: ").append(toIndentedString(includeAliases)).append("\n"); + sb.append(" includeSubscriptionIds: ").append(toIndentedString(includeSubscriptionIds)).append("\n"); + sb.append(" includedSegments: ").append(toIndentedString(includedSegments)).append("\n"); + sb.append(" excludedSegments: ").append(toIndentedString(excludedSegments)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).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("name"); + openapiFields.add("event"); + openapiFields.add("activity_id"); + openapiFields.add("event_attributes"); + openapiFields.add("event_updates"); + openapiFields.add("contents"); + openapiFields.add("headings"); + openapiFields.add("stale_date"); + openapiFields.add("priority"); + openapiFields.add("ios_relevance_score"); + openapiFields.add("idempotency_key"); + openapiFields.add("include_aliases"); + openapiFields.add("include_subscription_ids"); + openapiFields.add("included_segments"); + openapiFields.add("excluded_segments"); + openapiFields.add("filters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("event"); + openapiRequiredFields.add("activity_id"); + openapiRequiredFields.add("event_attributes"); + openapiRequiredFields.add("event_updates"); + openapiRequiredFields.add("contents"); + openapiRequiredFields.add("headings"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartLiveActivityRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartLiveActivityRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartLiveActivityRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartLiveActivityRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartLiveActivityRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartLiveActivityRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartLiveActivityRequest + * @throws IOException if the JSON string is invalid with respect to StartLiveActivityRequest + */ + public static StartLiveActivityRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartLiveActivityRequest.class); + } + + /** + * Convert an instance of StartLiveActivityRequest 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/StartLiveActivitySuccessResponse.java b/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java new file mode 100644 index 0000000..64d18cc --- /dev/null +++ b/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java @@ -0,0 +1,185 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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; + +/** + * StartLiveActivitySuccessResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartLiveActivitySuccessResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NOTIFICATION_ID = "notification_id"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_ID) + private String notificationId; + + public StartLiveActivitySuccessResponse() { + } + + public StartLiveActivitySuccessResponse notificationId(String notificationId) { + + this.notificationId = notificationId; + return this; + } + + /** + * Get notificationId + * @return notificationId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getNotificationId() { + return notificationId; + } + + + public void setNotificationId(String notificationId) { + this.notificationId = notificationId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartLiveActivitySuccessResponse startLiveActivitySuccessResponse = (StartLiveActivitySuccessResponse) o; + return Objects.equals(this.notificationId, startLiveActivitySuccessResponse.notificationId); + } + + @Override + public int hashCode() { + return Objects.hash(notificationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartLiveActivitySuccessResponse {\n"); + sb.append(" notificationId: ").append(toIndentedString(notificationId)).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("notification_id"); + + // 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 (!StartLiveActivitySuccessResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartLiveActivitySuccessResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartLiveActivitySuccessResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartLiveActivitySuccessResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartLiveActivitySuccessResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartLiveActivitySuccessResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartLiveActivitySuccessResponse + * @throws IOException if the JSON string is invalid with respect to StartLiveActivitySuccessResponse + */ + public static StartLiveActivitySuccessResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartLiveActivitySuccessResponse.class); + } + + /** + * Convert an instance of StartLiveActivitySuccessResponse 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/Subscription.java b/src/main/java/com/onesignal/client/model/Subscription.java index c9a0a71..8eda6a5 100644 --- a/src/main/java/com/onesignal/client/model/Subscription.java +++ b/src/main/java/com/onesignal/client/model/Subscription.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SubscriptionBody.java b/src/main/java/com/onesignal/client/model/SubscriptionBody.java index 2e7e39f..b04d0a0 100644 --- a/src/main/java/com/onesignal/client/model/SubscriptionBody.java +++ b/src/main/java/com/onesignal/client/model/SubscriptionBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java b/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java index df77ad0..7db29ab 100644 --- a/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/TemplateResource.java b/src/main/java/com/onesignal/client/model/TemplateResource.java new file mode 100644 index 0000000..d495475 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/TemplateResource.java @@ -0,0 +1,408 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.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; + +/** + * TemplateResource + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TemplateResource { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + /** + * Gets or Sets channel + */ + @JsonAdapter(ChannelEnum.Adapter.class) + public enum ChannelEnum { + PUSH("push"), + + EMAIL("email"), + + SMS("sms"); + + private String value; + + ChannelEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChannelEnum fromValue(String value) { + for (ChannelEnum b : ChannelEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChannelEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChannelEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChannelEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CHANNEL = "channel"; + @SerializedName(SERIALIZED_NAME_CHANNEL) + private ChannelEnum channel; + + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private Map content = null; + + public TemplateResource() { + } + + public TemplateResource id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TemplateResource name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public TemplateResource createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public TemplateResource updatedAt(OffsetDateTime updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public TemplateResource channel(ChannelEnum channel) { + + this.channel = channel; + return this; + } + + /** + * Get channel + * @return channel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ChannelEnum getChannel() { + return channel; + } + + + public void setChannel(ChannelEnum channel) { + this.channel = channel; + } + + + public TemplateResource content(Map content) { + + this.content = content; + return this; + } + + public TemplateResource putContentItem(String key, Object contentItem) { + if (this.content == null) { + this.content = new HashMap<>(); + } + this.content.put(key, contentItem); + return this; + } + + /** + * Rendered content and channel/platform flags for the template. + * @return content + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Rendered content and channel/platform flags for the template.") + + public Map getContent() { + return content; + } + + + public void setContent(Map content) { + this.content = content; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResource templateResource = (TemplateResource) o; + return Objects.equals(this.id, templateResource.id) && + Objects.equals(this.name, templateResource.name) && + Objects.equals(this.createdAt, templateResource.createdAt) && + Objects.equals(this.updatedAt, templateResource.updatedAt) && + Objects.equals(this.channel, templateResource.channel) && + Objects.equals(this.content, templateResource.content); + } + + 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(id, name, createdAt, updatedAt, channel, content); + } + + 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 TemplateResource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" channel: ").append(toIndentedString(channel)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("channel"); + openapiFields.add("content"); + + // 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 (!TemplateResource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TemplateResource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TemplateResource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TemplateResource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TemplateResource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TemplateResource given an JSON string + * + * @param jsonString JSON string + * @return An instance of TemplateResource + * @throws IOException if the JSON string is invalid with respect to TemplateResource + */ + public static TemplateResource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TemplateResource.class); + } + + /** + * Convert an instance of TemplateResource 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/TemplatesListResponse.java b/src/main/java/com/onesignal/client/model/TemplatesListResponse.java new file mode 100644 index 0000000..fb03e14 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/TemplatesListResponse.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 + * + * The version of the OpenAPI document: 5.3.0 + * 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.TemplateResource; +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; + +/** + * TemplatesListResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TemplatesListResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_TEMPLATES = "templates"; + @SerializedName(SERIALIZED_NAME_TEMPLATES) + private List templates = null; + + public TemplatesListResponse() { + } + + public TemplatesListResponse templates(List templates) { + + this.templates = templates; + return this; + } + + public TemplatesListResponse addTemplatesItem(TemplateResource templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); + } + this.templates.add(templatesItem); + return this; + } + + /** + * Get templates + * @return templates + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getTemplates() { + return templates; + } + + + public void setTemplates(List templates) { + this.templates = templates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplatesListResponse templatesListResponse = (TemplatesListResponse) o; + return Objects.equals(this.templates, templatesListResponse.templates); + } + + @Override + public int hashCode() { + return Objects.hash(templates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplatesListResponse {\n"); + sb.append(" templates: ").append(toIndentedString(templates)).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("templates"); + + // 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 (!TemplatesListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TemplatesListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TemplatesListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TemplatesListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TemplatesListResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TemplatesListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TemplatesListResponse + * @throws IOException if the JSON string is invalid with respect to TemplatesListResponse + */ + public static TemplatesListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TemplatesListResponse.class); + } + + /** + * Convert an instance of TemplatesListResponse 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/TransferSubscriptionRequestBody.java b/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java index e2a0ff4..3198ebd 100644 --- a/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java +++ b/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java b/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java new file mode 100644 index 0000000..0de00a8 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java @@ -0,0 +1,302 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.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; + +/** + * UpdateApiKeyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateApiKeyRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Gets or Sets ipAllowlistMode + */ + @JsonAdapter(IpAllowlistModeEnum.Adapter.class) + public enum IpAllowlistModeEnum { + DISABLED("disabled"), + + EXPLICIT("explicit"); + + private String value; + + IpAllowlistModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IpAllowlistModeEnum fromValue(String value) { + for (IpAllowlistModeEnum b : IpAllowlistModeEnum.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 IpAllowlistModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IpAllowlistModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IpAllowlistModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_IP_ALLOWLIST_MODE = "ip_allowlist_mode"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST_MODE) + private IpAllowlistModeEnum ipAllowlistMode; + + public static final String SERIALIZED_NAME_IP_ALLOWLIST = "ip_allowlist"; + @SerializedName(SERIALIZED_NAME_IP_ALLOWLIST) + private List ipAllowlist = null; + + public UpdateApiKeyRequest() { + } + + public UpdateApiKeyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateApiKeyRequest ipAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + + this.ipAllowlistMode = ipAllowlistMode; + return this; + } + + /** + * Get ipAllowlistMode + * @return ipAllowlistMode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public IpAllowlistModeEnum getIpAllowlistMode() { + return ipAllowlistMode; + } + + + public void setIpAllowlistMode(IpAllowlistModeEnum ipAllowlistMode) { + this.ipAllowlistMode = ipAllowlistMode; + } + + + public UpdateApiKeyRequest ipAllowlist(List ipAllowlist) { + + this.ipAllowlist = ipAllowlist; + return this; + } + + public UpdateApiKeyRequest addIpAllowlistItem(String ipAllowlistItem) { + if (this.ipAllowlist == null) { + this.ipAllowlist = new ArrayList<>(); + } + this.ipAllowlist.add(ipAllowlistItem); + return this; + } + + /** + * Get ipAllowlist + * @return ipAllowlist + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getIpAllowlist() { + return ipAllowlist; + } + + + public void setIpAllowlist(List ipAllowlist) { + this.ipAllowlist = ipAllowlist; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyRequest updateApiKeyRequest = (UpdateApiKeyRequest) o; + return Objects.equals(this.name, updateApiKeyRequest.name) && + Objects.equals(this.ipAllowlistMode, updateApiKeyRequest.ipAllowlistMode) && + Objects.equals(this.ipAllowlist, updateApiKeyRequest.ipAllowlist); + } + + @Override + public int hashCode() { + return Objects.hash(name, ipAllowlistMode, ipAllowlist); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateApiKeyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ipAllowlistMode: ").append(toIndentedString(ipAllowlistMode)).append("\n"); + sb.append(" ipAllowlist: ").append(toIndentedString(ipAllowlist)).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("name"); + openapiFields.add("ip_allowlist_mode"); + openapiFields.add("ip_allowlist"); + + // 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 (!UpdateApiKeyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateApiKeyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateApiKeyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateApiKeyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateApiKeyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateApiKeyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateApiKeyRequest + * @throws IOException if the JSON string is invalid with respect to UpdateApiKeyRequest + */ + public static UpdateApiKeyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateApiKeyRequest.class); + } + + /** + * Convert an instance of UpdateApiKeyRequest 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/UpdateLiveActivityRequest.java b/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java index bdb2b49..eed6cd3 100644 --- a/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java b/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java index 13b2ea7..7ef2828 100644 --- a/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java b/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java new file mode 100644 index 0000000..7b93ecd --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java @@ -0,0 +1,378 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.3.0 + * 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.LanguageStringMap; +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; + +/** + * UpdateTemplateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateTemplateRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CONTENTS = "contents"; + @SerializedName(SERIALIZED_NAME_CONTENTS) + private LanguageStringMap contents; + + public static final String SERIALIZED_NAME_IS_EMAIL = "isEmail"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL) + private Boolean isEmail; + + public static final String SERIALIZED_NAME_EMAIL_SUBJECT = "email_subject"; + @SerializedName(SERIALIZED_NAME_EMAIL_SUBJECT) + private String emailSubject; + + public static final String SERIALIZED_NAME_EMAIL_BODY = "email_body"; + @SerializedName(SERIALIZED_NAME_EMAIL_BODY) + private String emailBody; + + public static final String SERIALIZED_NAME_IS_S_M_S = "isSMS"; + @SerializedName(SERIALIZED_NAME_IS_S_M_S) + private Boolean isSMS; + + public static final String SERIALIZED_NAME_DYNAMIC_CONTENT = "dynamic_content"; + @SerializedName(SERIALIZED_NAME_DYNAMIC_CONTENT) + private String dynamicContent; + + public UpdateTemplateRequest() { + } + + public UpdateTemplateRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Updated name of the template. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Updated name of the template.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateTemplateRequest contents(LanguageStringMap contents) { + + this.contents = contents; + return this; + } + + /** + * Get contents + * @return contents + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public LanguageStringMap getContents() { + return contents; + } + + + public void setContents(LanguageStringMap contents) { + this.contents = contents; + } + + + public UpdateTemplateRequest isEmail(Boolean isEmail) { + + this.isEmail = isEmail; + return this; + } + + /** + * Set true for an Email template. + * @return isEmail + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Set true for an Email template.") + + public Boolean getIsEmail() { + return isEmail; + } + + + public void setIsEmail(Boolean isEmail) { + this.isEmail = isEmail; + } + + + public UpdateTemplateRequest emailSubject(String emailSubject) { + + this.emailSubject = emailSubject; + return this; + } + + /** + * Subject of the email. + * @return emailSubject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Subject of the email.") + + public String getEmailSubject() { + return emailSubject; + } + + + public void setEmailSubject(String emailSubject) { + this.emailSubject = emailSubject; + } + + + public UpdateTemplateRequest emailBody(String emailBody) { + + this.emailBody = emailBody; + return this; + } + + /** + * Body of the email (HTML supported). + * @return emailBody + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Body of the email (HTML supported).") + + public String getEmailBody() { + return emailBody; + } + + + public void setEmailBody(String emailBody) { + this.emailBody = emailBody; + } + + + public UpdateTemplateRequest isSMS(Boolean isSMS) { + + this.isSMS = isSMS; + return this; + } + + /** + * Set true for an SMS template. + * @return isSMS + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Set true for an SMS template.") + + public Boolean getIsSMS() { + return isSMS; + } + + + public void setIsSMS(Boolean isSMS) { + this.isSMS = isSMS; + } + + + public UpdateTemplateRequest dynamicContent(String dynamicContent) { + + this.dynamicContent = dynamicContent; + return this; + } + + /** + * JSON string for dynamic content personalization. + * @return dynamicContent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "JSON string for dynamic content personalization.") + + public String getDynamicContent() { + return dynamicContent; + } + + + public void setDynamicContent(String dynamicContent) { + this.dynamicContent = dynamicContent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTemplateRequest updateTemplateRequest = (UpdateTemplateRequest) o; + return Objects.equals(this.name, updateTemplateRequest.name) && + Objects.equals(this.contents, updateTemplateRequest.contents) && + Objects.equals(this.isEmail, updateTemplateRequest.isEmail) && + Objects.equals(this.emailSubject, updateTemplateRequest.emailSubject) && + Objects.equals(this.emailBody, updateTemplateRequest.emailBody) && + Objects.equals(this.isSMS, updateTemplateRequest.isSMS) && + Objects.equals(this.dynamicContent, updateTemplateRequest.dynamicContent); + } + + 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(name, contents, isEmail, emailSubject, emailBody, isSMS, dynamicContent); + } + + 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 UpdateTemplateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" isEmail: ").append(toIndentedString(isEmail)).append("\n"); + sb.append(" emailSubject: ").append(toIndentedString(emailSubject)).append("\n"); + sb.append(" emailBody: ").append(toIndentedString(emailBody)).append("\n"); + sb.append(" isSMS: ").append(toIndentedString(isSMS)).append("\n"); + sb.append(" dynamicContent: ").append(toIndentedString(dynamicContent)).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("name"); + openapiFields.add("contents"); + openapiFields.add("isEmail"); + openapiFields.add("email_subject"); + openapiFields.add("email_body"); + openapiFields.add("isSMS"); + openapiFields.add("dynamic_content"); + + // 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 (!UpdateTemplateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTemplateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateTemplateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTemplateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTemplateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTemplateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTemplateRequest + * @throws IOException if the JSON string is invalid with respect to UpdateTemplateRequest + */ + public static UpdateTemplateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTemplateRequest.class); + } + + /** + * Convert an instance of UpdateTemplateRequest 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/UpdateUserRequest.java b/src/main/java/com/onesignal/client/model/UpdateUserRequest.java index 4775d27..d4d4bff 100644 --- a/src/main/java/com/onesignal/client/model/UpdateUserRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateUserRequest.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/User.java b/src/main/java/com/onesignal/client/model/User.java index fcd94ff..547f81d 100644 --- a/src/main/java/com/onesignal/client/model/User.java +++ b/src/main/java/com/onesignal/client/model/User.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UserIdentityBody.java b/src/main/java/com/onesignal/client/model/UserIdentityBody.java index 65792c7..f0f6c59 100644 --- a/src/main/java/com/onesignal/client/model/UserIdentityBody.java +++ b/src/main/java/com/onesignal/client/model/UserIdentityBody.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/WebButton.java b/src/main/java/com/onesignal/client/model/WebButton.java index f981a74..e05341b 100644 --- a/src/main/java/com/onesignal/client/model/WebButton.java +++ b/src/main/java/com/onesignal/client/model/WebButton.java @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.2.1 + * The version of the OpenAPI document: 5.3.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).