From 767381d6942cff6e52984078517ea1824d3c79c2 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 26 Apr 2022 05:37:53 +0000 Subject: [PATCH] Update Java API --- .gitignore | 22 + LICENSE | 24 + README.md | 2 +- api/openapi.yaml | 2675 ++++++++++++ build.gradle | 153 + build.sbt | 27 + docs/App.md | 51 + docs/Button.md | 15 + docs/DefaultApi.md | 1351 ++++++ docs/DeliveryData.md | 17 + docs/ExportPlayersRequestBody.md | 15 + docs/Filter.md | 31 + docs/FilterExpressions.md | 41 + docs/FilterNotificationTarget.md | 24 + docs/GetNotificationRequestBody.md | 24 + docs/InlineResponse200.md | 16 + docs/InlineResponse2001.md | 13 + docs/InlineResponse2002.md | 14 + docs/InlineResponse2003.md | 13 + docs/InlineResponse2004.md | 14 + docs/InlineResponse2005.md | 13 + docs/InlineResponse201.md | 14 + docs/InlineResponse400.md | 13 + docs/InlineResponse4001.md | 14 + docs/InlineResponse4002.md | 14 + docs/InlineResponse4003.md | 13 + docs/InvalidIdentifierError.md | 14 + docs/Notification.md | 133 + docs/Notification200Errors.md | 14 + docs/NotificationAllOf.md | 109 + ...otificationAllOfAndroidBackgroundLayout.md | 16 + docs/NotificationSlice.md | 16 + docs/NotificationTarget.md | 36 + docs/Operator.md | 22 + docs/OutcomeData.md | 24 + docs/OutcomesData.md | 13 + docs/PlatformDeliveryData.md | 19 + docs/Player.md | 39 + docs/PlayerNotificationTarget.md | 22 + docs/PlayerSlice.md | 16 + docs/Purchase.md | 15 + docs/Segment.md | 15 + docs/SegmentNotificationTarget.md | 14 + docs/StringMap.md | 55 + docs/UpdatePlayerTagsRequestBody.md | 13 + gradle.properties | 6 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59536 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 234 ++ gradlew.bat | 89 + pom.xml | 341 ++ settings.gradle | 1 + src/main/AndroidManifest.xml | 3 + .../com/onesignal/client/ApiCallback.java | 62 + .../java/com/onesignal/client/ApiClient.java | 1476 +++++++ .../com/onesignal/client/ApiException.java | 156 + .../com/onesignal/client/ApiResponse.java | 76 + .../com/onesignal/client/Configuration.java | 39 + .../client/GzipRequestInterceptor.java | 85 + src/main/java/com/onesignal/client/JSON.java | 438 ++ src/main/java/com/onesignal/client/Pair.java | 57 + .../onesignal/client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../onesignal/client/ServerConfiguration.java | 58 + .../com/onesignal/client/ServerVariable.java | 23 + .../java/com/onesignal/client/StringUtil.java | 83 + .../com/onesignal/client/api/DefaultApi.java | 2801 +++++++++++++ .../com/onesignal/client/auth/ApiKeyAuth.java | 80 + .../onesignal/client/auth/Authentication.java | 36 + .../onesignal/client/auth/HttpBasicAuth.java | 57 + .../onesignal/client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 + .../java/com/onesignal/client/model/App.java | 1019 +++++ .../com/onesignal/client/model/Button.java | 246 ++ .../onesignal/client/model/DeliveryData.java | 305 ++ .../model/ExportPlayersRequestBody.java | 255 ++ .../com/onesignal/client/model/Filter.java | 336 ++ .../client/model/FilterExpressions.java | 245 ++ .../model/FilterNotificationTarget.java | 515 +++ .../model/GetNotificationRequestBody.java | 292 ++ .../client/model/InlineResponse200.java | 278 ++ .../client/model/InlineResponse2001.java | 185 + .../client/model/InlineResponse2002.java | 215 + .../client/model/InlineResponse2003.java | 185 + .../client/model/InlineResponse2004.java | 215 + .../client/model/InlineResponse2005.java | 185 + .../client/model/InlineResponse201.java | 215 + .../client/model/InlineResponse400.java | 195 + .../client/model/InlineResponse4001.java | 225 + .../client/model/InlineResponse4002.java | 225 + .../client/model/InlineResponse4003.java | 195 + .../client/model/InvalidIdentifierError.java | 233 ++ .../onesignal/client/model/Notification.java | 3694 +++++++++++++++++ .../client/model/Notification200Errors.java | 226 + .../client/model/NotificationAllOf.java | 2875 +++++++++++++ ...ificationAllOfAndroidBackgroundLayout.java | 246 ++ .../client/model/NotificationSlice.java | 286 ++ .../client/model/NotificationTarget.java | 291 ++ .../com/onesignal/client/model/Operator.java | 232 ++ .../onesignal/client/model/OutcomeData.java | 295 ++ .../onesignal/client/model/OutcomesData.java | 196 + .../client/model/PlatformDeliveryData.java | 337 ++ .../com/onesignal/client/model/Player.java | 961 +++++ .../model/PlayerNotificationTarget.java | 537 +++ .../onesignal/client/model/PlayerSlice.java | 286 ++ .../com/onesignal/client/model/Purchase.java | 249 ++ .../com/onesignal/client/model/Segment.java | 255 ++ .../model/SegmentNotificationTarget.java | 233 ++ .../com/onesignal/client/model/StringMap.java | 1446 +++++++ .../model/UpdatePlayerTagsRequestBody.java | 185 + 110 files changed, 30382 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 api/openapi.yaml create mode 100644 build.gradle create mode 100644 build.sbt create mode 100644 docs/App.md create mode 100644 docs/Button.md create mode 100644 docs/DefaultApi.md create mode 100644 docs/DeliveryData.md create mode 100644 docs/ExportPlayersRequestBody.md create mode 100644 docs/Filter.md create mode 100644 docs/FilterExpressions.md create mode 100644 docs/FilterNotificationTarget.md create mode 100644 docs/GetNotificationRequestBody.md create mode 100644 docs/InlineResponse200.md create mode 100644 docs/InlineResponse2001.md create mode 100644 docs/InlineResponse2002.md create mode 100644 docs/InlineResponse2003.md create mode 100644 docs/InlineResponse2004.md create mode 100644 docs/InlineResponse2005.md create mode 100644 docs/InlineResponse201.md create mode 100644 docs/InlineResponse400.md create mode 100644 docs/InlineResponse4001.md create mode 100644 docs/InlineResponse4002.md create mode 100644 docs/InlineResponse4003.md create mode 100644 docs/InvalidIdentifierError.md create mode 100644 docs/Notification.md create mode 100644 docs/Notification200Errors.md create mode 100644 docs/NotificationAllOf.md create mode 100644 docs/NotificationAllOfAndroidBackgroundLayout.md create mode 100644 docs/NotificationSlice.md create mode 100644 docs/NotificationTarget.md create mode 100644 docs/Operator.md create mode 100644 docs/OutcomeData.md create mode 100644 docs/OutcomesData.md create mode 100644 docs/PlatformDeliveryData.md create mode 100644 docs/Player.md create mode 100644 docs/PlayerNotificationTarget.md create mode 100644 docs/PlayerSlice.md create mode 100644 docs/Purchase.md create mode 100644 docs/Segment.md create mode 100644 docs/SegmentNotificationTarget.md create mode 100644 docs/StringMap.md create mode 100644 docs/UpdatePlayerTagsRequestBody.md create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 pom.xml create mode 100644 settings.gradle create mode 100644 src/main/AndroidManifest.xml create mode 100644 src/main/java/com/onesignal/client/ApiCallback.java create mode 100644 src/main/java/com/onesignal/client/ApiClient.java create mode 100644 src/main/java/com/onesignal/client/ApiException.java create mode 100644 src/main/java/com/onesignal/client/ApiResponse.java create mode 100644 src/main/java/com/onesignal/client/Configuration.java create mode 100644 src/main/java/com/onesignal/client/GzipRequestInterceptor.java create mode 100644 src/main/java/com/onesignal/client/JSON.java create mode 100644 src/main/java/com/onesignal/client/Pair.java create mode 100644 src/main/java/com/onesignal/client/ProgressRequestBody.java create mode 100644 src/main/java/com/onesignal/client/ProgressResponseBody.java create mode 100644 src/main/java/com/onesignal/client/ServerConfiguration.java create mode 100644 src/main/java/com/onesignal/client/ServerVariable.java create mode 100644 src/main/java/com/onesignal/client/StringUtil.java create mode 100644 src/main/java/com/onesignal/client/api/DefaultApi.java create mode 100644 src/main/java/com/onesignal/client/auth/ApiKeyAuth.java create mode 100644 src/main/java/com/onesignal/client/auth/Authentication.java create mode 100644 src/main/java/com/onesignal/client/auth/HttpBasicAuth.java create mode 100644 src/main/java/com/onesignal/client/auth/HttpBearerAuth.java create mode 100644 src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/onesignal/client/model/App.java create mode 100644 src/main/java/com/onesignal/client/model/Button.java create mode 100644 src/main/java/com/onesignal/client/model/DeliveryData.java create mode 100644 src/main/java/com/onesignal/client/model/ExportPlayersRequestBody.java create mode 100644 src/main/java/com/onesignal/client/model/Filter.java create mode 100644 src/main/java/com/onesignal/client/model/FilterExpressions.java create mode 100644 src/main/java/com/onesignal/client/model/FilterNotificationTarget.java create mode 100644 src/main/java/com/onesignal/client/model/GetNotificationRequestBody.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse200.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse2001.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse2002.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse2003.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse2004.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse2005.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse201.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse400.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse4001.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse4002.java create mode 100644 src/main/java/com/onesignal/client/model/InlineResponse4003.java create mode 100644 src/main/java/com/onesignal/client/model/InvalidIdentifierError.java create mode 100644 src/main/java/com/onesignal/client/model/Notification.java create mode 100644 src/main/java/com/onesignal/client/model/Notification200Errors.java create mode 100644 src/main/java/com/onesignal/client/model/NotificationAllOf.java create mode 100644 src/main/java/com/onesignal/client/model/NotificationAllOfAndroidBackgroundLayout.java create mode 100644 src/main/java/com/onesignal/client/model/NotificationSlice.java create mode 100644 src/main/java/com/onesignal/client/model/NotificationTarget.java create mode 100644 src/main/java/com/onesignal/client/model/Operator.java create mode 100644 src/main/java/com/onesignal/client/model/OutcomeData.java create mode 100644 src/main/java/com/onesignal/client/model/OutcomesData.java create mode 100644 src/main/java/com/onesignal/client/model/PlatformDeliveryData.java create mode 100644 src/main/java/com/onesignal/client/model/Player.java create mode 100644 src/main/java/com/onesignal/client/model/PlayerNotificationTarget.java create mode 100644 src/main/java/com/onesignal/client/model/PlayerSlice.java create mode 100644 src/main/java/com/onesignal/client/model/Purchase.java create mode 100644 src/main/java/com/onesignal/client/model/Segment.java create mode 100644 src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java create mode 100644 src/main/java/com/onesignal/client/model/StringMap.java create mode 100644 src/main/java/com/onesignal/client/model/UpdatePlayerTagsRequestBody.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3df4d8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build +src/test diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..48fd45d --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Modified MIT License + +Copyright 2022 OneSignal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +2. All copies of substantial portions of the Software may only be used in connection +with services provided by OneSignal. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 2007945..973fd3b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ OneSignal - API version: 1.0.2 - - Build date: 2022-04-25T12:25:49.025-07:00[America/Los_Angeles] + - Build date: 2022-04-26T05:37:43.612Z[Etc/UTC] A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..65868f9 --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,2675 @@ +openapi: 3.0.0 +info: + contact: + email: devrel@onesignal.com + name: OneSignal DevRel + url: https://onesignal.com + description: A powerful way to send personalized messages at scale and build effective + customer engagement strategies. Learn more at onesignal.com + termsOfService: https://onesignal.com/tos + title: OneSignal + version: 1.0.2 +servers: +- url: https://onesignal.com/api/v1 +paths: + /notifications: + get: + description: View the details of multiple notifications + operationId: get_notifications + parameters: + - description: The app ID that you want to view notifications from + explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - description: How many notifications to return. Max is 50. Default is 50. + explode: true + in: query + name: limit + required: false + schema: + type: string + style: form + - description: 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. + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + - description: | + Kind of notifications returned: + * unset - All notification types (default) + * `0` - Dashboard only + * `1` - API only + * `3` - Automated only + explode: true + in: query + name: kind + required: false + schema: + enum: + - 0 + - 1 + - 3 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationSlice' + description: OK + security: + - app_key: [] + summary: View notifications + x-accepts: application/json + post: + description: | + Sends notifications to your users + operationId: create_notification + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Notification' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: "OK, invalid_player_ids, invalid_external_user_ids or No Subscribed\ + \ Players\nIf a message was successfully created, you will get a 200 response\ + \ and an id for the notification.\nIf the 200 response contains \"invalid_player_ids\"\ + \ or \"invalid_external_user_ids\" this will mark devices that exist in\ + \ the provided app_id but are no longer subscribed.\nIf no id is returned,\ + \ then a message was not created and the targeted User IDs do not exist\ + \ under the provided app_id.\nAny User IDs sent in the request that do\ + \ not exist under the specified app_id will be ignored.\n" + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + description: Bad Request + security: + - app_key: [] + summary: Create notification + x-content-type: application/json + x-accepts: application/json + /notifications/{notification_id}: + delete: + description: Used to stop a scheduled or currently outgoing notification + operationId: cancel_notification + parameters: + - explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - explode: false + in: path + name: notification_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + description: OK + security: + - app_key: [] + summary: Stop a scheduled or currently outgoing notification + x-accepts: application/json + get: + description: View the details of a single notification and outcomes associated + with it + operationId: get_notification + parameters: + - explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - explode: false + in: path + name: notification_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Notification' + - $ref: '#/components/schemas/DeliveryData' + - $ref: '#/components/schemas/OutcomesData' + - properties: + remaining: + description: Number of notifications that have not been sent + out yet. This can mean either our system is still processing + the notification or you have delayed options set. + type: integer + successful: + description: Number of notifications that were successfully + delivered. + type: integer + failed: + description: Number of notifications that could not be delivered + due to those devices being unsubscribed. + type: integer + errored: + description: Number of notifications that could not be delivered + due to an error. You can find more information by viewing + the notification in the dashboard. + type: integer + converted: + description: Number of users who have clicked / tapped on your + notification. + type: integer + queued_at: + description: Unix timestamp indicating when the notification + was created. + type: integer + send_after: + description: Unix timestamp indicating when notification delivery + should begin. + type: integer + completed_at: + description: Unix timestamp indicating when notification delivery + completed. The delivery duration from start to finish can + be calculated with completed_at - send_after. + type: integer + platform_delivery_stats: + $ref: '#/components/schemas/PlatformDeliveryData' + received: + description: Confirmed Deliveries number of devices that received + the push notification. Paid Feature Only. Free accounts will + see 0. + type: integer + throttle_rate_per_minute: + description: "number of push notifications sent per minute.\ + \ Paid Feature Only. If throttling is not enabled for the\ + \ app or the notification, and for free accounts, null is\ + \ returned. Refer to Throttling for more details." + type: integer + type: object + description: OK + security: + - app_key: [] + summary: View notification + x-accepts: application/json + /apps: + get: + description: View the details of all of your current OneSignal apps + operationId: get_apps + responses: + "200": + content: + application/json: + schema: + type: string + description: OK + security: + - user_key: [] + summary: View apps + x-accepts: application/json + post: + description: Creates a new OneSignal app + operationId: create_app + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/App' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/App' + description: OK + security: + - user_key: [] + summary: Create an app + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}: + get: + description: View the details of a single OneSignal app + operationId: get_app + parameters: + - description: An app id + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/App' + description: OK + security: + - user_key: [] + summary: View an app + x-accepts: application/json + put: + description: Updates the name or configuration settings of an existing OneSignal + app + operationId: update_app + parameters: + - description: An app id + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/App' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/App' + description: OK + security: + - user_key: [] + summary: Update an app + x-content-type: application/json + x-accepts: application/json + /notifications/{notification_id}/history: + post: + description: "-> 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. 🚧 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." + operationId: get_notification_history + parameters: + - description: The "id" of the message found in the Notification object + explode: false + in: path + name: notification_id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/get_notification_request_body' + content: + application/json: + schema: + properties: + events: + description: "-> \"sent\" - All the devices by player_id that were\ + \ sent the specified notification_id. Notifications targeting\ + \ under 1000 recipients will not have \"sent\" events recorded,\ + \ but will show \"clicked\" events. \"clicked\" - All the devices\ + \ by `player_id` that clicked the specified notification_id." + enum: + - sent + - clicked + type: string + email: + description: The email address you would like the report sent. + type: string + app_id: + type: string + required: + - id + title: get_notification_request_body + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_2' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400_1' + description: Bad Request + security: + - app_key: [] + summary: Notification History + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/users/{external_user_id}: + put: + description: "Update an existing device's tags in one of your OneSignal apps\ + \ using the External User ID.\nWarning - Android SDK Data Synchronization\n\ + Tags added through the Android SDK tagging methods may not update if using\ + \ the API to change or update the same tag.\nFor example, if you use SDK method\ + \ sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with\ + \ this API endpoint. You will not be able to set the value back to \"value1\"\ + \ through the SDK, you will need to change it to something different through\ + \ the SDK to be reset.\nRecommendations if using this Endpoint on Android\ + \ Mobile Apps:\n1 - Do not use the same tag keys for SDK and API updates\n\ + 2 - If you want to use the same key for both SDK and API updates, call the\ + \ SDK getTags method first to update the device's tags.\nThis is only applicable\ + \ on the Android Mobile App SDKs.\n📘\nDeleting Tags\nTo delete a tag,\ + \ include its key and set its value to blank. Omitting a key/value will not\ + \ delete it.\nFor example, if I wanted to delete two existing tags rank and\ + \ category while simultaneously adding a new tag class, the tags JSON would\ + \ look like the following:\n\"tags\": {\n \"rank\": \"\",\n \"category\"\ + : \"\",\n \"class\": \"my_new_value\"\n}\n" + operationId: update_player_tags + parameters: + - description: The OneSignal App ID the user record is found under. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: The External User ID mapped to teh device record in OneSignal. Must + be actively set on the device to be updated. + explode: false + in: path + name: external_user_id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/update_player_tags_request_body' + content: + application/json: + schema: + properties: + tags: + description: "Custom tags for the device record. Only support string\ + \ key value pairs. Does not support arrays or other nested objects.\ + \ Example `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n\ + - 100 tags per call\n- Android SDK users: tags cannot be removed\ + \ or changed via API if set through SDK sendTag methods.\nRecommended\ + \ to only tag devices with 1 kilobyte of ata\nPlease consider\ + \ using your own Database to save more than 1 kilobyte of data.\ + \ See: Internal Database & CRM\n" + type: object + title: update_player_tags_request_body + type: object + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_3' + description: OK + security: + - app_key: [] + summary: Edit tags with external user id + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/segments: + post: + description: "Create segments visible and usable in the dashboard and API -\ + \ Required: OneSignal Paid Plan\nThe 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.\n🚧\n\ + Does Not Update Segments\nThis endpoint will only create segments, it does\ + \ not edit or update currently created Segments. You will need to use the\ + \ Delete Segments endpoint and re-create it with this endpoint to edit.\n" + operationId: create_segments + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Segment' + required: false + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_201' + description: Created + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400_2' + description: Bad Request + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400_2' + description: Conflict + security: + - app_key: [] + summary: Create Segments + x-content-type: application/json + x-accepts: application/json + /apps/{app_id}/segments/{segment_id}: + delete: + description: "Delete segments (not user devices) - Required: OneSignal Paid\ + \ Plan\nYou 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.\nThe segment_id can be found in the URL of the segment when viewing\ + \ it in the dashboard.\n" + operationId: delete_segments + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: The segment_id can be found in the URL of the segment when viewing + it in the dashboard. + explode: false + in: path + name: segment_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_3' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400_3' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_3' + description: Not Found + security: + - app_key: [] + summary: Delete Segments + x-accepts: application/json + /apps/{app_id}/outcomes: + get: + description: "View the details of all the outcomes associated with your app\n\ + \n🚧\nRequires Authentication Key\nRequires your OneSignal App's REST\ + \ API Key, available in Keys & IDs.\n\n🚧\nOutcome Data Limitations\n\ + 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.\n" + operationId: get_outcomes + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: "Required\nComma-separated list of names and the value (sum/count)\ + \ for the returned outcome data.\nNote: Clicks only support count aggregation.\n\ + 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.\nExample:os__session_duration.count,os__click.count,CustomOutcomeName.sum\n" + explode: true + in: query + name: outcome_names + required: true + schema: + type: string + style: form + - description: "Optional\nIf outcome names contain any commas, then please specify\ + \ only one value at a time.\nExample: outcome_names[]=os__click.count&outcome_names[]=Sales,\ + \ Purchase.count\nwhere \"Sales, Purchase\" is the custom outcomes with\ + \ a comma in the name.\n" + explode: true + in: query + name: "outcome_names[]" + required: false + schema: + type: string + style: form + - description: "Optional\nTime 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).\nDefault is 1h if the parameter is omitted.\n" + explode: true + in: query + name: outcome_time_range + required: false + schema: + type: string + style: form + - description: "Optional\nPlatform id. Refer device's platform ids for values.\n\ + Example:\noutcome_platform=0 for iOS\noutcome_platform=7,8 for Safari and\ + \ Firefox\nDefault is data from all platforms if the parameter is omitted.\n" + explode: true + in: query + name: outcome_platforms + required: false + schema: + type: string + style: form + - description: "Optional\nAttribution type for the outcomes. The values can\ + \ be direct or influenced or unattributed.\nExample: outcome_attribution=direct\n\ + Default is total (returns direct+influenced+unattributed) if the parameter\ + \ is omitted.\n" + explode: true + in: query + name: outcome_attribution + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OutcomesData' + description: OK + security: + - app_key: [] + summary: View Outcomes + x-accepts: application/json + /players: + get: + description: "View the details of multiple devices in one of your OneSignal\ + \ apps\nUnavailable for Apps Over 80,000 Users\nFor performance reasons, this\ + \ method is not available for larger apps. Larger apps should use the CSV\ + \ export API endpoint, which is much more performant.\n" + operationId: get_players + parameters: + - description: The app ID that you want to view players from + explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - description: How many devices to return. Max is 300. Default is 300 + explode: true + in: query + name: limit + required: false + schema: + type: string + style: form + - description: Result offset. Default is 0. Results are sorted by id; + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PlayerSlice' + description: OK + security: + - app_key: [] + summary: View devices + x-accepts: application/json + post: + description: "Register a new device to one of your OneSignal apps\n🚧\n\ + Don't use this\nThis API endpoint is designed to be used from our open source\ + \ Mobile and Web Push SDKs. It is not designed for developers to use it directly,\ + \ unless instructed to do so by OneSignal support.\nIf you use this method\ + \ instead of our SDKs, many OneSignal features such as conversion tracking,\ + \ timezone tracking, language detection, and rich-push won't work out of the\ + \ box. It will also make it harder to identify possible setup issues.\nThis\ + \ method is used to register a new device with OneSignal.\nIf a device is\ + \ already registered with the specified identifier, then this will update\ + \ the existing device record instead of creating a new one.\nThe returned\ + \ player is a player / user ID. Use the returned ID to send push notifications\ + \ to this specific user later, or to include this player when sending to a\ + \ set of users.\n🚧\niOS\nMust set test_type to 1 when building your\ + \ iOS app as development. Omit this field in your production app builds.\n" + operationId: create_player + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Player' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_4' + description: OK + security: + - app_key: [] + summary: Add a device + x-content-type: application/json + x-accepts: application/json + /players/{player_id}: + delete: + description: "Delete player - Required:\nUsed to delete a single, specific Player\ + \ ID record from a specific OneSignal app.\n" + operationId: delete_player + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - description: The OneSignal player_id + explode: false + in: path + name: player_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400_3' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + description: Not Found + security: + - app_key: [] + summary: Delete a user record + x-accepts: application/json + get: + description: View the details of an existing device in one of your OneSignal + apps + operationId: get_player + parameters: + - description: Your app_id for this device + explode: true + in: query + name: app_id + required: true + schema: + type: string + style: form + - description: Player's OneSignal ID + explode: false + in: path + name: player_id + required: true + schema: + type: string + style: simple + - description: Email - Only required if you have enabled Identity Verification + and device_type is email (11). + explode: true + in: query + name: email_auth_hash + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Player' + description: OK + security: + - app_key: [] + summary: View device + x-accepts: application/json + put: + description: Update an existing device in one of your OneSignal apps + operationId: update_player + parameters: + - description: Player's OneSignal ID + explode: false + in: path + name: player_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Player' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + description: OK + security: + - app_key: [] + summary: Edit device + x-content-type: application/json + x-accepts: application/json + /players/csv_export?app_id={app_id}: + post: + description: "Generate a compressed CSV export of all of your current user data\n\ + 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.\nThe file will be compressed using\ + \ GZip.\nThe file may take several minutes to generate depending on the number\ + \ of users in your app.\nThe URL generated will be available for 3 days and\ + \ includes random v4 uuid as part of the resource name to be unguessable.\n\ + 🚧\n403 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.\n🚧\nRequires Authentication Key\nRequires your\ + \ OneSignal App's REST API Key, available in Keys & IDs.\n🚧\nConcurrent\ + \ Exports\nOnly one concurrent export is allowed per OneSignal account. Please\ + \ ensure you have successfully downloaded the .csv.gz file before exporting\ + \ another app.\nCSV File Format:\n- Default Columns:\n | Field | Details\ + \ |\n | --- | --- |\n | id | OneSignal Player Id |\n | identifier | Push\ + \ Token |\n | session_count | Number of times they visited the app or site\n\ + \ | language | Device language code |\n | timezone | Number of seconds away\ + \ from UTC. Example: -28800 |\n | game_version | Version of your mobile app\ + \ gathered from Android Studio versionCode in your App/build.gradle and iOS\ + \ uses kCFBundleVersionKey in Xcode. |\n | device_os | Device Operating System\ + \ Version. Example: 80 = Chrome 80, 9 = Android 9 |\n | device_type | Device\ + \ Operating System Type |\n | device_model | Device Hardware String Code.\ + \ Example: Mobile Web Subscribers will have `Linux armv` |\n | ad_id | Based\ + \ on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut\ + \ means user turned off Advertising tracking on the device. |\n | tags |\ + \ Current OneSignal Data Tags on the device. |\n | last_active | Date and\ + \ time the user last opened the mobile app or visited the site. |\n | playtime\ + \ | Total amount of time in seconds the user had the mobile app open. |\n\ + \ | amount_spent | \tMobile only - amount spent in USD on In-App Purchases.\ + \ | \n | 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. |\n | invalid_identifier | t = unsubscribed,\ + \ f = subscibed |\n | badge_count | Current number of badges on the device\ + \ |\n- Extra Columns:\n | Field | Details |\n | --- | --- |\n | external_user_id\ + \ | Your User Id set on the device |\n | notification_types | Notification\ + \ types |\n | location | Location points (Latitude and Longitude) set on\ + \ the device. |\n | country | Country code |\n | rooted | Android device\ + \ rooted or not |\n | ip | IP Address of the device if being tracked. See\ + \ Handling Personal Data. |\n | web_auth | Web Only authorization key. |\n\ + \ | web_p256 | Web Only p256 key. |\n" + operationId: export_players + parameters: + - description: The app ID that you want to export devices from + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/export_players_request_body' + content: + application/json: + schema: + properties: + extra_fields: + description: "Additional fields that you wish to include. Currently\ + \ supports location, country, rooted, notification_types, ip,\ + \ external_user_id, web_auth, and web_p256." + items: + type: string + type: array + last_active_since: + description: Export all devices with a last_active timestamp greater + than this time. Unixtime in seconds. + type: integer + segment_name: + description: Export al ldevices belonging to the segment. + type: string + title: export_players_request_body + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_5' + description: OK + "400": + content: + application/json: + schema: + type: object + description: Bad Request + security: + - app_key: [] + summary: CSV export + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + get_notification_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/get_notification_request_body' + required: true + update_player_tags_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/update_player_tags_request_body' + required: false + export_players_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/export_players_request_body' + schemas: + App: + example: + 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 + 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 + 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" + 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." + type: string + chrome_key: + description: Not for web push. Your Google Push Messaging Auth Key if you + use Chrome Apps / Extensions. + type: string + chrome_web_default_notification_icon: + description: "Chrome (All Browsers except Safari): Your default notification\ + \ icon. Should be 256x256 pixels, min 80x80." + type: string + chrome_web_sub_domain: + description: "Chrome (All Browsers except Safari): A subdomain of your choice\ + \ in order to support Web Push on non-HTTPS websites. This field must\ + \ be set in order for the chrome_web_gcm_sender_id property to be processed." + type: string + apns_env: + description: "iOS: Either sandbox or production" + enum: + - sandbox + - production + type: string + apns_p12: + description: "iOS: Your apple push notification p12 certificate file, converted\ + \ to a string and Base64 encoded." + type: string + writeOnly: true + apns_p12_password: + description: "iOS: Required if using p12 certificate. Password for the\ + \ apns_p12 file." + type: string + writeOnly: true + apns_certificates: + readOnly: true + type: string + safari_apns_certificates: + readOnly: true + type: string + safari_apns_p12: + description: "Safari: Your apple push notification p12 certificate file\ + \ for Safari Push Notifications, converted to a string and Base64 encoded." + type: string + writeOnly: true + safari_apns_p12_password: + description: "Safari: Password for safari_apns_p12 file" + type: string + writeOnly: true + safari_site_origin: + description: "Safari (Recommended): The hostname to your website including\ + \ http(s)://" + type: string + safari_push_id: + readOnly: true + type: string + safari_icon_16_16: + readOnly: true + type: string + safari_icon_32_32: + readOnly: true + type: string + safari_icon_64_64: + readOnly: true + type: string + safari_icon_128_128: + readOnly: true + type: string + safari_icon_256_256: + description: "Safari: A url for a 256x256 png notification icon. This is\ + \ the only Safari icon URL you need to provide." + type: string + site_name: + description: "All Browsers (Recommended): The Site Name. Requires both chrome_web_origin\ + \ and safari_site_origin to be set to add or update it." + type: string + basic_auth_key: + readOnly: true + type: string + organization_id: + description: The Id of the Organization you would like to add this app to. + type: string + writeOnly: true + additional_data_is_root_payload: + description: "iOS: Notification data (additional data) values will be added\ + \ to the root of the apns payload when sent to the device. Ignore if\ + \ you're not using any other plugins, or not using OneSignal SDK methods\ + \ to read the payload." + type: boolean + writeOnly: true + required: + - id + type: object + Apps: + items: + $ref: '#/components/schemas/App' + type: array + SegmentNotificationTarget: + properties: + included_segments: + description: "The segment names you want to target. Users in these segments\ + \ will receive a notification. This targeting parameter is only compatible\ + \ with excluded_segments.\nExample: [\"Active Users\", \"Inactive Users\"\ + ]\n" + items: + type: string + type: array + excluded_segments: + description: "Segment that will be excluded when sending. Users in these\ + \ segments will not receive a notification, even if they were included\ + \ in included_segments. This targeting parameter is only compatible with\ + \ included_segments.\nExample: [\"Active Users\", \"Inactive Users\"]\n" + items: + type: string + type: array + type: object + FilterNotificationTarget: + properties: + last_session: + description: "relation = \">\" or \"<\"\nhours_ago = number of hours before\ + \ or after the users last session. Example: \"1.1\"\n" + type: string + first_session: + description: "relation = \">\" or \"<\"\nhours_ago = number of hours before\ + \ or after the users first session. Example: \"1.1\"\n" + type: string + session_count: + description: "relation = \">\", \"<\", \"=\" or \"!=\"\nvalue = number sessions.\ + \ Example: \"1\"\n" + type: string + session_time: + description: "relation = \">\", \"<\", \"=\" or \"!=\"\nvalue = Time in\ + \ seconds the user has been in your app. Example: \"3600\"\n" + type: string + amount_spent: + description: "relation = \">\", \"<\", or \"=\"\nvalue = Amount in USD a\ + \ user has spent on IAP (In App Purchases). Example: \"0.99\"\n" + type: string + bought_sku: + description: "relation = \">\", \"<\" or \"=\"\nkey = SKU purchased in your\ + \ app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\"\ + \nvalue = value of SKU to compare to. Example: \"0.99\"\n" + type: string + tag: + description: "relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\"\ + , \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan\ + \ only) See Time Operators\nkey = Tag key to compare.\nvalue = Tag value\ + \ to compare. Not required for \"exists\" or \"not_exists\". Example:\ + \ See Formatting Filters\n" + type: string + language: + description: "relation = \"=\" or \"!=\"\nvalue = 2 character language code.\ + \ Example: \"en\". For a list of all language codes see Language & Localization.\n" + type: string + app_version: + description: "relation = \">\", \"<\", \"=\" or \"!=\"\nvalue = app version.\ + \ Example: \"1.0.0\"\n" + type: string + location: + description: | + radius = in meters + lat = latitude + long = longitude + type: string + email: + description: | + value = email address + Only for sending Push Notifications + Use this for targeting push subscribers associated with an email set with all SDK setEmail methods + To send emails to specific email addresses use include_email_tokens parameter + type: string + country: + description: "relation = \"=\"\nvalue = 2-digit Country code\nExample: \"\ + field\": \"country\", \"relation\": \"=\", \"value\", \"US\"\n" + type: string + type: object + PlayerNotificationTarget: + properties: + include_player_ids: + description: "Specific playerids to send your notification to. _Does not\ + \ require API Auth Key.\nDo not combine with other targeting parameters.\ + \ Not compatible with any other targeting parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"\ + ]\nLimit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_external_user_ids: + description: "Target specific devices by custom user IDs assigned via API.\n\ + Not compatible with any other targeting parameters\nExample: [\"custom-id-assigned-by-api\"\ + ]\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 channel_for_external_user_ids to indicate you are sending\ + \ a push or email or sms.\n" + items: + type: string + type: array + include_email_tokens: + description: "Recommended for Sending Emails - Target specific email addresses.\n\ + If an email does not correspond to an existing user, a new user will be\ + \ created.\nExample: nick@catfac.ts\nLimit of 2,000 entries per REST API\ + \ call\n" + items: + type: string + type: array + include_phone_numbers: + description: "Recommended for Sending SMS - Target specific phone numbers.\ + \ The phone number should be in the E.164 format. Phone number should\ + \ be an existing subscriber on OneSignal. Refer our docs to learn how\ + \ to add phone numbers to OneSignal.\nExample phone number: +1999999999\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_ios_tokens: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using iOS device tokens.\n\ + Warning: Only works with Production tokens.\nAll non-alphanumeric characters\ + \ must be removed from each token. If a token does not correspond to an\ + \ existing user, a new user will be created.\nExample: ce777617da7f548fe7a9ab6febb56cf39fba6d38203...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_wp_wns_uris: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using Windows URIs. If\ + \ a token does not correspond to an existing user, a new user will be\ + \ created.\nExample: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_amazon_reg_ids: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using Amazon ADM registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_chrome_reg_ids: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using Chrome App registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_chrome_web_reg_ids: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using Chrome Web Push\ + \ registration IDs. If a token does not correspond to an existing user,\ + \ a new user will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + include_android_reg_ids: + description: "Not Recommended: Please consider using include_player_ids\ + \ or include_external_user_ids instead.\nTarget using Android device registration\ + \ IDs. If a token does not correspond to an existing user, a new user\ + \ will be created.\nExample: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_...\n\ + Limit of 2,000 entries per REST API call\n" + items: + type: string + type: array + type: object + NotificationTarget: + anyOf: + - $ref: '#/components/schemas/SegmentNotificationTarget' + - $ref: '#/components/schemas/FilterNotificationTarget' + - $ref: '#/components/schemas/PlayerNotificationTarget' + Notification: + allOf: + - $ref: '#/components/schemas/NotificationTarget' + - $ref: '#/components/schemas/Notification_allOf' + - required: + - app_id + Button: + properties: + id: + type: string + text: + type: string + icon: + type: string + required: + - id + type: object + Buttons: + items: + $ref: '#/components/schemas/Button' + type: array + StringMap: + properties: + en: + description: Text in English. Will be used as a fallback + type: string + ar: + description: Text in Arabic. + type: string + bs: + description: Text in Bosnian. + type: string + bg: + description: Text in Bulgarian. + type: string + ca: + description: Text in Catalan. + type: string + zh-Hans: + description: Text in Chinese (Simplified). + type: string + zh-Hant: + description: Text in Chinese (Traditional). + type: string + zh: + description: Alias for zh-Hans. + type: string + hr: + description: Text in Croatian. + type: string + cs: + description: Text in Czech. + type: string + da: + description: Text in Danish. + type: string + nl: + description: Text in Dutch. + type: string + et: + description: Text in Estonian. + type: string + fi: + description: Text in Finnish. + type: string + fr: + description: Text in French. + type: string + ka: + description: Text in Georgian. + type: string + de: + description: Text in German. + type: string + el: + description: Text in Greek. + type: string + hi: + description: Text in Hindi. + type: string + he: + description: Text in Hebrew. + type: string + hu: + description: Text in Hungarian. + type: string + id: + 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 + required: + - en + type: object + Notifications: + items: + $ref: '#/components/schemas/Notification' + type: array + 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/Notification' + 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' + type: object + DeliveryData: + properties: + successful: + type: integer + failed: + type: integer + errored: + type: integer + converted: + type: integer + received: + type: integer + type: object + Purchase: + properties: + sku: + description: The unique identifier of the purchased item. + type: string + amount: + description: "The amount, in USD, spent purchasing the item." + type: number + iso: + description: The 3-letter ISO 4217 currency code. Required for correct storage + and conversion of amount. + type: string + required: + - amount + - iso + - sku + type: object + OutcomeData: + example: + aggregation: sum + id: id + value: 0 + properties: + id: + type: string + value: + type: integer + aggregation: + enum: + - sum + - count + type: string + 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: 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 + relation: + description: Operator of a filter expression. + enum: + - '>' + - < + - = + - '!=' + - exists + - not_exists + - time_elapsed_gt + - time_elapsed_lt + type: string + required: + - field + - relation + 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 + type: object + FilterExpressions: + anyOf: + - $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 + name: + description: Name of the segment. You'll see this name on the Web UI. + 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." + items: + $ref: '#/components/schemas/FilterExpressions' + type: array + required: + - filters + - name + type: object + Player: + example: + country: country + external_user_id_auth_hash: external_user_id_auth_hash + device_model: device_model + timezone: 5 + created_at: 7 + device_type: 5 + language: language + playtime: 9 + long: 1.2315135367772556 + amount_spent: amount_spent + id: id + app_id: app_id + lat: 1.0246457001441578 + identifier: identifier + game_version: game_version + notification_types: 4 + device_os: device_os + email_auth_hash: email_auth_hash + test_type: 7 + external_user_id: external_user_id + tags: "{}" + ad_id: ad_id + session_count: 2 + sdk: sdk + last_active: 2 + invalid_identifier: true + badge_count: 3 + properties: + id: + description: The device's OneSignal ID + readOnly: true + type: string + invalid_identifier: + description: "If true, this is the equivalent of a user being Unsubscribed" + readOnly: true + type: boolean + app_id: + type: string + device_type: + description: | + Required + The device's platform: + 0 = iOS + 1 = Android + 2 = Amazon + 3 = WindowsPhone (MPNS) + 4 = Chrome Apps / Extensions + 5 = Chrome Web Push + 6 = Windows (WNS) + 7 = Safari + 8 = Firefox + 9 = MacOS + 10 = Alexa + 11 = Email + 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM + 14 = SMS + type: integer + external_user_id: + description: a custom user ID + type: string + external_user_id_auth_hash: + description: Only required if you have enabled Identity Verification and + device_type is NOT 11 email. + type: string + email_auth_hash: + description: Email - Only required if you have enabled Identity Verification + and device_type is email (11). + type: string + identifier: + description: "Recommended: For Push Notifications, this is the Push Token\ + \ Identifier from Google or Apple. For Apple Push identifiers, you must\ + \ strip all non alphanumeric characters.\nExamples:\niOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0\n\ + Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV...\n\ + For Email Addresses, set the full email address email@email.com and make\ + \ sure to set device_type to 11.\n" + type: string + language: + description: "Language code. Typically lower case two letters, except for\ + \ Chinese where it must be one of zh-Hans or zh-Hant. Example: en\n" + type: string + timezone: + description: "Number of seconds away from UTC. Example: -28800\n" + type: integer + game_version: + description: "Version of your app. Example: 1.1\n" + type: string + device_model: + description: "Device make and model. Example: iPhone5,1\n" + type: string + device_os: + description: "Device operating system version. Example: 7.0.4\n" + type: string + ad_id: + description: | + The ad id for the device's platform: + Android = Advertising Id + iOS = identifierForVendor + WP8.0 = DeviceUniqueId + WP8.1 = AdvertisingId + type: string + sdk: + description: Name and version of the sdk/plugin that's calling this API + method (if any) + type: string + session_count: + description: "Number of times the user has played the game, defaults to\ + \ 1" + type: integer + tags: + description: "Custom tags for the player. Only support string and integer\ + \ key value pairs. Does not support arrays or other nested objects. Setting\ + \ a tag value to null or an empty string will remove the tag. Example:\ + \ {\"foo\":\"bar\",\"this\":\"that\"}\nLimitations:\n- 100 tags per call\n\ + - Android SDK users: tags cannot be removed or changed via API if set\ + \ through SDK sendTag methods.\nRecommended to only tag devices with 1\ + \ kilobyte of data\nPlease consider using your own Database to save more\ + \ than 1 kilobyte of data. See: Internal Database & CRM\n" + type: object + amount_spent: + description: "Amount the user has spent in USD, up to two decimal places" + type: string + created_at: + description: Unixtime when the player joined the game + type: integer + playtime: + description: Seconds player was running your app. + type: integer + badge_count: + description: "Current iOS badge count displayed on the app icon\nNOTE: Not\ + \ supported for apps created after June 2018, since badge count for apps\ + \ created after this date are handled on the client.\n" + type: integer + last_active: + description: Unixtime when the player was last active + type: integer + notification_types: + description: | + 1 = subscribed + -2 = unsubscribed + iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. + Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues. + type: integer + test_type: + description: | + This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. + 1 = Development + 2 = Ad-Hoc + Omit this field for App Store builds. + type: integer + long: + description: "Longitude of the device, used for geotagging to segment on." + type: number + lat: + description: "Latitude of the device, used for geotagging to segment on." + type: number + country: + description: Country code in the ISO 3166-1 Alpha 2 format + type: string + required: + - app_id + - device_type + - id + type: object + Players: + items: + $ref: '#/components/schemas/Player' + type: array + PlayerSlice: + example: + offset: 6 + total_count: 0 + players: + - country: country + external_user_id_auth_hash: external_user_id_auth_hash + device_model: device_model + timezone: 5 + created_at: 7 + device_type: 5 + language: language + playtime: 9 + long: 1.2315135367772556 + amount_spent: amount_spent + id: id + app_id: app_id + lat: 1.0246457001441578 + identifier: identifier + game_version: game_version + notification_types: 4 + device_os: device_os + email_auth_hash: email_auth_hash + test_type: 7 + external_user_id: external_user_id + tags: "{}" + ad_id: ad_id + session_count: 2 + sdk: sdk + last_active: 2 + invalid_identifier: true + badge_count: 3 + - country: country + external_user_id_auth_hash: external_user_id_auth_hash + device_model: device_model + timezone: 5 + created_at: 7 + device_type: 5 + language: language + playtime: 9 + long: 1.2315135367772556 + amount_spent: amount_spent + id: id + app_id: app_id + lat: 1.0246457001441578 + identifier: identifier + game_version: game_version + notification_types: 4 + device_os: device_os + email_auth_hash: email_auth_hash + test_type: 7 + external_user_id: external_user_id + tags: "{}" + ad_id: ad_id + session_count: 2 + sdk: sdk + last_active: 2 + invalid_identifier: true + badge_count: 3 + limit: 1 + properties: + total_count: + type: integer + offset: + type: integer + limit: + type: integer + players: + items: + $ref: '#/components/schemas/Player' + type: array + type: object + InvalidIdentifierError: + properties: + invalid_external_user_ids: + description: Returned if using include_external_user_ids + items: + type: string + type: array + invalid_player_ids: + description: Returned if using include_player_ids and some were valid and + others were not. + items: + type: string + type: array + type: object + NoSubscribersError: + description: | + Returned if no subscribed players. + items: + type: string + type: array + Notification200Errors: + oneOf: + - $ref: '#/components/schemas/InvalidIdentifierError' + - $ref: '#/components/schemas/NoSubscribersError' + inline_response_200: + example: + recipients: 0 + external_id: external_id + id: id + errors: null + properties: + id: + type: string + recipients: + description: Estimated number of subscribers targetted by notification. + type: integer + external_id: + type: string + errors: + $ref: '#/components/schemas/Notification200Errors' + required: + - id + - recipients + type: object + inline_response_400: + properties: + errors: + items: + type: string + type: array + type: object + inline_response_200_1: + example: + success: success + properties: + success: + type: string + type: object + get_notification_request_body: + properties: + events: + description: "-> \"sent\" - All the devices by player_id that were sent\ + \ the specified notification_id. Notifications targeting under 1000 recipients\ + \ will not have \"sent\" events recorded, but will show \"clicked\" events.\ + \ \"clicked\" - All the devices by `player_id` that clicked the specified\ + \ notification_id." + enum: + - sent + - clicked + type: string + email: + description: The email address you would like the report sent. + type: string + app_id: + type: string + required: + - id + title: get_notification_request_body + type: object + inline_response_200_2: + example: + success: success + destination_url: destination_url + properties: + success: + type: string + destination_url: + type: string + type: object + inline_response_400_1: + properties: + success: + type: string + errors: + items: + type: string + type: array + type: object + update_player_tags_request_body: + properties: + tags: + description: "Custom tags for the device record. Only support string key\ + \ value pairs. Does not support arrays or other nested objects. Example\ + \ `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n- 100 tags per\ + \ call\n- Android SDK users: tags cannot be removed or changed via API\ + \ if set through SDK sendTag methods.\nRecommended to only tag devices\ + \ with 1 kilobyte of ata\nPlease consider using your own Database to save\ + \ more than 1 kilobyte of data. See: Internal Database & CRM\n" + type: object + title: update_player_tags_request_body + type: object + inline_response_200_3: + example: + success: true + properties: + success: + type: boolean + type: object + inline_response_201: + example: + success: true + id: id + properties: + success: + type: boolean + id: + description: UUID of created segment + type: string + type: object + inline_response_400_2: + properties: + success: + type: boolean + errors: + items: + type: string + type: array + type: object + inline_response_400_3: + properties: + erorrs: + items: + type: string + type: array + type: object + inline_response_200_4: + example: + success: true + id: id + properties: + success: + type: boolean + id: + type: string + type: object + export_players_request_body: + properties: + extra_fields: + description: "Additional fields that you wish to include. Currently supports\ + \ location, country, rooted, notification_types, ip, external_user_id,\ + \ web_auth, and web_p256." + items: + type: string + type: array + last_active_since: + description: Export all devices with a last_active timestamp greater than + this time. Unixtime in seconds. + type: integer + segment_name: + description: Export al ldevices belonging to the segment. + type: string + title: export_players_request_body + type: object + inline_response_200_5: + example: + csv_file_url: csv_file_url + properties: + csv_file_url: + type: string + type: object + Notification_allOf_android_background_layout: + description: "Channel: Push Notifications\nPlatform: Android\nAllowing setting\ + \ a background image for the notification. This is a JSON object containing\ + \ the following keys. See our Background Image documentation for image sizes.\n" + properties: + image: + description: "Asset file, android resource name, or URL to remote image." + type: string + headings_color: + description: Title text color ARGB Hex format. Example(Blue) "FF0000FF". + type: string + contents_color: + description: Body text color ARGB Hex format. Example(Red) "FFFF0000". + type: string + type: object + writeOnly: true + Notification_allOf: + properties: + id: + type: string + value: + readOnly: true + type: integer + aggregation: + enum: + - sum + - count + readOnly: true + type: string + isIos: + default: true + description: Indicates whether to send to all devices registered under your + app's Apple iOS platform. + type: boolean + writeOnly: true + isAndroid: + description: Indicates whether to send to all devices registered under your + app's Google Android platform. + type: boolean + writeOnly: true + isHuawei: + description: Indicates whether to send to all devices registered under your + app's Huawei Android platform. + type: boolean + writeOnly: true + isAnyWeb: + description: "Indicates whether to send to all subscribed web browser users,\ + \ including Chrome, Firefox, and Safari.\nYou may use this instead as\ + \ a combined flag instead of separately enabling isChromeWeb, isFirefox,\ + \ and isSafari, though the three options are equivalent to this one.\n" + type: boolean + writeOnly: true + isChromeWeb: + description: "Indicates whether to send to all Google Chrome, Chrome on\ + \ Android, and Mozilla Firefox users registered under your Chrome & Firefox\ + \ web push platform." + type: boolean + writeOnly: true + isFirefox: + description: Indicates whether to send to all Mozilla Firefox desktop users + registered under your Firefox web push platform. + type: boolean + writeOnly: true + isSafari: + description: Does not support iOS Safari. Indicates whether to send to all + Apple's Safari desktop users registered under your Safari web push platform. + Read more iOS Safari + type: boolean + writeOnly: true + isWP_WNS: + description: Indicates whether to send to all devices registered under your + app's Windows platform. + type: boolean + writeOnly: true + isAdm: + description: Indicates whether to send to all devices registered under your + app's Amazon Fire platform. + type: boolean + writeOnly: true + isChrome: + description: | + This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. + Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. + type: boolean + writeOnly: true + channel_for_external_user_ids: + description: "Indicates if the message type when targeting with include_external_user_ids\ + \ for cases where an email, sms, and/or push subscribers have the same\ + \ external user id.\nExample: Use the string \"push\" to indicate you\ + \ are sending a push notification or the string \"email\"for sending emails\ + \ or \"sms\"for sending SMS.\n" + type: string + writeOnly: true + app_id: + description: "Required: Your OneSignal Application ID, which can be found\ + \ in Keys & IDs.\nIt is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434.\n" + type: string + writeOnly: true + external_id: + description: "Correlation and idempotency key.\nA request received with\ + \ this parameter will first look for another notification with the same\ + \ external_id. 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 external_id will be sent again.\n \ + \ See Idempotent Notification Requests for more details\nwriteOnly: true\n" + type: string + contents: + allOf: + - $ref: '#/components/schemas/StringMap' + - description: "Required unless content_available=true or template_id is\ + \ set.\nThe message's content (excluding the title), a map of language\ + \ codes to text for each language.\nEach hash must have a language code\ + \ string for a key, mapped to the localized text you would like users\ + \ to receive for that language.\nThis field supports inline substitutions.\n\ + English must be included in the hash.\nExample: {\"en\": \"English Message\"\ + , \"es\": \"Spanish Message\"}\n" + writeOnly: true + headings: + allOf: + - $ref: '#/components/schemas/StringMap' + - description: "The message's title, a map of language codes to text for\ + \ each language. Each hash must have a language code string for a key,\ + \ mapped to the localized text you would like users to receive for that\ + \ language.\nThis field supports inline substitutions.\nExample: {\"\ + en\": \"English Title\", \"es\": \"Spanish Title\"}\n" + writeOnly: true + subtitle: + allOf: + - $ref: '#/components/schemas/StringMap' + - description: "The message's subtitle, a map of language codes to text\ + \ for each language. Each hash must have a language code string for\ + \ a key, mapped to the localized text you would like users to receive\ + \ for that language.\nThis field supports inline substitutions.\nExample:\ + \ {\"en\": \"English Subtitle\", \"es\": \"Spanish Subtitle\"}\n" + writeOnly: true + data: + description: "Channel: Push Notifications\nPlatform: Huawei\nA custom map\ + \ of data that is passed back to your app. Same as using Additional Data\ + \ within the dashboard. Can use up to 2048 bytes of data.\nExample: {\"\ + abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1}\n" + type: object + writeOnly: true + huawei_msg_type: + description: "Channel: Push Notifications\nPlatform: Huawei\nUse \"data\"\ + \ or \"message\" depending on the type of notification you are sending.\ + \ More details in Data & Background Notifications.\n" + type: string + writeOnly: true + url: + description: "Channel: Push Notifications\nPlatform: All\nThe URL to open\ + \ in the browser when a user clicks on the notification.\nNote: iOS needs\ + \ https or updated NSAppTransportSecurity in plist\nThis field supports\ + \ inline substitutions.\nOmit if including web_url or app_url\nExample:\ + \ https://onesignal.com\n" + type: string + writeOnly: true + web_url: + description: "Channel: Push Notifications\nPlatform: All Browsers\nSame\ + \ as url but only sent to web push platforms.\nIncluding Chrome, Firefox,\ + \ Safari, Opera, etc.\nExample: https://onesignal.com\n" + type: string + writeOnly: true + app_url: + description: "Channel: Push Notifications\nPlatform: All Browsers\nSame\ + \ as url but only sent to web push platforms.\nIncluding iOS, Android,\ + \ macOS, Windows, ChromeApps, etc.\nExample: https://onesignal.com\n" + type: string + writeOnly: true + ios_attachments: + description: "Channel: Push Notifications\nPlatform: iOS 10+\nAdds media\ + \ attachments to notifications. Set as JSON object, key as a media id\ + \ of your choice and the value as a valid local filename or URL. User\ + \ must press and hold on the notification to view.\nDo not set mutable_content\ + \ to download attachments. The OneSignal SDK does this automatically\n\ + Example: {\"id1\": \"https://domain.com/image.jpg\"}\n" + type: object + writeOnly: true + template_id: + description: "Channel: Push Notifications\nPlatform: All\nUse a template\ + \ you setup on our dashboard. The template_id is the UUID found in the\ + \ URL when viewing a template on our dashboard.\nExample: be4a8044-bbd6-11e4-a581-000c2940e62c\n" + type: string + writeOnly: true + content_available: + description: "Channel: Push Notifications\nPlatform: iOS\nSending true wakes\ + \ your app from background to run custom native code (Apple interprets\ + \ this as content-available=1). Note: Not applicable if the app is in\ + \ the \"force-quit\" state (i.e app was swiped away). Omit the contents\ + \ field to prevent displaying a visible notification.\n" + type: boolean + writeOnly: true + mutable_content: + description: "Channel: Push Notifications\nPlatform: iOS 10+\nAlways defaults\ + \ to true and cannot be turned off. Allows tracking of notification receives\ + \ and changing of the notification content in your app before it is displayed.\ + \ Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension.\n" + type: boolean + writeOnly: true + target_content_identifier: + description: "Channel: Push Notifications\nPlatform: iOS 13+\nUse to target\ + \ a specific experience in your App Clip, or to target your notification\ + \ to a specific window in a multi-scene App.\n" + type: string + writeOnly: true + big_picture: + description: "Channel: Push Notifications\nPlatform: Android\nPicture to\ + \ display in the expanded view. Can be a drawable resource name or a URL.\n" + type: string + writeOnly: true + huawei_big_picture: + description: "Channel: Push Notifications\nPlatform: Huawei\nPicture to\ + \ display in the expanded view. Can be a drawable resource name or a URL.\n" + type: string + writeOnly: true + adm_big_picture: + description: "Channel: Push Notifications\nPlatform: Amazon\nPicture to\ + \ display in the expanded view. Can be a drawable resource name or a URL.\n" + type: string + writeOnly: true + chrome_big_picture: + description: "Channel: Push Notifications\nPlatform: ChromeApp\nLarge picture\ + \ to display below the notification text. Must be a local URL.\n" + type: string + writeOnly: true + chrome_web_image: + description: "Channel: Push Notifications\nPlatform: Chrome 56+\nSets the\ + \ web push notification's large image to be shown below the notification's\ + \ title and text. Please see Web Push Notification Icons.\n" + type: string + writeOnly: true + buttons: + description: "Channel: Push Notifications\nPlatform: iOS 8.0+, Android 4.1+,\ + \ and derivatives like Amazon Buttons to add to the notification. Icon\ + \ only works for Android.\nButtons show in reverse order of array position\ + \ i.e. Last item in array shows as first button on device.\nExample: [{\"\ + id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"\ + }, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"\ + }]\n" + items: + $ref: '#/components/schemas/Button' + type: array + writeOnly: true + web_buttons: + description: "Channel: Push Notifications\nPlatform: Chrome 48+\nAdd action\ + \ buttons to the notification. The id field is required.\nExample: [{\"\ + id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\"\ + , \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"\ + text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"\ + url\": \"https://yoursite.com\"}]\n" + items: + $ref: '#/components/schemas/Button' + type: array + writeOnly: true + ios_category: + description: "Channel: Push Notifications\nPlatform: iOS\nCategory APS payload,\ + \ use with registerUserNotificationSettings:categories in your Objective-C\ + \ / Swift code.\nExample: calendar category which contains actions like\ + \ accept and decline\niOS 10+ This will trigger your UNNotificationContentExtension\ + \ whose ID matches this category.\n" + type: string + writeOnly: true + android_channel_id: + description: "Channel: Push Notifications\nPlatform: Android\nThe Android\ + \ Oreo Notification Category to send the notification under. See the Category\ + \ documentation on creating one and getting it's id.\n" + type: string + writeOnly: true + huawei_channel_id: + description: "Channel: Push Notifications\nPlatform: Huawei\nThe Android\ + \ Oreo Notification Category to send the notification under. See the Category\ + \ documentation on creating one and getting it's id.\n" + type: string + writeOnly: true + existing_android_channel_id: + description: "Channel: Push Notifications\nPlatform: Android\nUse this if\ + \ you have client side Android Oreo Channels you have already defined\ + \ in your app with code.\n" + type: string + writeOnly: true + huawei_existing_channel_id: + description: "Channel: Push Notifications\nPlatform: Huawei\nUse this if\ + \ you have client side Android Oreo Channels you have already defined\ + \ in your app with code.\n" + type: string + writeOnly: true + android_background_layout: + $ref: '#/components/schemas/Notification_allOf_android_background_layout' + small_icon: + description: "Channel: Push Notifications\nPlatform: Android\nIcon shown\ + \ in the status bar and on the top left of the notification.\nIf not set\ + \ a bell icon will be used or ic_stat_onesignal_default if you have set\ + \ this resource name.\nSee: How to create small icons\n" + type: string + writeOnly: true + huawei_small_icon: + description: "Channel: Push Notifications\nPlatform: Huawei\nIcon shown\ + \ in the status bar and on the top left of the notification.\nUse an Android\ + \ resource path (E.g. /drawable/small_icon).\nDefaults to your app icon\ + \ if not set.\n" + type: string + writeOnly: true + large_icon: + description: "Channel: Push Notifications\nPlatform: Android\nCan be a drawable\ + \ resource name or a URL.\nSee: How to create large icons\n" + type: string + writeOnly: true + huawei_large_icon: + description: "Channel: Push Notifications\nPlatform: Huawei\nCan be a drawable\ + \ resource name or a URL.\nSee: How to create large icons\n" + type: string + writeOnly: true + adm_small_icon: + description: "Channel: Push Notifications\nPlatform: Amazon\nIf not set\ + \ a bell icon will be used or ic_stat_onesignal_default if you have set\ + \ this resource name.\nSee: How to create small icons\n" + type: string + writeOnly: true + adm_large_icon: + description: "Channel: Push Notifications\nPlatform: Amazon\nIf blank the\ + \ small_icon is used. Can be a drawable resource name or a URL.\nSee:\ + \ How to create large icons\n" + type: string + writeOnly: true + chrome_web_icon: + description: "Channel: Push Notifications\nPlatform: Chrome\nSets the web\ + \ push notification's icon. An image URL linking to a valid image. Common\ + \ image types are supported; GIF will not animate. We recommend 256x256\ + \ (at least 80x80) to display well on high DPI devices. Firefox will also\ + \ use this icon, unless you specify firefox_icon.\n" + type: string + chrome_web_badge: + description: "Channel: Push Notifications\nPlatform: Chrome\nSets the web\ + \ push notification icon for Android devices in the notification shade.\ + \ Please see Web Push Notification Badge.\n" + type: string + writeOnly: true + firefox_icon: + description: "Channel: Push Notifications\nPlatform: Firefox\nNot recommended\ + \ Few people need to set Firefox-specific icons. We recommend setting\ + \ chrome_web_icon instead, which Firefox will also use.\nSets the web\ + \ push notification's icon for Firefox. An image URL linking to a valid\ + \ image. Common image types are supported; GIF will not animate. We recommend\ + \ 256x256 (at least 80x80) to display well on high DPI devices.\n" + type: string + writeOnly: true + chrome_icon: + description: "Channel: Push Notifications\nPlatform: ChromeApp\nThis flag\ + \ is not used for web push For web push, please see chrome_web_icon instead.\n\ + The local URL to an icon to use. If blank, the app icon will be used.\n" + type: string + writeOnly: true + ios_sound: + description: "Channel: Push Notifications\nPlatform: iOS\nSound file that\ + \ is included in your app to play instead of the default device notification\ + \ sound. Pass nil to disable vibration and sound for the notification.\n\ + Example: \"notification.wav\"\n" + type: string + writeOnly: true + android_sound: + description: "Channel: Push Notifications\nPlatform: Android\n⚠️Deprecated,\ + \ this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease\ + \ use Notification Categories / Channels noted above instead to support\ + \ ALL versions of Android.\nSound file that is included in your app to\ + \ play instead of the default device notification sound. Pass nil to disable\ + \ sound for the notification.\nNOTE: Leave off file extension for Android.\n\ + Example: \"notification\"\n" + type: string + writeOnly: true + huawei_sound: + description: "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated,\ + \ this field ONLY works on EMUI 5 (Android 7 based) and older devices.\n\ + Please also set Notification Categories / Channels noted above to support\ + \ EMUI 8 (Android 8 based) devices.\nSound file that is included in your\ + \ app to play instead of the default device notification sound. NOTE:\ + \ Leave off file extension for and include the full path.\n\nExample:\ + \ \"/res/raw/notification\"\n" + type: string + writeOnly: true + adm_sound: + description: "Channel: Push Notifications\nPlatform: Amazon\n⚠️Deprecated,\ + \ this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease\ + \ use Notification Categories / Channels noted above instead to support\ + \ ALL versions of Android.\nSound file that is included in your app to\ + \ play instead of the default device notification sound. Pass nil to disable\ + \ sound for the notification.\nNOTE: Leave off file extension for Android.\n\ + Example: \"notification\"\n" + type: string + writeOnly: true + wp_wns_sound: + description: "Channel: Push Notifications\nPlatform: Windows\nSound file\ + \ that is included in your app to play instead of the default device notification\ + \ sound.\nExample: \"notification.wav\"\n" + type: string + writeOnly: true + android_led_color: + description: "Channel: Push Notifications\nPlatform: Android\n⚠️Deprecated,\ + \ this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease\ + \ use Notification Categories / Channels noted above instead to support\ + \ ALL versions of Android.\nSets the devices LED notification light if\ + \ the device has one. ARGB Hex format.\nExample(Blue): \"FF0000FF\"\n" + type: string + writeOnly: true + huawei_led_color: + description: "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated,\ + \ this field ONLY works on EMUI 5 (Android 7 based) and older devices.\n\ + Please also set Notification Categories / Channels noted above to support\ + \ EMUI 8 (Android 8 based) devices.\nSets the devices LED notification\ + \ light if the device has one. RGB Hex format.\nExample(Blue): \"0000FF\"\ + \n" + type: string + writeOnly: true + android_accent_color: + description: "Channel: Push Notifications\nPlatform: Android\nSets the background\ + \ color of the notification circle to the left of the notification text.\ + \ Only applies to apps targeting Android API level 21+ on Android 5.0+\ + \ devices.\nExample(Red): \"FFFF0000\"\n" + type: string + writeOnly: true + huawei_accent_color: + description: "Channel: Push Notifications\nPlatform: Huawei\nAccent Color\ + \ used on Action Buttons and Group overflow count.\nUses RGB Hex value\ + \ (E.g. #9900FF).\nDefaults to device's theme color if not set.\n" + type: string + writeOnly: true + android_visibility: + description: "Channel: Push Notifications\nPlatform: Android 5.0_\n⚠️Deprecated,\ + \ this field doesn't work on Android 8 (Oreo) and newer devices!\nPlease\ + \ use Notification Categories / Channels noted above instead to support\ + \ ALL versions of Android.\n1 = Public (default) (Shows the full message\ + \ on the lock screen unless the user has disabled all notifications from\ + \ showing on the lock screen. Please consider the user and mark private\ + \ if the contents are.)\n0 = Private (Hides message contents on lock screen\ + \ if the user set \"Hide sensitive notification content\" in the system\ + \ settings)\n-1 = Secret (Notification does not show on the lock screen\ + \ at all)\n" + type: integer + writeOnly: true + huawei_visibility: + description: "Channel: Push Notifications\nPlatform: Huawei\n⚠️Deprecated,\ + \ this field ONLY works on EMUI 5 (Android 7 based) and older devices.\n\ + Please also set Notification Categories / Channels noted above to support\ + \ EMUI 8 (Android 8 based) devices.\n1 = Public (default) (Shows the full\ + \ message on the lock screen unless the user has disabled all notifications\ + \ from showing on the lock screen. Please consider the user and mark private\ + \ if the contents are.)\n0 = Private (Hides message contents on lock screen\ + \ if the user set \"Hide sensitive notification content\" in the system\ + \ settings)\n-1 = Secret (Notification does not show on the lock screen\ + \ at all)\n" + type: integer + writeOnly: true + ios_badgeType: + description: "Channel: Push Notifications\nPlatform: iOS\nDescribes whether\ + \ to set or increase/decrease your app's iOS badge count by the ios_badgeCount\ + \ specified count. Can specify None, SetTo, or Increase.\n`None` leaves\ + \ the count unaffected.\n`SetTo` directly sets the badge count to the\ + \ number specified in ios_badgeCount.\n`Increase` adds the number specified\ + \ in ios_badgeCount to the total. Use a negative number to decrease the\ + \ badge count.\n" + type: string + writeOnly: true + ios_badgeCount: + description: "Channel: Push Notifications\nPlatform: iOS\nUsed with ios_badgeType,\ + \ describes the value to set or amount to increase/decrease your app's\ + \ iOS badge count by.\nYou can use a negative number to decrease the badge\ + \ count when used with an ios_badgeType of Increase.\n" + type: integer + writeOnly: true + collapse_id: + description: "Channel: Push Notifications\nPlatform: iOS 10+, Android\n\ + Only one notification with the same id will be shown on the device. Use\ + \ the same id to update an existing notification instead of showing a\ + \ new one. Limit of 64 characters.\n" + type: string + writeOnly: true + web_push_topic: + description: "Channel: Push Notifications\nPlatform: All Browsers\nDisplay\ + \ multiple notifications at once with different topics.\n" + type: string + apns_alert: + description: "Channel: Push Notifications\nPlatform: iOS 10+\niOS can localize\ + \ push notification messages on the client using special parameters such\ + \ as loc-key. When using the Create Notification endpoint, you must include\ + \ these parameters inside of a field called apns_alert. Please see Apple's\ + \ guide on localizing push notifications to learn more.\n" + type: object + writeOnly: true + send_after: + description: "Channel: All\nSchedule notification for future delivery. API\ + \ defaults to UTC -1100\nExamples: All examples are the exact same date\ + \ & time.\n\"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\"\n\"September 24th\ + \ 2015, 2:00:00 pm UTC-07:00\"\n\"2015-09-24 14:00:00 GMT-0700\"\n\"Sept\ + \ 24 2015 14:00:00 GMT-0700\"\n\"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific\ + \ Daylight Time)\"\nNote: SMS currently only supports send_after parameter.\n" + type: string + writeOnly: true + delayed_option: + description: "Channel: All\nPossible values are:\ntimezone (Deliver at a\ + \ specific time-of-day in each users own timezone)\nlast-active Same as\ + \ Intelligent Delivery . (Deliver at the same time of day as each user\ + \ last used your app).\nIf send_after is used, this takes effect after\ + \ the send_after time has elapsed.\n" + type: string + writeOnly: true + delivery_time_of_day: + description: "Channel: All\nUse with delayed_option=timezone.\nExamples:\ + \ \"9:00AM\"\n\"21:45\"\n\"9:45:30\"\n" + type: string + writeOnly: true + ttl: + description: "Channel: Push Notifications\nPlatform: iOS, Android, Chrome,\ + \ Firefox, Safari, ChromeWeb\nTime To Live - In seconds. The notification\ + \ will be expired if the device does not come back online within this\ + \ time. The default is 259,200 seconds (3 days).\nMax value to set is\ + \ 2419200 seconds (28 days).\n" + type: integer + writeOnly: true + priority: + description: "Channel: Push Notifications\nPlatform: Android, Chrome, ChromeWeb\n\ + Delivery priority through the push server (example GCM/FCM). Pass 10 for\ + \ high priority or any other integer for normal priority. Defaults to\ + \ normal priority for Android and high for iOS. For Android 6.0+ devices\ + \ setting priority to high will wake the device out of doze mode.\n" + type: integer + writeOnly: true + apns_push_type_override: + description: "Channel: Push Notifications\nPlatform: iOS\nvalid values:\ + \ voip\nSet the value to voip for sending VoIP Notifications\nThis field\ + \ maps to the APNS header apns-push-type.\nNote: alert and background\ + \ are automatically set by OneSignal\n" + type: string + writeOnly: true + throttle_rate_per_minute: + description: "Channel: All\nApps with throttling enabled:\n - the parameter\ + \ value will be used to override the default application throttling value\ + \ set from the dashboard settings.\n - parameter value 0 indicates not\ + \ to apply throttling to the notification.\n - if the parameter is not\ + \ passed then the default app throttling value will be applied to the\ + \ notification.\nApps with throttling disabled:\n - this parameter can\ + \ be used to throttle delivery for the notification even though throttling\ + \ is not enabled at the application level.\nRefer to throttling for more\ + \ details.\n" + type: string + writeOnly: true + android_group: + description: "Channel: Push Notifications\nPlatform: Android\nNotifications\ + \ with the same group will be stacked together using Android's Notification\ + \ Grouping feature.\n" + type: string + writeOnly: true + android_group_message: + description: "Channel: Push Notifications\nPlatform: Android\nNote: This\ + \ only works for Android 6 and older. Android 7+ allows full expansion\ + \ of all message.\nSummary message to display when 2+ notifications are\ + \ stacked together. Default is \"# new messages\". Include $[notif_count]\ + \ in your message and it will be replaced with the current number.\nLanguages\ + \ - The value of each key is the message that will be sent to users for\ + \ that language. \"en\" (English) is required. The key of each hash is\ + \ either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified\ + \ or Traditional Chinese. Read more: supported languages.\nExample: {\"\ + en\": \"You have $[notif_count] new messages\"}\n" + type: string + writeOnly: true + adm_group: + description: "Channel: Push Notifications\nPlatform: Amazon\nNotifications\ + \ with the same group will be stacked together using Android's Notification\ + \ Grouping feature.\n" + type: string + writeOnly: true + adm_group_message: + description: "Channel: Push Notifications\nPlatform: Amazon\nSummary message\ + \ to display when 2+ notifications are stacked together. Default is \"\ + # new messages\". Include $[notif_count] in your message and it will be\ + \ replaced with the current number. \"en\" (English) is required. The\ + \ key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant\ + \ for Simplified or Traditional Chinese. The value of each key is the\ + \ message that will be sent to users for that language.\nExample: {\"\ + en\": \"You have $[notif_count] new messages\"}\n" + type: object + writeOnly: true + thread_id: + description: "Channel: Push Notifications\nPlatform: iOS 12+\nThis parameter\ + \ is supported in iOS 12 and above. It allows you to group related notifications\ + \ together.\nIf two notifications have the same thread-id, they will both\ + \ be added to the same group.\n" + type: string + writeOnly: true + summary_arg: + description: "Channel: Push Notifications\nPlatform: iOS 12+\nWhen using\ + \ thread_id to create grouped notifications in iOS 12+, you can also control\ + \ the summary. For example, a grouped notification can say \"12 more notifications\ + \ from John Doe\".\nThe summary_arg lets you set the name of the person/thing\ + \ the notifications are coming from, and will show up as \"X more notifications\ + \ from summary_arg\"\n" + type: string + writeOnly: true + summary_arg_count: + description: "Channel: Push Notifications\nPlatform: iOS 12+\nWhen using\ + \ thread_id, you can also control the count of the number of notifications\ + \ in the group. For example, if the group already has 12 notifications,\ + \ and you send a new notification with summary_arg_count = 2, the new\ + \ total will be 14 and the summary will be \"14 more notifications from\ + \ summary_arg\"\n" + type: integer + writeOnly: true + email_subect: + description: "Channel: Email\nRequired. The subject of the email.\n" + type: string + writeOnly: true + email_body: + description: "Channel: Email\nRequired unless template_id is set.\nHTML\ + \ suported\nThe body of the email you wish to send. Typically, customers\ + \ include their own HTML templates here. Must include [unsubscribe_url]\ + \ in an tag somewhere in the email.\nNote: any malformed HTML content\ + \ will be sent to users. Please double-check your HTML is valid.\n" + type: string + writeOnly: true + email_from_name: + description: "Channel: Email\nThe name the email is from. If not specified,\ + \ will default to \"from name\" set in the OneSignal Dashboard Email Settings.\n" + type: string + writeOnly: true + email_from_address: + description: "Channel: Email\nThe email address the email is from. If not\ + \ specified, will default to \"from email\" set in the OneSignal Dashboard\ + \ Email Settings.\n" + type: string + writeOnly: true + sms_from: + description: "Channel: SMS\nPhone Number used to send SMS. Should be a registered\ + \ Twilio phone number in E.164 format.\n" + type: string + writeOnly: true + sms_media_urls: + description: "Channel: SMS\nURLs for the media files to be attached to the\ + \ SMS content.\nLimit: 10 media urls with a total max. size of 5MBs.\n" + items: + type: string + type: array + writeOnly: true + type: object + securitySchemes: + app_key: + scheme: bearer + type: http + user_key: + scheme: bearer + type: http + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..b01e83b --- /dev/null +++ b/build.gradle @@ -0,0 +1,153 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1.0.2' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'onesignal-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.5' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.9.3' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' + implementation 'com.google.code.gson:gson:2.9.0' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.2' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.mockito:mockito-core:3.12.4' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..2731994 --- /dev/null +++ b/build.sbt @@ -0,0 +1,27 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "onesignal-java-client", + version := "1.0.2", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.9.3", + "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", + "com.google.code.gson" % "gson" % "2.9.0", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/docs/App.md b/docs/App.md new file mode 100644 index 0000000..44784e2 --- /dev/null +++ b/docs/App.md @@ -0,0 +1,51 @@ + + +# App + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [readonly] | +|**name** | **String** | The name of your app, as displayed on your apps list on the dashboard. This can be renamed. | [optional] | +|**players** | **Integer** | | [optional] [readonly] | +|**messageablePlayers** | **Integer** | | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | | [optional] [readonly] | +|**androidGcmSenderId** | **String** | Android: Your Google Project number. Also known as Sender ID. | [optional] | +|**gcmKey** | **String** | Android: Your Google Push Messaging Auth Key | [optional] | +|**chromeWebOrigin** | **String** | 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. | [optional] | +|**chromeKey** | **String** | Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions. | [optional] | +|**chromeWebDefaultNotificationIcon** | **String** | Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80. | [optional] | +|**chromeWebSubDomain** | **String** | Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed. | [optional] | +|**apnsEnv** | [**ApnsEnvEnum**](#ApnsEnvEnum) | iOS: Either sandbox or production | [optional] | +|**apnsP12** | **String** | iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded. | [optional] | +|**apnsP12Password** | **String** | iOS: Required if using p12 certificate. Password for the apns_p12 file. | [optional] | +|**apnsCertificates** | **String** | | [optional] [readonly] | +|**safariApnsCertificates** | **String** | | [optional] [readonly] | +|**safariApnsP12** | **String** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional] | +|**safariApnsP12Password** | **String** | Safari: Password for safari_apns_p12 file | [optional] | +|**safariSiteOrigin** | **String** | Safari (Recommended): The hostname to your website including http(s):// | [optional] | +|**safariPushId** | **String** | | [optional] [readonly] | +|**safariIcon1616** | **String** | | [optional] [readonly] | +|**safariIcon3232** | **String** | | [optional] [readonly] | +|**safariIcon6464** | **String** | | [optional] [readonly] | +|**safariIcon128128** | **String** | | [optional] [readonly] | +|**safariIcon256256** | **String** | Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide. | [optional] | +|**siteName** | **String** | All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. | [optional] | +|**basicAuthKey** | **String** | | [optional] [readonly] | +|**organizationId** | **String** | The Id of the Organization you would like to add this app to. | [optional] | +|**additionalDataIsRootPayload** | **Boolean** | iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload. | [optional] | + + + +## Enum: ApnsEnvEnum + +| Name | Value | +|---- | -----| +| SANDBOX | "sandbox" | +| PRODUCTION | "production" | + + + diff --git a/docs/Button.md b/docs/Button.md new file mode 100644 index 0000000..6d362bc --- /dev/null +++ b/docs/Button.md @@ -0,0 +1,15 @@ + + +# Button + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**text** | **String** | | [optional] | +|**icon** | **String** | | [optional] | + + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md new file mode 100644 index 0000000..fce3bd0 --- /dev/null +++ b/docs/DefaultApi.md @@ -0,0 +1,1351 @@ +# DefaultApi + +All URIs are relative to *https://onesignal.com/api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**cancelNotification**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification | +| [**createApp**](DefaultApi.md#createApp) | **POST** /apps | Create an app | +| [**createNotification**](DefaultApi.md#createNotification) | **POST** /notifications | Create notification | +| [**createPlayer**](DefaultApi.md#createPlayer) | **POST** /players | Add a device | +| [**createSegments**](DefaultApi.md#createSegments) | **POST** /apps/{app_id}/segments | Create Segments | +| [**deletePlayer**](DefaultApi.md#deletePlayer) | **DELETE** /players/{player_id} | Delete a user record | +| [**deleteSegments**](DefaultApi.md#deleteSegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments | +| [**exportPlayers**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | CSV export | +| [**getApp**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app | +| [**getApps**](DefaultApi.md#getApps) | **GET** /apps | View apps | +| [**getNotification**](DefaultApi.md#getNotification) | **GET** /notifications/{notification_id} | View notification | +| [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History | +| [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications | +| [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | +| [**getPlayer**](DefaultApi.md#getPlayer) | **GET** /players/{player_id} | View device | +| [**getPlayers**](DefaultApi.md#getPlayers) | **GET** /players | View devices | +| [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app | +| [**updatePlayer**](DefaultApi.md#updatePlayer) | **PUT** /players/{player_id} | Edit device | +| [**updatePlayerTags**](DefaultApi.md#updatePlayerTags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id | + + + +# **cancelNotification** +> InlineResponse2001 cancelNotification(appId, notificationId) + +Stop a scheduled or currently outgoing notification + +Used to stop a scheduled or currently outgoing notification + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String notificationId = "notificationId_example"; // String | + try { + InlineResponse2001 result = apiInstance.cancelNotification(appId, notificationId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#cancelNotification"); + 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 + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **createApp** +> App createApp(app) + +Create an app + +Creates a new 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: user_key + HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); + user_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + App app = new App(); // App | + try { + App result = apiInstance.createApp(app); + System.out.println(result); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **app** | [**App**](App.md)| | | + +### Return type + +[**App**](App.md) + +### Authorization + +[user_key](../README.md#user_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **createNotification** +> InlineResponse200 createNotification(notification) + +Create notification + +Sends notifications to your users + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + Notification notification = new Notification(); // Notification | + try { + InlineResponse200 result = apiInstance.createNotification(notification); + System.out.println(result); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **notification** | [**Notification**](Notification.md)| | | + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK, invalid_player_ids, invalid_external_user_ids 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_player_ids\" or \"invalid_external_user_ids\" 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 | - | + + +# **createPlayer** +> InlineResponse2004 createPlayer(player) + +Add a device + +Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + Player player = new Player(); // Player | + try { + InlineResponse2004 result = apiInstance.createPlayer(player); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#createPlayer"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **player** | [**Player**](Player.md)| | | + +### Return type + +[**InlineResponse2004**](InlineResponse2004.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **createSegments** +> InlineResponse201 createSegments(appId, segment) + +Create Segments + +Create segments 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 Segments endpoint and re-create it with this endpoint to edit. + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_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 | + try { + InlineResponse201 result = apiInstance.createSegments(appId, segment); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#createSegments"); + 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. | | +| **segment** | [**Segment**](Segment.md)| | [optional] | + +### Return type + +[**InlineResponse201**](InlineResponse201.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **409** | Conflict | - | + + +# **deletePlayer** +> InlineResponse2001 deletePlayer(appId, playerId) + +Delete a user record + +Delete player - Required: Used to delete a single, specific Player ID record from a specific 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_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 playerId = "playerId_example"; // String | The OneSignal player_id + try { + InlineResponse2001 result = apiInstance.deletePlayer(appId, playerId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deletePlayer"); + 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. | | +| **playerId** | **String**| The OneSignal player_id | | + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[app_key](../README.md#app_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 | - | + + +# **deleteSegments** +> InlineResponse2003 deleteSegments(appId, segmentId) + +Delete Segments + +Delete segments (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 +// 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_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. + try { + InlineResponse2003 result = apiInstance.deleteSegments(appId, segmentId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteSegments"); + 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. | | +| **segmentId** | **String**| The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### Authorization + +[app_key](../README.md#app_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 | - | + + +# **exportPlayers** +> InlineResponse2005 exportPlayers(appId, exportPlayersRequestBody) + +CSV export + +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 +// 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The app ID that you want to export devices from + ExportPlayersRequestBody exportPlayersRequestBody = new ExportPlayersRequestBody(); // ExportPlayersRequestBody | + try { + InlineResponse2005 result = apiInstance.exportPlayers(appId, exportPlayersRequestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#exportPlayers"); + 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 export devices from | | +| **exportPlayersRequestBody** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md)| | [optional] | + +### Return type + +[**InlineResponse2005**](InlineResponse2005.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | + + +# **getApp** +> App getApp(appId) + +View an app + +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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: user_key + HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); + user_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 + +[user_key](../README.md#user_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **getApps** +> String 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: user_key + HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); + user_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + String 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 + +**String** + +### Authorization + +[user_key](../README.md#user_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **getNotification** +> Notification 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | + String notificationId = "notificationId_example"; // String | + try { + Notification 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 + +[**Notification**](Notification.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **getNotificationHistory** +> InlineResponse2002 getNotificationHistory(notificationId, getNotificationRequestBody) + +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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String notificationId = "notificationId_example"; // String | The \"id\" of the message found in the Notification object + GetNotificationRequestBody getNotificationRequestBody = new GetNotificationRequestBody(); // GetNotificationRequestBody | + try { + InlineResponse2002 result = apiInstance.getNotificationHistory(notificationId, getNotificationRequestBody); + 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 | | +| **getNotificationRequestBody** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md)| | | + +### Return type + +[**InlineResponse2002**](InlineResponse2002.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | + + +# **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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The app ID that you want to view notifications from + String limit = "limit_example"; // String | 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** | **String**| 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 + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_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 + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **getPlayer** +> Player getPlayer(appId, playerId, emailAuthHash) + +View device + +View the details of an existing device in one of your 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | Your app_id for this device + String playerId = "playerId_example"; // String | Player's OneSignal ID + String emailAuthHash = "emailAuthHash_example"; // String | Email - Only required if you have enabled Identity Verification and device_type is email (11). + try { + Player result = apiInstance.getPlayer(appId, playerId, emailAuthHash); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getPlayer"); + 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 app_id for this device | | +| **playerId** | **String**| Player's OneSignal ID | | +| **emailAuthHash** | **String**| Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | + +### Return type + +[**Player**](Player.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **getPlayers** +> PlayerSlice getPlayers(appId, limit, offset) + +View devices + +View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The app ID that you want to view players from + String limit = "limit_example"; // String | How many devices to return. Max is 300. Default is 300 + Integer offset = 56; // Integer | Result offset. Default is 0. Results are sorted by id; + try { + PlayerSlice result = apiInstance.getPlayers(appId, limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getPlayers"); + 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 players from | | +| **limit** | **String**| How many devices to return. Max is 300. Default is 300 | [optional] | +| **offset** | **Integer**| Result offset. Default is 0. Results are sorted by id; | [optional] | + +### Return type + +[**PlayerSlice**](PlayerSlice.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: user_key + HttpBearerAuth user_key = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); + user_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | An app id + App app = new App(); // App | + try { + App result = apiInstance.updateApp(appId, app); + System.out.println(result); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| An app id | | +| **app** | [**App**](App.md)| | | + +### Return type + +[**App**](App.md) + +### Authorization + +[user_key](../README.md#user_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **updatePlayer** +> InlineResponse2001 updatePlayer(playerId, player) + +Edit device + +Update an existing device in one of your 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String playerId = "playerId_example"; // String | Player's OneSignal ID + Player player = new Player(); // Player | + try { + InlineResponse2001 result = apiInstance.updatePlayer(playerId, player); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updatePlayer"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **playerId** | **String**| Player's OneSignal ID | | +| **player** | [**Player**](Player.md)| | | + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + + +# **updatePlayerTags** +> InlineResponse2003 updatePlayerTags(appId, externalUserId, updatePlayerTagsRequestBody) + +Edit tags with external user id + +Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + +### 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://onesignal.com/api/v1"); + + // Configure HTTP bearer authorization: app_key + HttpBearerAuth app_key = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); + app_key.setBearerToken("BEARER TOKEN"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "appId_example"; // String | The OneSignal App ID the user record is found under. + String externalUserId = "externalUserId_example"; // String | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. + UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody = new UpdatePlayerTagsRequestBody(); // UpdatePlayerTagsRequestBody | + try { + InlineResponse2003 result = apiInstance.updatePlayerTags(appId, externalUserId, updatePlayerTagsRequestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updatePlayerTags"); + 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 the user record is found under. | | +| **externalUserId** | **String**| The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. | | +| **updatePlayerTagsRequestBody** | [**UpdatePlayerTagsRequestBody**](UpdatePlayerTagsRequestBody.md)| | [optional] | + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + diff --git a/docs/DeliveryData.md b/docs/DeliveryData.md new file mode 100644 index 0000000..8c02006 --- /dev/null +++ b/docs/DeliveryData.md @@ -0,0 +1,17 @@ + + +# DeliveryData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**successful** | **Integer** | | [optional] | +|**failed** | **Integer** | | [optional] | +|**errored** | **Integer** | | [optional] | +|**converted** | **Integer** | | [optional] | +|**received** | **Integer** | | [optional] | + + + diff --git a/docs/ExportPlayersRequestBody.md b/docs/ExportPlayersRequestBody.md new file mode 100644 index 0000000..64f49ec --- /dev/null +++ b/docs/ExportPlayersRequestBody.md @@ -0,0 +1,15 @@ + + +# ExportPlayersRequestBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**extraFields** | **List<String>** | Additional fields that you wish to include. Currently supports location, country, rooted, notification_types, ip, external_user_id, web_auth, and web_p256. | [optional] | +|**lastActiveSince** | **Integer** | Export all devices with a last_active timestamp greater than this time. Unixtime in seconds. | [optional] | +|**segmentName** | **String** | Export al ldevices belonging to the segment. | [optional] | + + + diff --git a/docs/Filter.md b/docs/Filter.md new file mode 100644 index 0000000..c091fe0 --- /dev/null +++ b/docs/Filter.md @@ -0,0 +1,31 @@ + + +# Filter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**field** | **String** | Name of the field to use as the first operand in the filter expression. | | +|**key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | +|**value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | +|**relation** | [**RelationEnum**](#RelationEnum) | Operator of a filter expression. | | + + + +## Enum: RelationEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN | ">" | +| LESS_THAN | "<" | +| EQUAL | "=" | +| NOT_EQUAL | "!=" | +| EXISTS | "exists" | +| NOT_EXISTS | "not_exists" | +| TIME_ELAPSED_GT | "time_elapsed_gt" | +| TIME_ELAPSED_LT | "time_elapsed_lt" | + + + diff --git a/docs/FilterExpressions.md b/docs/FilterExpressions.md new file mode 100644 index 0000000..39fba47 --- /dev/null +++ b/docs/FilterExpressions.md @@ -0,0 +1,41 @@ + + +# FilterExpressions + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**field** | **String** | Name of the field to use as the first operand in the filter expression. | | +|**key** | **String** | If `field` is `tag`, this field is *required* to specify `key` inside the tags. | [optional] | +|**value** | **String** | Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator. | [optional] | +|**relation** | [**RelationEnum**](#RelationEnum) | Operator of a filter expression. | | +|**operator** | [**OperatorEnum**](#OperatorEnum) | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] | + + + +## Enum: RelationEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN | ">" | +| LESS_THAN | "<" | +| EQUAL | "=" | +| NOT_EQUAL | "!=" | +| EXISTS | "exists" | +| NOT_EXISTS | "not_exists" | +| TIME_ELAPSED_GT | "time_elapsed_gt" | +| TIME_ELAPSED_LT | "time_elapsed_lt" | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| OR | "OR" | +| AND | "AND" | + + + diff --git a/docs/FilterNotificationTarget.md b/docs/FilterNotificationTarget.md new file mode 100644 index 0000000..7e239f0 --- /dev/null +++ b/docs/FilterNotificationTarget.md @@ -0,0 +1,24 @@ + + +# FilterNotificationTarget + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" | [optional] | +|**firstSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" | [optional] | +|**sessionCount** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" | [optional] | +|**sessionTime** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" | [optional] | +|**amountSpent** | **String** | relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" | [optional] | +|**boughtSku** | **String** | relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" | [optional] | +|**tag** | **String** | relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters | [optional] | +|**language** | **String** | relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. | [optional] | +|**appVersion** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" | [optional] | +|**location** | **String** | radius = in meters lat = latitude long = longitude | [optional] | +|**email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | +|**country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | + + + diff --git a/docs/GetNotificationRequestBody.md b/docs/GetNotificationRequestBody.md new file mode 100644 index 0000000..bfbf4ed --- /dev/null +++ b/docs/GetNotificationRequestBody.md @@ -0,0 +1,24 @@ + + +# GetNotificationRequestBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**events** | [**EventsEnum**](#EventsEnum) | -> \"sent\" - All the devices by player_id that were sent the specified notification_id. Notifications targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. \"clicked\" - All the devices by `player_id` that clicked the specified notification_id. | [optional] | +|**email** | **String** | The email address you would like the report sent. | [optional] | +|**appId** | **String** | | [optional] | + + + +## Enum: EventsEnum + +| Name | Value | +|---- | -----| +| SENT | "sent" | +| CLICKED | "clicked" | + + + diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md new file mode 100644 index 0000000..845f3a3 --- /dev/null +++ b/docs/InlineResponse200.md @@ -0,0 +1,16 @@ + + +# InlineResponse200 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**recipients** | **Integer** | Estimated number of subscribers targetted by notification. | | +|**externalId** | **String** | | [optional] | +|**errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | + + + diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md new file mode 100644 index 0000000..ddc3c58 --- /dev/null +++ b/docs/InlineResponse2001.md @@ -0,0 +1,13 @@ + + +# InlineResponse2001 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **String** | | [optional] | + + + diff --git a/docs/InlineResponse2002.md b/docs/InlineResponse2002.md new file mode 100644 index 0000000..6ea4b17 --- /dev/null +++ b/docs/InlineResponse2002.md @@ -0,0 +1,14 @@ + + +# InlineResponse2002 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **String** | | [optional] | +|**destinationUrl** | **String** | | [optional] | + + + diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md new file mode 100644 index 0000000..6be7854 --- /dev/null +++ b/docs/InlineResponse2003.md @@ -0,0 +1,13 @@ + + +# InlineResponse2003 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | + + + diff --git a/docs/InlineResponse2004.md b/docs/InlineResponse2004.md new file mode 100644 index 0000000..c7e617c --- /dev/null +++ b/docs/InlineResponse2004.md @@ -0,0 +1,14 @@ + + +# InlineResponse2004 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**id** | **String** | | [optional] | + + + diff --git a/docs/InlineResponse2005.md b/docs/InlineResponse2005.md new file mode 100644 index 0000000..55c7a90 --- /dev/null +++ b/docs/InlineResponse2005.md @@ -0,0 +1,13 @@ + + +# InlineResponse2005 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**csvFileUrl** | **String** | | [optional] | + + + diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md new file mode 100644 index 0000000..97ff5a6 --- /dev/null +++ b/docs/InlineResponse201.md @@ -0,0 +1,14 @@ + + +# InlineResponse201 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**id** | **String** | UUID of created segment | [optional] | + + + diff --git a/docs/InlineResponse400.md b/docs/InlineResponse400.md new file mode 100644 index 0000000..7193a9e --- /dev/null +++ b/docs/InlineResponse400.md @@ -0,0 +1,13 @@ + + +# InlineResponse400 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**errors** | **List<String>** | | [optional] | + + + diff --git a/docs/InlineResponse4001.md b/docs/InlineResponse4001.md new file mode 100644 index 0000000..3d58d77 --- /dev/null +++ b/docs/InlineResponse4001.md @@ -0,0 +1,14 @@ + + +# InlineResponse4001 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **String** | | [optional] | +|**errors** | **List<String>** | | [optional] | + + + diff --git a/docs/InlineResponse4002.md b/docs/InlineResponse4002.md new file mode 100644 index 0000000..3c973ba --- /dev/null +++ b/docs/InlineResponse4002.md @@ -0,0 +1,14 @@ + + +# InlineResponse4002 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**errors** | **List<String>** | | [optional] | + + + diff --git a/docs/InlineResponse4003.md b/docs/InlineResponse4003.md new file mode 100644 index 0000000..5506691 --- /dev/null +++ b/docs/InlineResponse4003.md @@ -0,0 +1,13 @@ + + +# InlineResponse4003 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**erorrs** | **List<String>** | | [optional] | + + + diff --git a/docs/InvalidIdentifierError.md b/docs/InvalidIdentifierError.md new file mode 100644 index 0000000..1b976e4 --- /dev/null +++ b/docs/InvalidIdentifierError.md @@ -0,0 +1,14 @@ + + +# InvalidIdentifierError + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**invalidExternalUserIds** | **List<String>** | Returned if using include_external_user_ids | [optional] | +|**invalidPlayerIds** | **List<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | + + + diff --git a/docs/Notification.md b/docs/Notification.md new file mode 100644 index 0000000..3903f18 --- /dev/null +++ b/docs/Notification.md @@ -0,0 +1,133 @@ + + +# Notification + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +|**lastSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" | [optional] | +|**firstSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" | [optional] | +|**sessionCount** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" | [optional] | +|**sessionTime** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" | [optional] | +|**amountSpent** | **String** | relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" | [optional] | +|**boughtSku** | **String** | relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" | [optional] | +|**tag** | **String** | relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters | [optional] | +|**language** | **String** | relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. | [optional] | +|**appVersion** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" | [optional] | +|**location** | **String** | radius = in meters lat = latitude long = longitude | [optional] | +|**email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | +|**country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | +|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] 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 channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +|**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**id** | **String** | | [optional] | +|**value** | **Integer** | | [optional] [readonly] | +|**aggregation** | [**AggregationEnum**](#AggregationEnum) | | [optional] [readonly] | +|**isIos** | **Boolean** | Indicates whether to send to all devices registered under your app's Apple iOS platform. | [optional] | +|**isAndroid** | **Boolean** | Indicates whether to send to all devices registered under your app's Google Android platform. | [optional] | +|**isHuawei** | **Boolean** | Indicates whether to send to all devices registered under your app's Huawei Android platform. | [optional] | +|**isAnyWeb** | **Boolean** | Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. | [optional] | +|**isChromeWeb** | **Boolean** | Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform. | [optional] | +|**isFirefox** | **Boolean** | Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform. | [optional] | +|**isSafari** | **Boolean** | Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari | [optional] | +|**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | +|**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | +|**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | +|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | +|**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | +|**externalId** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. 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 external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | +|**contents** | [**StringMap**](StringMap.md) | | [optional] | +|**headings** | [**StringMap**](StringMap.md) | | [optional] | +|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | +|**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | +|**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | +|**webUrl** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com | [optional] | +|**appUrl** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com | [optional] | +|**iosAttachments** | **Object** | Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: {\"id1\": \"https://domain.com/image.jpg\"} | [optional] | +|**templateId** | **String** | Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c | [optional] | +|**contentAvailable** | **Boolean** | Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. | [optional] | +|**mutableContent** | **Boolean** | Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. | [optional] | +|**targetContentIdentifier** | **String** | Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. | [optional] | +|**bigPicture** | **String** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**huaweiBigPicture** | **String** | Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**admBigPicture** | **String** | Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | +|**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | +|**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | +|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | +|**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +|**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +|**existingAndroidChannelId** | **String** | Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +|**huaweiExistingChannelId** | **String** | Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +|**androidBackgroundLayout** | [**NotificationAllOfAndroidBackgroundLayout**](NotificationAllOfAndroidBackgroundLayout.md) | | [optional] | +|**smallIcon** | **String** | Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +|**huaweiSmallIcon** | **String** | Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set. | [optional] | +|**largeIcon** | **String** | Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**huaweiLargeIcon** | **String** | Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**admSmallIcon** | **String** | Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +|**admLargeIcon** | **String** | Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**chromeWebIcon** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon. | [optional] | +|**chromeWebBadge** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. | [optional] | +|**firefoxIcon** | **String** | Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. | [optional] | +|**chromeIcon** | **String** | Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. | [optional] | +|**iosSound** | **String** | Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" | [optional] | +|**androidSound** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +|**huaweiSound** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | +|**admSound** | **String** | Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +|**wpWnsSound** | **String** | Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" | [optional] | +|**androidLedColor** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | +|**huaweiLedColor** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | +|**androidAccentColor** | **String** | Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" | [optional] | +|**huaweiAccentColor** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. | [optional] | +|**androidVisibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +|**huaweiVisibility** | **Integer** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +|**iosBadgeType** | **String** | Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. | [optional] | +|**iosBadgeCount** | **Integer** | Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. | [optional] | +|**collapseId** | **String** | Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. | [optional] | +|**webPushTopic** | **String** | Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. | [optional] | +|**apnsAlert** | **Object** | Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. | [optional] | +|**sendAfter** | **String** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | +|**delayedOption** | **String** | Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. | [optional] | +|**deliveryTimeOfDay** | **String** | Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" | [optional] | +|**ttl** | **Integer** | Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). | [optional] | +|**priority** | **Integer** | Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. | [optional] | +|**apnsPushTypeOverride** | **String** | Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal | [optional] | +|**throttleRatePerMinute** | **String** | Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings. - parameter value 0 indicates not to apply throttling to the notification. - if the parameter is not passed then the default app throttling value will be applied to the notification. Apps with throttling disabled: - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level. Refer to throttling for more details. | [optional] | +|**androidGroup** | **String** | Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +|**androidGroupMessage** | **String** | Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +|**admGroup** | **String** | Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +|**admGroupMessage** | **Object** | Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +|**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | +|**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | +|**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**emailSubect** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | +|**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | +|**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | +|**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | +|**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | + + + +## Enum: AggregationEnum + +| Name | Value | +|---- | -----| +| SUM | "sum" | +| COUNT | "count" | + + + diff --git a/docs/Notification200Errors.md b/docs/Notification200Errors.md new file mode 100644 index 0000000..21dff4b --- /dev/null +++ b/docs/Notification200Errors.md @@ -0,0 +1,14 @@ + + +# Notification200Errors + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**invalidExternalUserIds** | **List<String>** | Returned if using include_external_user_ids | [optional] | +|**invalidPlayerIds** | **List<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | + + + diff --git a/docs/NotificationAllOf.md b/docs/NotificationAllOf.md new file mode 100644 index 0000000..588dc2a --- /dev/null +++ b/docs/NotificationAllOf.md @@ -0,0 +1,109 @@ + + +# NotificationAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**value** | **Integer** | | [optional] [readonly] | +|**aggregation** | [**AggregationEnum**](#AggregationEnum) | | [optional] [readonly] | +|**isIos** | **Boolean** | Indicates whether to send to all devices registered under your app's Apple iOS platform. | [optional] | +|**isAndroid** | **Boolean** | Indicates whether to send to all devices registered under your app's Google Android platform. | [optional] | +|**isHuawei** | **Boolean** | Indicates whether to send to all devices registered under your app's Huawei Android platform. | [optional] | +|**isAnyWeb** | **Boolean** | Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. | [optional] | +|**isChromeWeb** | **Boolean** | Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform. | [optional] | +|**isFirefox** | **Boolean** | Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform. | [optional] | +|**isSafari** | **Boolean** | Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari | [optional] | +|**isWPWNS** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | +|**isAdm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | +|**isChrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | +|**channelForExternalUserIds** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | +|**appId** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | [optional] | +|**externalId** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. 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 external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | +|**contents** | [**StringMap**](StringMap.md) | | [optional] | +|**headings** | [**StringMap**](StringMap.md) | | [optional] | +|**subtitle** | [**StringMap**](StringMap.md) | | [optional] | +|**data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | +|**huaweiMsgType** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | +|**url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | +|**webUrl** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com | [optional] | +|**appUrl** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com | [optional] | +|**iosAttachments** | **Object** | Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: {\"id1\": \"https://domain.com/image.jpg\"} | [optional] | +|**templateId** | **String** | Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c | [optional] | +|**contentAvailable** | **Boolean** | Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. | [optional] | +|**mutableContent** | **Boolean** | Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. | [optional] | +|**targetContentIdentifier** | **String** | Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. | [optional] | +|**bigPicture** | **String** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**huaweiBigPicture** | **String** | Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**admBigPicture** | **String** | Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +|**chromeBigPicture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | +|**chromeWebImage** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | +|**buttons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | +|**webButtons** | [**List<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +|**iosCategory** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | +|**androidChannelId** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +|**huaweiChannelId** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +|**existingAndroidChannelId** | **String** | Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +|**huaweiExistingChannelId** | **String** | Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +|**androidBackgroundLayout** | [**NotificationAllOfAndroidBackgroundLayout**](NotificationAllOfAndroidBackgroundLayout.md) | | [optional] | +|**smallIcon** | **String** | Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +|**huaweiSmallIcon** | **String** | Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set. | [optional] | +|**largeIcon** | **String** | Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**huaweiLargeIcon** | **String** | Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**admSmallIcon** | **String** | Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +|**admLargeIcon** | **String** | Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +|**chromeWebIcon** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon. | [optional] | +|**chromeWebBadge** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. | [optional] | +|**firefoxIcon** | **String** | Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. | [optional] | +|**chromeIcon** | **String** | Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. | [optional] | +|**iosSound** | **String** | Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" | [optional] | +|**androidSound** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +|**huaweiSound** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | +|**admSound** | **String** | Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +|**wpWnsSound** | **String** | Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" | [optional] | +|**androidLedColor** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | +|**huaweiLedColor** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | +|**androidAccentColor** | **String** | Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" | [optional] | +|**huaweiAccentColor** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. | [optional] | +|**androidVisibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +|**huaweiVisibility** | **Integer** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +|**iosBadgeType** | **String** | Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. | [optional] | +|**iosBadgeCount** | **Integer** | Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. | [optional] | +|**collapseId** | **String** | Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. | [optional] | +|**webPushTopic** | **String** | Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. | [optional] | +|**apnsAlert** | **Object** | Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. | [optional] | +|**sendAfter** | **String** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | +|**delayedOption** | **String** | Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. | [optional] | +|**deliveryTimeOfDay** | **String** | Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" | [optional] | +|**ttl** | **Integer** | Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). | [optional] | +|**priority** | **Integer** | Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. | [optional] | +|**apnsPushTypeOverride** | **String** | Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal | [optional] | +|**throttleRatePerMinute** | **String** | Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings. - parameter value 0 indicates not to apply throttling to the notification. - if the parameter is not passed then the default app throttling value will be applied to the notification. Apps with throttling disabled: - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level. Refer to throttling for more details. | [optional] | +|**androidGroup** | **String** | Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +|**androidGroupMessage** | **String** | Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +|**admGroup** | **String** | Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +|**admGroupMessage** | **Object** | Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +|**threadId** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | +|**summaryArg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | +|**summaryArgCount** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +|**emailSubect** | **String** | Channel: Email Required. The subject of the email. | [optional] | +|**emailBody** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | +|**emailFromName** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | +|**emailFromAddress** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | +|**smsFrom** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | +|**smsMediaUrls** | **List<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | + + + +## Enum: AggregationEnum + +| Name | Value | +|---- | -----| +| SUM | "sum" | +| COUNT | "count" | + + + diff --git a/docs/NotificationAllOfAndroidBackgroundLayout.md b/docs/NotificationAllOfAndroidBackgroundLayout.md new file mode 100644 index 0000000..e804d62 --- /dev/null +++ b/docs/NotificationAllOfAndroidBackgroundLayout.md @@ -0,0 +1,16 @@ + + +# NotificationAllOfAndroidBackgroundLayout + +Channel: Push Notifications Platform: Android Allowing setting a background image for the notification. This is a JSON object containing the following keys. See our Background Image documentation for image sizes. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**image** | **String** | Asset file, android resource name, or URL to remote image. | [optional] | +|**headingsColor** | **String** | Title text color ARGB Hex format. Example(Blue) \"FF0000FF\". | [optional] | +|**contentsColor** | **String** | Body text color ARGB Hex format. Example(Red) \"FFFF0000\". | [optional] | + + + diff --git a/docs/NotificationSlice.md b/docs/NotificationSlice.md new file mode 100644 index 0000000..88dce5c --- /dev/null +++ b/docs/NotificationSlice.md @@ -0,0 +1,16 @@ + + +# NotificationSlice + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalCount** | **Integer** | | [optional] | +|**offset** | **Integer** | | [optional] | +|**limit** | **Integer** | | [optional] | +|**notifications** | [**List<Notification>**](Notification.md) | | [optional] | + + + diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md new file mode 100644 index 0000000..e6620b8 --- /dev/null +++ b/docs/NotificationTarget.md @@ -0,0 +1,36 @@ + + +# NotificationTarget + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +|**lastSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" | [optional] | +|**firstSession** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" | [optional] | +|**sessionCount** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" | [optional] | +|**sessionTime** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" | [optional] | +|**amountSpent** | **String** | relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" | [optional] | +|**boughtSku** | **String** | relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" | [optional] | +|**tag** | **String** | relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters | [optional] | +|**language** | **String** | relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. | [optional] | +|**appVersion** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" | [optional] | +|**location** | **String** | radius = in meters lat = latitude long = longitude | [optional] | +|**email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | +|**country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | +|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] 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 channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +|**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | + + + diff --git a/docs/Operator.md b/docs/Operator.md new file mode 100644 index 0000000..b8a0b9e --- /dev/null +++ b/docs/Operator.md @@ -0,0 +1,22 @@ + + +# Operator + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**operator** | [**OperatorEnum**](#OperatorEnum) | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| OR | "OR" | +| AND | "AND" | + + + diff --git a/docs/OutcomeData.md b/docs/OutcomeData.md new file mode 100644 index 0000000..5ed83eb --- /dev/null +++ b/docs/OutcomeData.md @@ -0,0 +1,24 @@ + + +# OutcomeData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**value** | **Integer** | | | +|**aggregation** | [**AggregationEnum**](#AggregationEnum) | | | + + + +## Enum: AggregationEnum + +| Name | Value | +|---- | -----| +| SUM | "sum" | +| COUNT | "count" | + + + diff --git a/docs/OutcomesData.md b/docs/OutcomesData.md new file mode 100644 index 0000000..6b56a70 --- /dev/null +++ b/docs/OutcomesData.md @@ -0,0 +1,13 @@ + + +# OutcomesData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**outcomes** | [**List<OutcomeData>**](OutcomeData.md) | | [optional] | + + + diff --git a/docs/PlatformDeliveryData.md b/docs/PlatformDeliveryData.md new file mode 100644 index 0000000..5399fdb --- /dev/null +++ b/docs/PlatformDeliveryData.md @@ -0,0 +1,19 @@ + + +# PlatformDeliveryData + +Hash of delivery statistics broken out by target device platform. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**edgeWebPush** | [**DeliveryData**](DeliveryData.md) | | [optional] | +|**chromeWebPush** | [**DeliveryData**](DeliveryData.md) | | [optional] | +|**firefoxWebPush** | [**DeliveryData**](DeliveryData.md) | | [optional] | +|**safariWebPush** | [**DeliveryData**](DeliveryData.md) | | [optional] | +|**android** | [**DeliveryData**](DeliveryData.md) | | [optional] | +|**ios** | [**DeliveryData**](DeliveryData.md) | | [optional] | + + + diff --git a/docs/Player.md b/docs/Player.md new file mode 100644 index 0000000..8b9aa97 --- /dev/null +++ b/docs/Player.md @@ -0,0 +1,39 @@ + + +# Player + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The device's OneSignal ID | [readonly] | +|**invalidIdentifier** | **Boolean** | If true, this is the equivalent of a user being Unsubscribed | [optional] [readonly] | +|**appId** | **String** | | | +|**deviceType** | **Integer** | Required The device's platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS | | +|**externalUserId** | **String** | a custom user ID | [optional] | +|**externalUserIdAuthHash** | **String** | Only required if you have enabled Identity Verification and device_type is NOT 11 email. | [optional] | +|**emailAuthHash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | +|**identifier** | **String** | Recommended: For Push Notifications, this is the Push Token Identifier from Google or Apple. For Apple Push identifiers, you must strip all non alphanumeric characters. Examples: iOS: 7abcd558f29d0b1f048083e2834ad8ea4b3d87d8ad9c088b33c132706ff445f0 Android: APA91bHbYHk7aq-Uam_2pyJ2qbZvqllyyh2wjfPRaw5gLEX2SUlQBRvOc6sck1sa7H7nGeLNlDco8lXj83HWWwzV... For Email Addresses, set the full email address email@email.com and make sure to set device_type to 11. | [optional] | +|**language** | **String** | Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en | [optional] | +|**timezone** | **Integer** | Number of seconds away from UTC. Example: -28800 | [optional] | +|**gameVersion** | **String** | Version of your app. Example: 1.1 | [optional] | +|**deviceModel** | **String** | Device make and model. Example: iPhone5,1 | [optional] | +|**deviceOs** | **String** | Device operating system version. Example: 7.0.4 | [optional] | +|**adId** | **String** | The ad id for the device's platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId | [optional] | +|**sdk** | **String** | Name and version of the sdk/plugin that's calling this API method (if any) | [optional] | +|**sessionCount** | **Integer** | Number of times the user has played the game, defaults to 1 | [optional] | +|**tags** | **Object** | Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {\"foo\":\"bar\",\"this\":\"that\"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | +|**amountSpent** | **String** | Amount the user has spent in USD, up to two decimal places | [optional] | +|**createdAt** | **Integer** | Unixtime when the player joined the game | [optional] | +|**playtime** | **Integer** | Seconds player was running your app. | [optional] | +|**badgeCount** | **Integer** | Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client. | [optional] | +|**lastActive** | **Integer** | Unixtime when the player was last active | [optional] | +|**notificationTypes** | **Integer** | 1 = subscribed -2 = unsubscribed iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues. | [optional] | +|**testType** | **Integer** | This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. 1 = Development 2 = Ad-Hoc Omit this field for App Store builds. | [optional] | +|**_long** | **BigDecimal** | Longitude of the device, used for geotagging to segment on. | [optional] | +|**lat** | **BigDecimal** | Latitude of the device, used for geotagging to segment on. | [optional] | +|**country** | **String** | Country code in the ISO 3166-1 Alpha 2 format | [optional] | + + + diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md new file mode 100644 index 0000000..111b5f6 --- /dev/null +++ b/docs/PlayerNotificationTarget.md @@ -0,0 +1,22 @@ + + +# PlayerNotificationTarget + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includePlayerIds** | **List<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +|**includeExternalUserIds** | **List<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] 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 channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +|**includeEmailTokens** | **List<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +|**includePhoneNumbers** | **List<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +|**includeIosTokens** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +|**includeWpWnsUris** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +|**includeAmazonRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeChromeWebRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +|**includeAndroidRegIds** | **List<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | + + + diff --git a/docs/PlayerSlice.md b/docs/PlayerSlice.md new file mode 100644 index 0000000..030cf7c --- /dev/null +++ b/docs/PlayerSlice.md @@ -0,0 +1,16 @@ + + +# PlayerSlice + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalCount** | **Integer** | | [optional] | +|**offset** | **Integer** | | [optional] | +|**limit** | **Integer** | | [optional] | +|**players** | [**List<Player>**](Player.md) | | [optional] | + + + diff --git a/docs/Purchase.md b/docs/Purchase.md new file mode 100644 index 0000000..664117d --- /dev/null +++ b/docs/Purchase.md @@ -0,0 +1,15 @@ + + +# Purchase + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sku** | **String** | The unique identifier of the purchased item. | | +|**amount** | **BigDecimal** | The amount, in USD, spent purchasing the item. | | +|**iso** | **String** | The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. | | + + + diff --git a/docs/Segment.md b/docs/Segment.md new file mode 100644 index 0000000..71d5e7d --- /dev/null +++ b/docs/Segment.md @@ -0,0 +1,15 @@ + + +# Segment + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | UUID of the segment. If left empty, it will be assigned automaticaly. | [optional] | +|**name** | **String** | Name of the segment. You'll see this name on the Web UI. | | +|**filters** | [**List<FilterExpressions>**](FilterExpressions.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | | + + + diff --git a/docs/SegmentNotificationTarget.md b/docs/SegmentNotificationTarget.md new file mode 100644 index 0000000..9fe3346 --- /dev/null +++ b/docs/SegmentNotificationTarget.md @@ -0,0 +1,14 @@ + + +# SegmentNotificationTarget + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**includedSegments** | **List<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +|**excludedSegments** | **List<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | + + + diff --git a/docs/StringMap.md b/docs/StringMap.md new file mode 100644 index 0000000..e57ccbd --- /dev/null +++ b/docs/StringMap.md @@ -0,0 +1,55 @@ + + +# StringMap + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**en** | **String** | Text in English. Will be used as a fallback | | +|**ar** | **String** | Text in Arabic. | [optional] | +|**bs** | **String** | Text in Bosnian. | [optional] | +|**bg** | **String** | Text in Bulgarian. | [optional] | +|**ca** | **String** | Text in Catalan. | [optional] | +|**zhHans** | **String** | Text in Chinese (Simplified). | [optional] | +|**zhHant** | **String** | Text in Chinese (Traditional). | [optional] | +|**zh** | **String** | Alias for zh-Hans. | [optional] | +|**hr** | **String** | Text in Croatian. | [optional] | +|**cs** | **String** | Text in Czech. | [optional] | +|**da** | **String** | Text in Danish. | [optional] | +|**nl** | **String** | Text in Dutch. | [optional] | +|**et** | **String** | Text in Estonian. | [optional] | +|**fi** | **String** | Text in Finnish. | [optional] | +|**fr** | **String** | Text in French. | [optional] | +|**ka** | **String** | Text in Georgian. | [optional] | +|**de** | **String** | Text in German. | [optional] | +|**el** | **String** | Text in Greek. | [optional] | +|**hi** | **String** | Text in Hindi. | [optional] | +|**he** | **String** | Text in Hebrew. | [optional] | +|**hu** | **String** | Text in Hungarian. | [optional] | +|**id** | **String** | Text in Indonesian. | [optional] | +|**it** | **String** | Text in Italian. | [optional] | +|**ja** | **String** | Text in Japanese. | [optional] | +|**ko** | **String** | Text in Korean. | [optional] | +|**lv** | **String** | Text in Latvian. | [optional] | +|**lt** | **String** | Text in Lithuanian. | [optional] | +|**ms** | **String** | Text in Malay. | [optional] | +|**nb** | **String** | Text in Norwegian. | [optional] | +|**pl** | **String** | Text in Polish. | [optional] | +|**fa** | **String** | Text in Persian. | [optional] | +|**pt** | **String** | Text in Portugese. | [optional] | +|**pa** | **String** | Text in Punjabi. | [optional] | +|**ro** | **String** | Text in Romanian. | [optional] | +|**ru** | **String** | Text in Russian. | [optional] | +|**sr** | **String** | Text in Serbian. | [optional] | +|**sk** | **String** | Text in Slovak. | [optional] | +|**es** | **String** | Text in Spanish. | [optional] | +|**sv** | **String** | Text in Swedish. | [optional] | +|**th** | **String** | Text in Thai. | [optional] | +|**tr** | **String** | Text in Turkish. | [optional] | +|**uk** | **String** | Text in Ukrainian. | [optional] | +|**vi** | **String** | Text in Vietnamese. | [optional] | + + + diff --git a/docs/UpdatePlayerTagsRequestBody.md b/docs/UpdatePlayerTagsRequestBody.md new file mode 100644 index 0000000..03af344 --- /dev/null +++ b/docs/UpdatePlayerTagsRequestBody.md @@ -0,0 +1,13 @@ + + +# UpdatePlayerTagsRequestBody + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tags** | **Object** | Custom tags for the device record. Only support string key value pairs. Does not support arrays or other nested objects. Example `{\"foo\":\"bar\",\"this\":\"that\"}`. Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of ata Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | + + + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..a340857 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..7454180f2ae8848c63b8b4dea2cb829da983f2fa GIT binary patch literal 59536 zcma&NbC71ylI~qywr$(CZQJHswz}-9F59+k+g;UV+cs{`J?GrGXYR~=-ydruB3JCa zB64N^cILAcWk5iofq)<(fq;O7{th4@;QxID0)qN`mJ?GIqLY#rX8-|G{5M0pdVW5^ zzXk$-2kQTAC?_N@B`&6-N-rmVFE=$QD?>*=4<|!MJu@}isLc4AW#{m2if&A5T5g&~ ziuMQeS*U5sL6J698wOd)K@oK@1{peP5&Esut<#VH^u)gp`9H4)`uE!2$>RTctN+^u z=ASkePDZA-X8)rp%D;p*~P?*a_=*Kwc<^>QSH|^<0>o37lt^+Mj1;4YvJ(JR-Y+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+k3esbJE=-P5S$&KdFp+2H7_2e=}OKDrf( z9-207?6$@f4m4B+9E*e((Y89!q?zH|mz_vM>kp*HGXldO0Hg#!EtFhRuOm$u8e~a9 z5(roy7m$Kh+zjW6@zw{&20u?1f2uP&boD}$#Zy)4o&T;vyBoqFiF2t;*g=|1=)PxB z8eM3Mp=l_obbc?I^xyLz?4Y1YDWPa+nm;O<$Cn;@ane616`J9OO2r=rZr{I_Kizyc zP#^^WCdIEp*()rRT+*YZK>V@^Zs=ht32x>Kwe zab)@ZEffz;VM4{XA6e421^h~`ji5r%)B{wZu#hD}f3$y@L0JV9f3g{-RK!A?vBUA}${YF(vO4)@`6f1 z-A|}e#LN{)(eXloDnX4Vs7eH|<@{r#LodP@Nz--$Dg_Par%DCpu2>2jUnqy~|J?eZ zBG4FVsz_A+ibdwv>mLp>P!(t}E>$JGaK$R~;fb{O3($y1ssQQo|5M;^JqC?7qe|hg zu0ZOqeFcp?qVn&Qu7FQJ4hcFi&|nR!*j)MF#b}QO^lN%5)4p*D^H+B){n8%VPUzi! zDihoGcP71a6!ab`l^hK&*dYrVYzJ0)#}xVrp!e;lI!+x+bfCN0KXwUAPU9@#l7@0& QuEJmfE|#`Dqx|px0L@K;Y5)KL literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ffed3a2 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..005bcde --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..6a68175 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..43b0e72 --- /dev/null +++ b/pom.xml @@ -0,0 +1,341 @@ + + 4.0.0 + org.openapitools + onesignal-java-client + jar + onesignal-java-client + 1.0.2 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OneSignal + team@openapitools.org + OneSignal + https://onesignal.com/ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.2 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-api + ${junit-version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.5 + 4.9.3 + 2.9.0 + 3.12.0 + 0.2.2 + 1.3.5 + 5.8.2 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.21.0 + + diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..b207c3c --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "onesignal-java-client" \ No newline at end of file diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f2ba354 --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/java/com/onesignal/client/ApiCallback.java b/src/main/java/com/onesignal/client/ApiCallback.java new file mode 100644 index 0000000..5edb97e --- /dev/null +++ b/src/main/java/com/onesignal/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * 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: 1.0.2 + * 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; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java new file mode 100644 index 0000000..0529fd3 --- /dev/null +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -0,0 +1,1476 @@ +/* + * 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: 1.0.2 + * 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; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.onesignal.client.auth.Authentication; +import com.onesignal.client.auth.HttpBasicAuth; +import com.onesignal.client.auth.HttpBearerAuth; +import com.onesignal.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "https://onesignal.com/api/v1"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("app_key", new HttpBearerAuth("bearer")); + authentications.put("user_key", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("app_key", new HttpBearerAuth("bearer")); + authentications.put("user_key", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.2/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://onesignal.com/api/v1 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.onesignal.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.onesignal.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.onesignal.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.onesignal.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link com.onesignal.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see
createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.onesignal.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.onesignal.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.onesignal.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.onesignal.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws com.onesignal.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.onesignal.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.onesignal.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.onesignal.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.onesignal.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } + } + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.onesignal.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/com/onesignal/client/ApiException.java b/src/main/java/com/onesignal/client/ApiException.java new file mode 100644 index 0000000..5c889f4 --- /dev/null +++ b/src/main/java/com/onesignal/client/ApiException.java @@ -0,0 +1,156 @@ +/* + * 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: 1.0.2 + * 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; + +import java.util.Map; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/src/main/java/com/onesignal/client/ApiResponse.java b/src/main/java/com/onesignal/client/ApiResponse.java new file mode 100644 index 0000000..fd250a8 --- /dev/null +++ b/src/main/java/com/onesignal/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * 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: 1.0.2 + * 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; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/com/onesignal/client/Configuration.java b/src/main/java/com/onesignal/client/Configuration.java new file mode 100644 index 0000000..fdd2f4c --- /dev/null +++ b/src/main/java/com/onesignal/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * 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: 1.0.2 + * 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; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java new file mode 100644 index 0000000..32c56b1 --- /dev/null +++ b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * 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: 1.0.2 + * 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; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java new file mode 100644 index 0000000..ee616c5 --- /dev/null +++ b/src/main/java/com/onesignal/client/JSON.java @@ -0,0 +1,438 @@ +/* + * 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: 1.0.2 + * 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; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new com.onesignal.client.model.App.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Button.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.DeliveryData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.ExportPlayersRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Filter.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.FilterExpressions.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.FilterNotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.GetNotificationRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse200.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2001.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2002.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2003.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2004.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse2005.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse201.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse400.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse4001.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse4002.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InlineResponse4003.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.InvalidIdentifierError.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Notification.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Notification200Errors.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationAllOfAndroidBackgroundLayout.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationSlice.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Operator.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.OutcomeData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.OutcomesData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.PlatformDeliveryData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Player.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.PlayerNotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.PlayerSlice.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Purchase.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.Segment.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentNotificationTarget.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.StringMap.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdatePlayerTagsRequestBody.CustomTypeAdapterFactory()) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/onesignal/client/Pair.java b/src/main/java/com/onesignal/client/Pair.java new file mode 100644 index 0000000..c564333 --- /dev/null +++ b/src/main/java/com/onesignal/client/Pair.java @@ -0,0 +1,57 @@ +/* + * 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: 1.0.2 + * 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; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/com/onesignal/client/ProgressRequestBody.java b/src/main/java/com/onesignal/client/ProgressRequestBody.java new file mode 100644 index 0000000..200114d --- /dev/null +++ b/src/main/java/com/onesignal/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * 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: 1.0.2 + * 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; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/com/onesignal/client/ProgressResponseBody.java b/src/main/java/com/onesignal/client/ProgressResponseBody.java new file mode 100644 index 0000000..9b204f3 --- /dev/null +++ b/src/main/java/com/onesignal/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * 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: 1.0.2 + * 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; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/com/onesignal/client/ServerConfiguration.java b/src/main/java/com/onesignal/client/ServerConfiguration.java new file mode 100644 index 0000000..dc1b93b --- /dev/null +++ b/src/main/java/com/onesignal/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package com.onesignal.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replaceAll("\\{" + name + "\\}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/onesignal/client/ServerVariable.java b/src/main/java/com/onesignal/client/ServerVariable.java new file mode 100644 index 0000000..73063ce --- /dev/null +++ b/src/main/java/com/onesignal/client/ServerVariable.java @@ -0,0 +1,23 @@ +package com.onesignal.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/onesignal/client/StringUtil.java b/src/main/java/com/onesignal/client/StringUtil.java new file mode 100644 index 0000000..9f5e0c8 --- /dev/null +++ b/src/main/java/com/onesignal/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * 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: 1.0.2 + * 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; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java new file mode 100644 index 0000000..8e805f8 --- /dev/null +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -0,0 +1,2801 @@ +/* + * 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: 1.0.2 + * 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.api; + +import com.onesignal.client.ApiCallback; +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.ApiResponse; +import com.onesignal.client.Configuration; +import com.onesignal.client.Pair; +import com.onesignal.client.ProgressRequestBody; +import com.onesignal.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.onesignal.client.model.App; +import com.onesignal.client.model.DeliveryData; +import com.onesignal.client.model.ExportPlayersRequestBody; +import com.onesignal.client.model.GetNotificationRequestBody; +import com.onesignal.client.model.InlineResponse200; +import com.onesignal.client.model.InlineResponse2001; +import com.onesignal.client.model.InlineResponse2002; +import com.onesignal.client.model.InlineResponse2003; +import com.onesignal.client.model.InlineResponse2004; +import com.onesignal.client.model.InlineResponse2005; +import com.onesignal.client.model.InlineResponse201; +import com.onesignal.client.model.InlineResponse400; +import com.onesignal.client.model.InlineResponse4001; +import com.onesignal.client.model.InlineResponse4002; +import com.onesignal.client.model.InlineResponse4003; +import com.onesignal.client.model.Notification; +import com.onesignal.client.model.NotificationSlice; +import com.onesignal.client.model.OutcomesData; +import com.onesignal.client.model.PlatformDeliveryData; +import com.onesignal.client.model.Player; +import com.onesignal.client.model.PlayerSlice; +import com.onesignal.client.model.Segment; +import com.onesignal.client.model.UpdatePlayerTagsRequestBody; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for cancelNotification + * @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 -
+ */ + public okhttp3.Call cancelNotificationCall(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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelNotificationValidateBeforeCall(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 cancelNotification(Async)"); + } + + // verify the required parameter 'notificationId' is set + if (notificationId == null) { + throw new ApiException("Missing the required parameter 'notificationId' when calling cancelNotification(Async)"); + } + + + okhttp3.Call localVarCall = cancelNotificationCall(appId, notificationId, _callback); + return localVarCall; + + } + + /** + * Stop a scheduled or currently outgoing notification + * Used to stop a scheduled or currently outgoing notification + * @param appId (required) + * @param notificationId (required) + * @return InlineResponse2001 + * @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 -
+ */ + public InlineResponse2001 cancelNotification(String appId, String notificationId) throws ApiException { + ApiResponse localVarResp = cancelNotificationWithHttpInfo(appId, notificationId); + return localVarResp.getData(); + } + + /** + * Stop a scheduled or currently outgoing notification + * Used to stop a scheduled or currently outgoing notification + * @param appId (required) + * @param notificationId (required) + * @return ApiResponse<InlineResponse2001> + * @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 -
+ */ + public ApiResponse cancelNotificationWithHttpInfo(String appId, String notificationId) throws ApiException { + okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Stop a scheduled or currently outgoing notification (asynchronously) + * Used to stop a scheduled or currently outgoing notification + * @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 -
+ */ + public okhttp3.Call cancelNotificationAsync(String appId, String notificationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = cancelNotificationValidateBeforeCall(appId, notificationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * 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 -
+ */ + public okhttp3.Call createAppCall(App app, 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 = app; + + // 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, name=onesignal-java, version=1.0.2"); + + 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[] { "user_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAppValidateBeforeCall(App app, 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)"); + } + + + okhttp3.Call localVarCall = createAppCall(app, _callback); + return localVarCall; + + } + + /** + * 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 -
+ */ + public App createApp(App app) throws ApiException { + ApiResponse localVarResp = createAppWithHttpInfo(app); + return localVarResp.getData(); + } + + /** + * 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 -
+ */ + public ApiResponse createAppWithHttpInfo(App app) throws ApiException { + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 -
+ */ + public okhttp3.Call createAppAsync(App app, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createAppValidateBeforeCall(app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * 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
200 OK, invalid_player_ids, invalid_external_user_ids 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_player_ids\" or \"invalid_external_user_ids\" 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 -
+ */ + public okhttp3.Call createNotificationCall(Notification notification, 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 = notification; + + // 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_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 { + + // 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 = createNotificationCall(notification, _callback); + return localVarCall; + + } + + /** + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return InlineResponse200 + * @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_player_ids, invalid_external_user_ids 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_player_ids\" or \"invalid_external_user_ids\" 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 -
+ */ + public InlineResponse200 createNotification(Notification notification) throws ApiException { + ApiResponse localVarResp = createNotificationWithHttpInfo(notification); + return localVarResp.getData(); + } + + /** + * Create notification + * Sends notifications to your users + * @param notification (required) + * @return ApiResponse<InlineResponse200> + * @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_player_ids, invalid_external_user_ids 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_player_ids\" or \"invalid_external_user_ids\" 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 -
+ */ + public ApiResponse createNotificationWithHttpInfo(Notification notification) throws ApiException { + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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
200 OK, invalid_player_ids, invalid_external_user_ids 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_player_ids\" or \"invalid_external_user_ids\" 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 -
+ */ + public okhttp3.Call createNotificationAsync(Notification notification, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createNotificationValidateBeforeCall(notification, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createPlayer + * @param player (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 -
+ */ + public okhttp3.Call createPlayerCall(Player player, 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 = player; + + // create path and map variables + String localVarPath = "/players"; + + 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPlayerValidateBeforeCall(Player player, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'player' is set + if (player == null) { + throw new ApiException("Missing the required parameter 'player' when calling createPlayer(Async)"); + } + + + okhttp3.Call localVarCall = createPlayerCall(player, _callback); + return localVarCall; + + } + + /** + * Add a device + * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + * @param player (required) + * @return InlineResponse2004 + * @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 -
+ */ + public InlineResponse2004 createPlayer(Player player) throws ApiException { + ApiResponse localVarResp = createPlayerWithHttpInfo(player); + return localVarResp.getData(); + } + + /** + * Add a device + * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + * @param player (required) + * @return ApiResponse<InlineResponse2004> + * @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 -
+ */ + public ApiResponse createPlayerWithHttpInfo(Player player) throws ApiException { + okhttp3.Call localVarCall = createPlayerValidateBeforeCall(player, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add a device (asynchronously) + * Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + * @param player (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 -
+ */ + public okhttp3.Call createPlayerAsync(Player player, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createPlayerValidateBeforeCall(player, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createSegments + * @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
201 Created -
400 Bad Request -
409 Conflict -
+ */ + public okhttp3.Call createSegmentsCall(String appId, Segment segment, 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 = segment; + + // 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSegmentsValidateBeforeCall(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 createSegments(Async)"); + } + + + okhttp3.Call localVarCall = createSegmentsCall(appId, segment, _callback); + return localVarCall; + + } + + /** + * Create Segments + * Create segments 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 Segments 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 InlineResponse201 + * @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 -
409 Conflict -
+ */ + public InlineResponse201 createSegments(String appId, Segment segment) throws ApiException { + ApiResponse localVarResp = createSegmentsWithHttpInfo(appId, segment); + return localVarResp.getData(); + } + + /** + * Create Segments + * Create segments 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 Segments 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<InlineResponse201> + * @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 -
409 Conflict -
+ */ + public ApiResponse createSegmentsWithHttpInfo(String appId, Segment segment) throws ApiException { + okhttp3.Call localVarCall = createSegmentsValidateBeforeCall(appId, segment, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Segments (asynchronously) + * Create segments 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 Segments 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
201 Created -
400 Bad Request -
409 Conflict -
+ */ + public okhttp3.Call createSegmentsAsync(String appId, Segment segment, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSegmentsValidateBeforeCall(appId, segment, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deletePlayer + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param playerId The OneSignal player_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 -
404 Not Found -
+ */ + public okhttp3.Call deletePlayerCall(String appId, String playerId, 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 = "/players/{player_id}" + .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePlayerValidateBeforeCall(String appId, String playerId, 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 deletePlayer(Async)"); + } + + // verify the required parameter 'playerId' is set + if (playerId == null) { + throw new ApiException("Missing the required parameter 'playerId' when calling deletePlayer(Async)"); + } + + + okhttp3.Call localVarCall = deletePlayerCall(appId, playerId, _callback); + return localVarCall; + + } + + /** + * Delete a user record + * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param playerId The OneSignal player_id (required) + * @return InlineResponse2001 + * @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 InlineResponse2001 deletePlayer(String appId, String playerId) throws ApiException { + ApiResponse localVarResp = deletePlayerWithHttpInfo(appId, playerId); + return localVarResp.getData(); + } + + /** + * Delete a user record + * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param playerId The OneSignal player_id (required) + * @return ApiResponse<InlineResponse2001> + * @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 deletePlayerWithHttpInfo(String appId, String playerId) throws ApiException { + okhttp3.Call localVarCall = deletePlayerValidateBeforeCall(appId, playerId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete a user record (asynchronously) + * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param playerId The OneSignal player_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 -
404 Not Found -
+ */ + public okhttp3.Call deletePlayerAsync(String appId, String playerId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePlayerValidateBeforeCall(appId, playerId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSegments + * @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 + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
+ */ + public okhttp3.Call deleteSegmentsCall(String appId, String segmentId, 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/{segment_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSegmentsValidateBeforeCall(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 deleteSegments(Async)"); + } + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling deleteSegments(Async)"); + } + + + okhttp3.Call localVarCall = deleteSegmentsCall(appId, segmentId, _callback); + return localVarCall; + + } + + /** + * Delete Segments + * Delete segments (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 InlineResponse2003 + * @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 InlineResponse2003 deleteSegments(String appId, String segmentId) throws ApiException { + ApiResponse localVarResp = deleteSegmentsWithHttpInfo(appId, segmentId); + return localVarResp.getData(); + } + + /** + * Delete Segments + * Delete segments (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<InlineResponse2003> + * @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 deleteSegmentsWithHttpInfo(String appId, String segmentId) throws ApiException { + okhttp3.Call localVarCall = deleteSegmentsValidateBeforeCall(appId, segmentId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Segments (asynchronously) + * Delete segments (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 + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
+ */ + public okhttp3.Call deleteSegmentsAsync(String appId, String segmentId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSegmentsValidateBeforeCall(appId, segmentId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for exportPlayers + * @param appId The app ID that you want to export devices from (required) + * @param exportPlayersRequestBody (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 -
+ */ + public okhttp3.Call exportPlayersCall(String appId, ExportPlayersRequestBody exportPlayersRequestBody, 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 = exportPlayersRequestBody; + + // create path and map variables + String localVarPath = "/players/csv_export?app_id={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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call exportPlayersValidateBeforeCall(String appId, ExportPlayersRequestBody exportPlayersRequestBody, 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 exportPlayers(Async)"); + } + + + okhttp3.Call localVarCall = exportPlayersCall(appId, exportPlayersRequestBody, _callback); + return localVarCall; + + } + + /** + * CSV export + * 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 exportPlayersRequestBody (optional) + * @return InlineResponse2005 + * @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 InlineResponse2005 exportPlayers(String appId, ExportPlayersRequestBody exportPlayersRequestBody) throws ApiException { + ApiResponse localVarResp = exportPlayersWithHttpInfo(appId, exportPlayersRequestBody); + return localVarResp.getData(); + } + + /** + * CSV export + * 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 exportPlayersRequestBody (optional) + * @return ApiResponse<InlineResponse2005> + * @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 exportPlayersWithHttpInfo(String appId, ExportPlayersRequestBody exportPlayersRequestBody) throws ApiException { + okhttp3.Call localVarCall = exportPlayersValidateBeforeCall(appId, exportPlayersRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * CSV export (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 exportPlayersRequestBody (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 -
+ */ + public okhttp3.Call exportPlayersAsync(String appId, ExportPlayersRequestBody exportPlayersRequestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = exportPlayersValidateBeforeCall(appId, exportPlayersRequestBody, _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 -
+ */ + 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, name=onesignal-java, version=1.0.2"); + + 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[] { "user_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + 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 getApp(Async)"); + } + + + okhttp3.Call localVarCall = getAppCall(appId, _callback); + return localVarCall; + + } + + /** + * 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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public App getApp(String appId) throws ApiException { + ApiResponse localVarResp = getAppWithHttpInfo(appId); + return localVarResp.getData(); + } + + /** + * 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 -
+ */ + 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 -
+ */ + 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 -
+ */ + 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, name=onesignal-java, version=1.0.2"); + + 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[] { "user_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 String + * @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 -
+ */ + public String getApps() throws ApiException { + ApiResponse localVarResp = getAppsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * View apps + * View the details of all of your current OneSignal apps + * @return ApiResponse<String> + * @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 -
+ */ + 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 -
+ */ + 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 -
+ */ + 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_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 Notification + * @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 -
+ */ + public Notification 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<Notification> + * @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 -
+ */ + 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 -
+ */ + 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 getNotificationRequestBody (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 getNotificationHistoryCall(String notificationId, GetNotificationRequestBody getNotificationRequestBody, 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 = getNotificationRequestBody; + + // 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNotificationHistoryValidateBeforeCall(String notificationId, GetNotificationRequestBody getNotificationRequestBody, 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 'getNotificationRequestBody' is set + if (getNotificationRequestBody == null) { + throw new ApiException("Missing the required parameter 'getNotificationRequestBody' when calling getNotificationHistory(Async)"); + } + + + okhttp3.Call localVarCall = getNotificationHistoryCall(notificationId, getNotificationRequestBody, _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 getNotificationRequestBody (required) + * @return InlineResponse2002 + * @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 InlineResponse2002 getNotificationHistory(String notificationId, GetNotificationRequestBody getNotificationRequestBody) throws ApiException { + ApiResponse localVarResp = getNotificationHistoryWithHttpInfo(notificationId, getNotificationRequestBody); + 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 getNotificationRequestBody (required) + * @return ApiResponse<InlineResponse2002> + * @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 getNotificationHistoryWithHttpInfo(String notificationId, GetNotificationRequestBody getNotificationRequestBody) throws ApiException { + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationRequestBody, 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 getNotificationRequestBody (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 getNotificationHistoryAsync(String notificationId, GetNotificationRequestBody getNotificationRequestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationHistoryValidateBeforeCall(notificationId, getNotificationRequestBody, _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 -
+ */ + public okhttp3.Call getNotificationsCall(String appId, String 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNotificationsValidateBeforeCall(String appId, String 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 -
+ */ + public NotificationSlice getNotifications(String appId, String 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 -
+ */ + public ApiResponse getNotificationsWithHttpInfo(String appId, String 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 -
+ */ + public okhttp3.Call getNotificationsAsync(String appId, String 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 -
+ */ + 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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_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 -
+ */ + 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 -
+ */ + 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 -
+ */ + 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 getPlayer + * @param appId Your app_id for this device (required) + * @param playerId Player's OneSignal ID (required) + * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (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 -
+ */ + public okhttp3.Call getPlayerCall(String appId, String playerId, String emailAuthHash, 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 = "/players/{player_id}" + .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.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, name=onesignal-java, version=1.0.2"); + + if (appId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); + } + + if (emailAuthHash != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email_auth_hash", emailAuthHash)); + } + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPlayerValidateBeforeCall(String appId, String playerId, String emailAuthHash, 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 getPlayer(Async)"); + } + + // verify the required parameter 'playerId' is set + if (playerId == null) { + throw new ApiException("Missing the required parameter 'playerId' when calling getPlayer(Async)"); + } + + + okhttp3.Call localVarCall = getPlayerCall(appId, playerId, emailAuthHash, _callback); + return localVarCall; + + } + + /** + * View device + * View the details of an existing device in one of your OneSignal apps + * @param appId Your app_id for this device (required) + * @param playerId Player's OneSignal ID (required) + * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @return Player + * @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 -
+ */ + public Player getPlayer(String appId, String playerId, String emailAuthHash) throws ApiException { + ApiResponse localVarResp = getPlayerWithHttpInfo(appId, playerId, emailAuthHash); + return localVarResp.getData(); + } + + /** + * View device + * View the details of an existing device in one of your OneSignal apps + * @param appId Your app_id for this device (required) + * @param playerId Player's OneSignal ID (required) + * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @return ApiResponse<Player> + * @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 -
+ */ + public ApiResponse getPlayerWithHttpInfo(String appId, String playerId, String emailAuthHash) throws ApiException { + okhttp3.Call localVarCall = getPlayerValidateBeforeCall(appId, playerId, emailAuthHash, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View device (asynchronously) + * View the details of an existing device in one of your OneSignal apps + * @param appId Your app_id for this device (required) + * @param playerId Player's OneSignal ID (required) + * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11). (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 -
+ */ + public okhttp3.Call getPlayerAsync(String appId, String playerId, String emailAuthHash, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPlayerValidateBeforeCall(appId, playerId, emailAuthHash, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPlayers + * @param appId The app ID that you want to view players from (required) + * @param limit How many devices to return. Max is 300. Default is 300 (optional) + * @param offset Result offset. Default is 0. Results are sorted by id; (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 -
+ */ + public okhttp3.Call getPlayersCall(String appId, String limit, Integer offset, 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 = "/players"; + + 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, name=onesignal-java, version=1.0.2"); + + 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)); + } + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPlayersValidateBeforeCall(String appId, String limit, Integer offset, 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 getPlayers(Async)"); + } + + + okhttp3.Call localVarCall = getPlayersCall(appId, limit, offset, _callback); + return localVarCall; + + } + + /** + * View devices + * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + * @param appId The app ID that you want to view players from (required) + * @param limit How many devices to return. Max is 300. Default is 300 (optional) + * @param offset Result offset. Default is 0. Results are sorted by id; (optional) + * @return PlayerSlice + * @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 -
+ */ + public PlayerSlice getPlayers(String appId, String limit, Integer offset) throws ApiException { + ApiResponse localVarResp = getPlayersWithHttpInfo(appId, limit, offset); + return localVarResp.getData(); + } + + /** + * View devices + * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + * @param appId The app ID that you want to view players from (required) + * @param limit How many devices to return. Max is 300. Default is 300 (optional) + * @param offset Result offset. Default is 0. Results are sorted by id; (optional) + * @return ApiResponse<PlayerSlice> + * @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 -
+ */ + public ApiResponse getPlayersWithHttpInfo(String appId, String limit, Integer offset) throws ApiException { + okhttp3.Call localVarCall = getPlayersValidateBeforeCall(appId, limit, offset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View devices (asynchronously) + * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + * @param appId The app ID that you want to view players from (required) + * @param limit How many devices to return. Max is 300. Default is 300 (optional) + * @param offset Result offset. Default is 0. Results are sorted by id; (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 -
+ */ + public okhttp3.Call getPlayersAsync(String appId, String limit, Integer offset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPlayersValidateBeforeCall(appId, limit, offset, _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) + * @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 -
+ */ + public okhttp3.Call updateAppCall(String appId, App app, 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 = app; + + // 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, name=onesignal-java, version=1.0.2"); + + 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[] { "user_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + 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 updateApp(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 = updateAppCall(appId, app, _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 + * @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 -
+ */ + public App updateApp(String appId, App app) throws ApiException { + ApiResponse localVarResp = updateAppWithHttpInfo(appId, app); + 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> + * @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 -
+ */ + 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); + } + + /** + * 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 + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call updateAppAsync(String appId, App app, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, app, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePlayer + * @param playerId Player's OneSignal ID (required) + * @param player (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 -
+ */ + public okhttp3.Call updatePlayerCall(String playerId, Player player, 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 = player; + + // create path and map variables + String localVarPath = "/players/{player_id}" + .replaceAll("\\{" + "player_id" + "\\}", localVarApiClient.escapeString(playerId.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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePlayerValidateBeforeCall(String playerId, Player player, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'playerId' is set + if (playerId == null) { + throw new ApiException("Missing the required parameter 'playerId' when calling updatePlayer(Async)"); + } + + // verify the required parameter 'player' is set + if (player == null) { + throw new ApiException("Missing the required parameter 'player' when calling updatePlayer(Async)"); + } + + + okhttp3.Call localVarCall = updatePlayerCall(playerId, player, _callback); + return localVarCall; + + } + + /** + * Edit device + * Update an existing device in one of your OneSignal apps + * @param playerId Player's OneSignal ID (required) + * @param player (required) + * @return InlineResponse2001 + * @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 -
+ */ + public InlineResponse2001 updatePlayer(String playerId, Player player) throws ApiException { + ApiResponse localVarResp = updatePlayerWithHttpInfo(playerId, player); + return localVarResp.getData(); + } + + /** + * Edit device + * Update an existing device in one of your OneSignal apps + * @param playerId Player's OneSignal ID (required) + * @param player (required) + * @return ApiResponse<InlineResponse2001> + * @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 -
+ */ + public ApiResponse updatePlayerWithHttpInfo(String playerId, Player player) throws ApiException { + okhttp3.Call localVarCall = updatePlayerValidateBeforeCall(playerId, player, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Edit device (asynchronously) + * Update an existing device in one of your OneSignal apps + * @param playerId Player's OneSignal ID (required) + * @param player (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 -
+ */ + public okhttp3.Call updatePlayerAsync(String playerId, Player player, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePlayerValidateBeforeCall(playerId, player, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePlayerTags + * @param appId The OneSignal App ID the user record is found under. (required) + * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) + * @param updatePlayerTagsRequestBody (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 -
+ */ + public okhttp3.Call updatePlayerTagsCall(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, 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 = updatePlayerTagsRequestBody; + + // create path and map variables + String localVarPath = "/apps/{app_id}/users/{external_user_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "external_user_id" + "\\}", localVarApiClient.escapeString(externalUserId.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, name=onesignal-java, version=1.0.2"); + + 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[] { "app_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePlayerTagsValidateBeforeCall(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, 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 updatePlayerTags(Async)"); + } + + // verify the required parameter 'externalUserId' is set + if (externalUserId == null) { + throw new ApiException("Missing the required parameter 'externalUserId' when calling updatePlayerTags(Async)"); + } + + + okhttp3.Call localVarCall = updatePlayerTagsCall(appId, externalUserId, updatePlayerTagsRequestBody, _callback); + return localVarCall; + + } + + /** + * Edit tags with external user id + * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + * @param appId The OneSignal App ID the user record is found under. (required) + * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) + * @param updatePlayerTagsRequestBody (optional) + * @return InlineResponse2003 + * @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 -
+ */ + public InlineResponse2003 updatePlayerTags(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody) throws ApiException { + ApiResponse localVarResp = updatePlayerTagsWithHttpInfo(appId, externalUserId, updatePlayerTagsRequestBody); + return localVarResp.getData(); + } + + /** + * Edit tags with external user id + * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + * @param appId The OneSignal App ID the user record is found under. (required) + * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) + * @param updatePlayerTagsRequestBody (optional) + * @return ApiResponse<InlineResponse2003> + * @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 -
+ */ + public ApiResponse updatePlayerTagsWithHttpInfo(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody) throws ApiException { + okhttp3.Call localVarCall = updatePlayerTagsValidateBeforeCall(appId, externalUserId, updatePlayerTagsRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Edit tags with external user id (asynchronously) + * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + * @param appId The OneSignal App ID the user record is found under. (required) + * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) + * @param updatePlayerTagsRequestBody (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 -
+ */ + public okhttp3.Call updatePlayerTagsAsync(String appId, String externalUserId, UpdatePlayerTagsRequestBody updatePlayerTagsRequestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePlayerTagsValidateBeforeCall(appId, externalUserId, updatePlayerTagsRequestBody, _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 new file mode 100644 index 0000000..6a53f41 --- /dev/null +++ b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * 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: 1.0.2 + * 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.auth; + +import com.onesignal.client.ApiException; +import com.onesignal.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/com/onesignal/client/auth/Authentication.java b/src/main/java/com/onesignal/client/auth/Authentication.java new file mode 100644 index 0000000..b48dbf5 --- /dev/null +++ b/src/main/java/com/onesignal/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * 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: 1.0.2 + * 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.auth; + +import com.onesignal.client.Pair; +import com.onesignal.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..56e8647 --- /dev/null +++ b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * 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: 1.0.2 + * 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.auth; + +import com.onesignal.client.Pair; +import com.onesignal.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000..7d63c35 --- /dev/null +++ b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * 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: 1.0.2 + * 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.auth; + +import com.onesignal.client.ApiException; +import com.onesignal.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..0debb65 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * 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: 1.0.2 + * 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 com.onesignal.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/onesignal/client/model/App.java b/src/main/java/com/onesignal/client/model/App.java new file mode 100644 index 0000000..08b933e --- /dev/null +++ b/src/main/java/com/onesignal/client/model/App.java @@ -0,0 +1,1019 @@ +/* + * 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: 1.0.2 + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * App + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class App { + 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_PLAYERS = "players"; + @SerializedName(SERIALIZED_NAME_PLAYERS) + private Integer players; + + public static final String SERIALIZED_NAME_MESSAGEABLE_PLAYERS = "messageable_players"; + @SerializedName(SERIALIZED_NAME_MESSAGEABLE_PLAYERS) + private Integer messageablePlayers; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ANDROID_GCM_SENDER_ID = "android_gcm_sender_id"; + @SerializedName(SERIALIZED_NAME_ANDROID_GCM_SENDER_ID) + private String androidGcmSenderId; + + public static final String SERIALIZED_NAME_GCM_KEY = "gcm_key"; + @SerializedName(SERIALIZED_NAME_GCM_KEY) + private String gcmKey; + + public static final String SERIALIZED_NAME_CHROME_WEB_ORIGIN = "chrome_web_origin"; + @SerializedName(SERIALIZED_NAME_CHROME_WEB_ORIGIN) + private String chromeWebOrigin; + + public static final String SERIALIZED_NAME_CHROME_KEY = "chrome_key"; + @SerializedName(SERIALIZED_NAME_CHROME_KEY) + private String chromeKey; + + public static final String SERIALIZED_NAME_CHROME_WEB_DEFAULT_NOTIFICATION_ICON = "chrome_web_default_notification_icon"; + @SerializedName(SERIALIZED_NAME_CHROME_WEB_DEFAULT_NOTIFICATION_ICON) + private String chromeWebDefaultNotificationIcon; + + public static final String SERIALIZED_NAME_CHROME_WEB_SUB_DOMAIN = "chrome_web_sub_domain"; + @SerializedName(SERIALIZED_NAME_CHROME_WEB_SUB_DOMAIN) + private String chromeWebSubDomain; + + /** + * iOS: Either sandbox or production + */ + @JsonAdapter(ApnsEnvEnum.Adapter.class) + public enum ApnsEnvEnum { + SANDBOX("sandbox"), + + PRODUCTION("production"); + + private String value; + + ApnsEnvEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ApnsEnvEnum fromValue(String value) { + for (ApnsEnvEnum b : ApnsEnvEnum.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 ApnsEnvEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ApnsEnvEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ApnsEnvEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_APNS_ENV = "apns_env"; + @SerializedName(SERIALIZED_NAME_APNS_ENV) + private ApnsEnvEnum apnsEnv; + + public static final String SERIALIZED_NAME_APNS_P12 = "apns_p12"; + @SerializedName(SERIALIZED_NAME_APNS_P12) + private String apnsP12; + + public static final String SERIALIZED_NAME_APNS_P12_PASSWORD = "apns_p12_password"; + @SerializedName(SERIALIZED_NAME_APNS_P12_PASSWORD) + private String apnsP12Password; + + public static final String SERIALIZED_NAME_APNS_CERTIFICATES = "apns_certificates"; + @SerializedName(SERIALIZED_NAME_APNS_CERTIFICATES) + private String apnsCertificates; + + public static final String SERIALIZED_NAME_SAFARI_APNS_CERTIFICATES = "safari_apns_certificates"; + @SerializedName(SERIALIZED_NAME_SAFARI_APNS_CERTIFICATES) + private String safariApnsCertificates; + + public static final String SERIALIZED_NAME_SAFARI_APNS_P12 = "safari_apns_p12"; + @SerializedName(SERIALIZED_NAME_SAFARI_APNS_P12) + private String safariApnsP12; + + public static final String SERIALIZED_NAME_SAFARI_APNS_P12_PASSWORD = "safari_apns_p12_password"; + @SerializedName(SERIALIZED_NAME_SAFARI_APNS_P12_PASSWORD) + private String safariApnsP12Password; + + public static final String SERIALIZED_NAME_SAFARI_SITE_ORIGIN = "safari_site_origin"; + @SerializedName(SERIALIZED_NAME_SAFARI_SITE_ORIGIN) + private String safariSiteOrigin; + + public static final String SERIALIZED_NAME_SAFARI_PUSH_ID = "safari_push_id"; + @SerializedName(SERIALIZED_NAME_SAFARI_PUSH_ID) + private String safariPushId; + + public static final String SERIALIZED_NAME_SAFARI_ICON1616 = "safari_icon_16_16"; + @SerializedName(SERIALIZED_NAME_SAFARI_ICON1616) + private String safariIcon1616; + + public static final String SERIALIZED_NAME_SAFARI_ICON3232 = "safari_icon_32_32"; + @SerializedName(SERIALIZED_NAME_SAFARI_ICON3232) + private String safariIcon3232; + + public static final String SERIALIZED_NAME_SAFARI_ICON6464 = "safari_icon_64_64"; + @SerializedName(SERIALIZED_NAME_SAFARI_ICON6464) + private String safariIcon6464; + + public static final String SERIALIZED_NAME_SAFARI_ICON128128 = "safari_icon_128_128"; + @SerializedName(SERIALIZED_NAME_SAFARI_ICON128128) + private String safariIcon128128; + + public static final String SERIALIZED_NAME_SAFARI_ICON256256 = "safari_icon_256_256"; + @SerializedName(SERIALIZED_NAME_SAFARI_ICON256256) + private String safariIcon256256; + + public static final String SERIALIZED_NAME_SITE_NAME = "site_name"; + @SerializedName(SERIALIZED_NAME_SITE_NAME) + private String siteName; + + public static final String SERIALIZED_NAME_BASIC_AUTH_KEY = "basic_auth_key"; + @SerializedName(SERIALIZED_NAME_BASIC_AUTH_KEY) + private String basicAuthKey; + + public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organization_id"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) + private String organizationId; + + public static final String SERIALIZED_NAME_ADDITIONAL_DATA_IS_ROOT_PAYLOAD = "additional_data_is_root_payload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA_IS_ROOT_PAYLOAD) + private Boolean additionalDataIsRootPayload; + + public App() { + } + + + public App( + String id, + Integer players, + Integer messageablePlayers, + OffsetDateTime updatedAt, + OffsetDateTime createdAt, + String apnsCertificates, + String safariApnsCertificates, + String safariPushId, + String safariIcon1616, + String safariIcon3232, + String safariIcon6464, + String safariIcon128128, + String basicAuthKey + ) { + this(); + this.id = id; + this.players = players; + this.messageablePlayers = messageablePlayers; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.apnsCertificates = apnsCertificates; + this.safariApnsCertificates = safariApnsCertificates; + this.safariPushId = safariPushId; + this.safariIcon1616 = safariIcon1616; + this.safariIcon3232 = safariIcon3232; + this.safariIcon6464 = safariIcon6464; + this.safariIcon128128 = safariIcon128128; + this.basicAuthKey = basicAuthKey; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getId() { + return id; + } + + + + + public App name(String name) { + + this.name = name; + return this; + } + + /** + * The name of your app, as displayed on your apps list on the dashboard. This can be renamed. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of your app, as displayed on your apps list on the dashboard. This can be renamed.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Get players + * @return players + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getPlayers() { + return players; + } + + + + + /** + * Get messageablePlayers + * @return messageablePlayers + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getMessageablePlayers() { + return messageablePlayers; + } + + + + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + + public App androidGcmSenderId(String androidGcmSenderId) { + + this.androidGcmSenderId = androidGcmSenderId; + return this; + } + + /** + * Android: Your Google Project number. Also known as Sender ID. + * @return androidGcmSenderId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Android: Your Google Project number. Also known as Sender ID.") + + public String getAndroidGcmSenderId() { + return androidGcmSenderId; + } + + + public void setAndroidGcmSenderId(String androidGcmSenderId) { + this.androidGcmSenderId = androidGcmSenderId; + } + + + public App gcmKey(String gcmKey) { + + this.gcmKey = gcmKey; + return this; + } + + /** + * Android: Your Google Push Messaging Auth Key + * @return gcmKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Android: Your Google Push Messaging Auth Key") + + public String getGcmKey() { + return gcmKey; + } + + + public void setGcmKey(String gcmKey) { + this.gcmKey = gcmKey; + } + + + public App chromeWebOrigin(String chromeWebOrigin) { + + this.chromeWebOrigin = chromeWebOrigin; + return this; + } + + /** + * 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. + * @return chromeWebOrigin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "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.") + + public String getChromeWebOrigin() { + return chromeWebOrigin; + } + + + public void setChromeWebOrigin(String chromeWebOrigin) { + this.chromeWebOrigin = chromeWebOrigin; + } + + + public App chromeKey(String chromeKey) { + + this.chromeKey = chromeKey; + return this; + } + + /** + * Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions. + * @return chromeKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions.") + + public String getChromeKey() { + return chromeKey; + } + + + public void setChromeKey(String chromeKey) { + this.chromeKey = chromeKey; + } + + + public App chromeWebDefaultNotificationIcon(String chromeWebDefaultNotificationIcon) { + + this.chromeWebDefaultNotificationIcon = chromeWebDefaultNotificationIcon; + return this; + } + + /** + * Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80. + * @return chromeWebDefaultNotificationIcon + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80.") + + public String getChromeWebDefaultNotificationIcon() { + return chromeWebDefaultNotificationIcon; + } + + + public void setChromeWebDefaultNotificationIcon(String chromeWebDefaultNotificationIcon) { + this.chromeWebDefaultNotificationIcon = chromeWebDefaultNotificationIcon; + } + + + public App chromeWebSubDomain(String chromeWebSubDomain) { + + this.chromeWebSubDomain = chromeWebSubDomain; + return this; + } + + /** + * Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed. + * @return chromeWebSubDomain + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed.") + + public String getChromeWebSubDomain() { + return chromeWebSubDomain; + } + + + public void setChromeWebSubDomain(String chromeWebSubDomain) { + this.chromeWebSubDomain = chromeWebSubDomain; + } + + + public App apnsEnv(ApnsEnvEnum apnsEnv) { + + this.apnsEnv = apnsEnv; + return this; + } + + /** + * iOS: Either sandbox or production + * @return apnsEnv + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "iOS: Either sandbox or production") + + public ApnsEnvEnum getApnsEnv() { + return apnsEnv; + } + + + public void setApnsEnv(ApnsEnvEnum apnsEnv) { + this.apnsEnv = apnsEnv; + } + + + public App apnsP12(String apnsP12) { + + this.apnsP12 = apnsP12; + return this; + } + + /** + * iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded. + * @return apnsP12 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded.") + + public String getApnsP12() { + return apnsP12; + } + + + public void setApnsP12(String apnsP12) { + this.apnsP12 = apnsP12; + } + + + public App apnsP12Password(String apnsP12Password) { + + this.apnsP12Password = apnsP12Password; + return this; + } + + /** + * iOS: Required if using p12 certificate. Password for the apns_p12 file. + * @return apnsP12Password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "iOS: Required if using p12 certificate. Password for the apns_p12 file.") + + public String getApnsP12Password() { + return apnsP12Password; + } + + + public void setApnsP12Password(String apnsP12Password) { + this.apnsP12Password = apnsP12Password; + } + + + /** + * Get apnsCertificates + * @return apnsCertificates + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getApnsCertificates() { + return apnsCertificates; + } + + + + + /** + * Get safariApnsCertificates + * @return safariApnsCertificates + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariApnsCertificates() { + return safariApnsCertificates; + } + + + + + public App safariApnsP12(String safariApnsP12) { + + this.safariApnsP12 = safariApnsP12; + return this; + } + + /** + * Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. + * @return safariApnsP12 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded.") + + public String getSafariApnsP12() { + return safariApnsP12; + } + + + public void setSafariApnsP12(String safariApnsP12) { + this.safariApnsP12 = safariApnsP12; + } + + + public App safariApnsP12Password(String safariApnsP12Password) { + + this.safariApnsP12Password = safariApnsP12Password; + return this; + } + + /** + * Safari: Password for safari_apns_p12 file + * @return safariApnsP12Password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Safari: Password for safari_apns_p12 file") + + public String getSafariApnsP12Password() { + return safariApnsP12Password; + } + + + public void setSafariApnsP12Password(String safariApnsP12Password) { + this.safariApnsP12Password = safariApnsP12Password; + } + + + public App safariSiteOrigin(String safariSiteOrigin) { + + this.safariSiteOrigin = safariSiteOrigin; + return this; + } + + /** + * Safari (Recommended): The hostname to your website including http(s):// + * @return safariSiteOrigin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Safari (Recommended): The hostname to your website including http(s)://") + + public String getSafariSiteOrigin() { + return safariSiteOrigin; + } + + + public void setSafariSiteOrigin(String safariSiteOrigin) { + this.safariSiteOrigin = safariSiteOrigin; + } + + + /** + * Get safariPushId + * @return safariPushId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariPushId() { + return safariPushId; + } + + + + + /** + * Get safariIcon1616 + * @return safariIcon1616 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariIcon1616() { + return safariIcon1616; + } + + + + + /** + * Get safariIcon3232 + * @return safariIcon3232 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariIcon3232() { + return safariIcon3232; + } + + + + + /** + * Get safariIcon6464 + * @return safariIcon6464 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariIcon6464() { + return safariIcon6464; + } + + + + + /** + * Get safariIcon128128 + * @return safariIcon128128 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSafariIcon128128() { + return safariIcon128128; + } + + + + + public App safariIcon256256(String safariIcon256256) { + + this.safariIcon256256 = safariIcon256256; + return this; + } + + /** + * Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide. + * @return safariIcon256256 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide.") + + public String getSafariIcon256256() { + return safariIcon256256; + } + + + public void setSafariIcon256256(String safariIcon256256) { + this.safariIcon256256 = safariIcon256256; + } + + + public App siteName(String siteName) { + + this.siteName = siteName; + return this; + } + + /** + * All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. + * @return siteName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it.") + + public String getSiteName() { + return siteName; + } + + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + + /** + * Get basicAuthKey + * @return basicAuthKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBasicAuthKey() { + return basicAuthKey; + } + + + + + public App organizationId(String organizationId) { + + this.organizationId = organizationId; + return this; + } + + /** + * The Id of the Organization you would like to add this app to. + * @return organizationId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Id of the Organization you would like to add this app to.") + + public String getOrganizationId() { + return organizationId; + } + + + public void setOrganizationId(String organizationId) { + this.organizationId = organizationId; + } + + + public App additionalDataIsRootPayload(Boolean additionalDataIsRootPayload) { + + this.additionalDataIsRootPayload = additionalDataIsRootPayload; + return this; + } + + /** + * iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload. + * @return additionalDataIsRootPayload + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload.") + + public Boolean getAdditionalDataIsRootPayload() { + return additionalDataIsRootPayload; + } + + + public void setAdditionalDataIsRootPayload(Boolean additionalDataIsRootPayload) { + this.additionalDataIsRootPayload = additionalDataIsRootPayload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + App app = (App) o; + return Objects.equals(this.id, app.id) && + Objects.equals(this.name, app.name) && + Objects.equals(this.players, app.players) && + Objects.equals(this.messageablePlayers, app.messageablePlayers) && + Objects.equals(this.updatedAt, app.updatedAt) && + Objects.equals(this.createdAt, app.createdAt) && + Objects.equals(this.androidGcmSenderId, app.androidGcmSenderId) && + Objects.equals(this.gcmKey, app.gcmKey) && + Objects.equals(this.chromeWebOrigin, app.chromeWebOrigin) && + Objects.equals(this.chromeKey, app.chromeKey) && + Objects.equals(this.chromeWebDefaultNotificationIcon, app.chromeWebDefaultNotificationIcon) && + Objects.equals(this.chromeWebSubDomain, app.chromeWebSubDomain) && + Objects.equals(this.apnsEnv, app.apnsEnv) && + Objects.equals(this.apnsP12, app.apnsP12) && + Objects.equals(this.apnsP12Password, app.apnsP12Password) && + Objects.equals(this.apnsCertificates, app.apnsCertificates) && + Objects.equals(this.safariApnsCertificates, app.safariApnsCertificates) && + Objects.equals(this.safariApnsP12, app.safariApnsP12) && + Objects.equals(this.safariApnsP12Password, app.safariApnsP12Password) && + Objects.equals(this.safariSiteOrigin, app.safariSiteOrigin) && + Objects.equals(this.safariPushId, app.safariPushId) && + Objects.equals(this.safariIcon1616, app.safariIcon1616) && + Objects.equals(this.safariIcon3232, app.safariIcon3232) && + Objects.equals(this.safariIcon6464, app.safariIcon6464) && + Objects.equals(this.safariIcon128128, app.safariIcon128128) && + Objects.equals(this.safariIcon256256, app.safariIcon256256) && + Objects.equals(this.siteName, app.siteName) && + Objects.equals(this.basicAuthKey, app.basicAuthKey) && + Objects.equals(this.organizationId, app.organizationId) && + Objects.equals(this.additionalDataIsRootPayload, app.additionalDataIsRootPayload); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, players, messageablePlayers, updatedAt, createdAt, androidGcmSenderId, gcmKey, chromeWebOrigin, chromeKey, chromeWebDefaultNotificationIcon, chromeWebSubDomain, apnsEnv, apnsP12, apnsP12Password, apnsCertificates, safariApnsCertificates, safariApnsP12, safariApnsP12Password, safariSiteOrigin, safariPushId, safariIcon1616, safariIcon3232, safariIcon6464, safariIcon128128, safariIcon256256, siteName, basicAuthKey, organizationId, additionalDataIsRootPayload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class App {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" players: ").append(toIndentedString(players)).append("\n"); + sb.append(" messageablePlayers: ").append(toIndentedString(messageablePlayers)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" androidGcmSenderId: ").append(toIndentedString(androidGcmSenderId)).append("\n"); + sb.append(" gcmKey: ").append(toIndentedString(gcmKey)).append("\n"); + sb.append(" chromeWebOrigin: ").append(toIndentedString(chromeWebOrigin)).append("\n"); + sb.append(" chromeKey: ").append(toIndentedString(chromeKey)).append("\n"); + sb.append(" chromeWebDefaultNotificationIcon: ").append(toIndentedString(chromeWebDefaultNotificationIcon)).append("\n"); + sb.append(" chromeWebSubDomain: ").append(toIndentedString(chromeWebSubDomain)).append("\n"); + sb.append(" apnsEnv: ").append(toIndentedString(apnsEnv)).append("\n"); + sb.append(" apnsP12: ").append(toIndentedString(apnsP12)).append("\n"); + sb.append(" apnsP12Password: ").append(toIndentedString(apnsP12Password)).append("\n"); + sb.append(" apnsCertificates: ").append(toIndentedString(apnsCertificates)).append("\n"); + sb.append(" safariApnsCertificates: ").append(toIndentedString(safariApnsCertificates)).append("\n"); + sb.append(" safariApnsP12: ").append(toIndentedString(safariApnsP12)).append("\n"); + sb.append(" safariApnsP12Password: ").append(toIndentedString(safariApnsP12Password)).append("\n"); + sb.append(" safariSiteOrigin: ").append(toIndentedString(safariSiteOrigin)).append("\n"); + sb.append(" safariPushId: ").append(toIndentedString(safariPushId)).append("\n"); + sb.append(" safariIcon1616: ").append(toIndentedString(safariIcon1616)).append("\n"); + sb.append(" safariIcon3232: ").append(toIndentedString(safariIcon3232)).append("\n"); + sb.append(" safariIcon6464: ").append(toIndentedString(safariIcon6464)).append("\n"); + sb.append(" safariIcon128128: ").append(toIndentedString(safariIcon128128)).append("\n"); + sb.append(" safariIcon256256: ").append(toIndentedString(safariIcon256256)).append("\n"); + sb.append(" siteName: ").append(toIndentedString(siteName)).append("\n"); + sb.append(" basicAuthKey: ").append(toIndentedString(basicAuthKey)).append("\n"); + sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); + sb.append(" additionalDataIsRootPayload: ").append(toIndentedString(additionalDataIsRootPayload)).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("players"); + openapiFields.add("messageable_players"); + openapiFields.add("updated_at"); + openapiFields.add("created_at"); + openapiFields.add("android_gcm_sender_id"); + openapiFields.add("gcm_key"); + openapiFields.add("chrome_web_origin"); + openapiFields.add("chrome_key"); + openapiFields.add("chrome_web_default_notification_icon"); + openapiFields.add("chrome_web_sub_domain"); + openapiFields.add("apns_env"); + openapiFields.add("apns_p12"); + openapiFields.add("apns_p12_password"); + openapiFields.add("apns_certificates"); + openapiFields.add("safari_apns_certificates"); + openapiFields.add("safari_apns_p12"); + openapiFields.add("safari_apns_p12_password"); + openapiFields.add("safari_site_origin"); + openapiFields.add("safari_push_id"); + openapiFields.add("safari_icon_16_16"); + openapiFields.add("safari_icon_32_32"); + openapiFields.add("safari_icon_64_64"); + openapiFields.add("safari_icon_128_128"); + openapiFields.add("safari_icon_256_256"); + openapiFields.add("site_name"); + openapiFields.add("basic_auth_key"); + openapiFields.add("organization_id"); + openapiFields.add("additional_data_is_root_payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!App.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'App' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(App.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, App value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public App read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of App given an JSON string + * + * @param jsonString JSON string + * @return An instance of App + * @throws IOException if the JSON string is invalid with respect to App + */ + public static App fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, App.class); + } + + /** + * Convert an instance of App 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/Button.java b/src/main/java/com/onesignal/client/model/Button.java new file mode 100644 index 0000000..d9144e8 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/Button.java @@ -0,0 +1,246 @@ +/* + * 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: 1.0.2 + * 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; + +/** + * Button + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-26T05:37:43.612Z[Etc/UTC]") +public class Button { + 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_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + private String icon; + + public Button() { + } + + public Button id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Button text(String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public Button icon(String icon) { + + this.icon = icon; + return this; + } + + /** + * Get icon + * @return icon + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getIcon() { + return icon; + } + + + public void setIcon(String icon) { + this.icon = icon; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Button button = (Button) o; + return Objects.equals(this.id, button.id) && + Objects.equals(this.text, button.text) && + Objects.equals(this.icon, button.icon); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, icon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Button {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).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("text"); + openapiFields.add("icon"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Button.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Button' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter