From bcf1b332e8a7528179b9a5aab638c4be456919be Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 13 May 2025 23:46:57 +0000 Subject: [PATCH] feat: add v5.0.0-beta1 package updates --- .github/ISSUE_TEMPLATE/ask-question.yml | 6 +- .github/ISSUE_TEMPLATE/bug-report.yml | 4 +- .github/ISSUE_TEMPLATE/general-feedback.yml | 6 +- .github/workflows/project.yml | 17 + README.md | 91 +- composer.json | 2 +- docs/Api/DefaultApi.md | 908 +-- docs/Model/BasicNotification.md | 30 +- docs/Model/BasicNotificationAllOf.md | 13 +- .../CreateNotificationSuccessResponse.md | 3 +- docs/Model/CreateSubscriptionRequestBody.md | 10 - docs/Model/DeletePlayerNotFoundResponse.md | 9 - docs/Model/DeleteSegmentSuccessResponse.md | 9 - ...y.md => ExportSubscriptionsRequestBody.md} | 2 +- ... => ExportSubscriptionsSuccessResponse.md} | 2 +- docs/Model/Filter.md | 8 +- docs/Model/FilterExpression.md | 17 + docs/Model/FilterExpressions.md | 13 - docs/Model/GenericError.md | 4 +- ...ponse.md => GenericSuccessBoolResponse.md} | 2 +- ...d => GetNotificationHistoryRequestBody.md} | 2 +- docs/Model/GetSegmentsSuccessResponse.md | 12 + docs/Model/InlineResponse200.md | 9 - docs/Model/InlineResponse2003.md | 9 - docs/Model/InlineResponse201.md | 9 - docs/Model/InvalidIdentifierError.md | 10 - .../{StringMap.md => LanguageStringMap.md} | 2 +- docs/Model/Notification.md | 30 +- docs/Model/Notification200Errors.md | 10 - docs/Model/NotificationTarget.md | 17 +- docs/Model/NotificationWithMeta.md | 30 +- docs/Model/Player.md | 35 - docs/Model/PlayerNotificationTarget.md | 20 - .../PlayerNotificationTargetIncludeAliases.md | 9 - docs/Model/PlayerSlice.md | 12 - ...InlineResponse202.md => PropertiesBody.md} | 2 +- docs/Model/PropertiesDeltas.md | 4 +- docs/Model/PropertiesObject.md | 4 +- docs/Model/Purchase.md | 2 +- ...veActivityRequest.md => RateLimitError.md} | 6 +- docs/Model/Segment.md | 2 +- docs/Model/SegmentData.md | 15 + ...{SubscriptionObject.md => Subscription.md} | 12 +- ...SuccessResponse.md => SubscriptionBody.md} | 4 +- docs/Model/SubscriptionNotificationTarget.md | 19 + docs/Model/TransferSubscriptionRequestBody.md | 2 +- docs/Model/UpdateLiveActivityRequest.md | 11 +- .../UpdateLiveActivitySuccessResponse.md | 3 +- docs/Model/UpdatePlayerSuccessResponse.md | 9 - docs/Model/UpdatePlayerTagsRequestBody.md | 9 - docs/Model/UpdatePlayerTagsSuccessResponse.md | 9 - docs/Model/UpdateSubscriptionRequestBody.md | 9 - docs/Model/User.md | 5 +- ...otFoundResponse.md => UserIdentityBody.md} | 4 +- docs/Model/UserIdentityRequestBody.md | 9 - docs/Model/UserIdentityResponse.md | 9 - docs/Model/UserSubscriptionOptions.md | 9 - ...ePlayerSuccessResponse.md => WebButton.md} | 8 +- lib/ApiException.php | 2 +- lib/Configuration.php | 40 +- lib/HeaderSelector.php | 2 +- lib/ObjectSerializer.php | 2 +- lib/api/DefaultApi.php | 6455 ++++++----------- lib/model/App.php | 2 +- lib/model/BasicNotification.php | 200 +- lib/model/BasicNotificationAllOf.php | 122 +- ...tificationAllOfAndroidBackgroundLayout.php | 2 +- lib/model/BeginLiveActivityRequest.php | 359 - lib/model/Button.php | 2 +- .../CancelNotificationSuccessResponse.php | 323 - .../CreateNotificationSuccessResponse.php | 38 +- lib/model/CreateSegmentConflictResponse.php | 2 +- lib/model/CreateSegmentSuccessResponse.php | 2 +- lib/model/CreateSubscriptionRequestBody.php | 353 - lib/model/CreateUserConflictResponse.php | 2 +- .../CreateUserConflictResponseErrorsInner.php | 2 +- ...ateUserConflictResponseErrorsItemsMeta.php | 2 +- lib/model/DeletePlayerNotFoundResponse.php | 323 - lib/model/DeleteSegmentNotFoundResponse.php | 323 - lib/model/DeleteSegmentSuccessResponse.php | 323 - lib/model/DeliveryData.php | 2 +- lib/model/ExportEventsSuccessResponse.php | 2 +- ...php => ExportSubscriptionsRequestBody.php} | 10 +- ...=> ExportSubscriptionsSuccessResponse.php} | 10 +- lib/model/Filter.php | 138 +- ...erExpressions.php => FilterExpression.php} | 146 +- lib/model/GenericError.php | 76 +- lib/model/GenericErrorErrorsInner.php | 353 - ...nse.php => GenericSuccessBoolResponse.php} | 10 +- ... => GetNotificationHistoryRequestBody.php} | 10 +- ...ice.php => GetSegmentsSuccessResponse.php} | 44 +- lib/model/InlineResponse2003.php | 323 - lib/model/InvalidIdentifierError.php | 353 - .../{StringMap.php => LanguageStringMap.php} | 10 +- lib/model/ModelInterface.php | 2 +- lib/model/Notification.php | 200 +- lib/model/Notification200Errors.php | 353 - lib/model/NotificationAllOf.php | 2 +- .../NotificationHistorySuccessResponse.php | 2 +- lib/model/NotificationSlice.php | 2 +- lib/model/NotificationTarget.php | 80 +- lib/model/NotificationWithMeta.php | 200 +- lib/model/NotificationWithMetaAllOf.php | 2 +- lib/model/Operator.php | 2 +- lib/model/OutcomeData.php | 2 +- lib/model/OutcomesData.php | 2 +- lib/model/PlatformDeliveryData.php | 2 +- lib/model/PlatformDeliveryDataEmailAllOf.php | 2 +- lib/model/PlatformDeliveryDataSmsAllOf.php | 2 +- lib/model/Player.php | 1106 --- ...PlayerNotificationTargetIncludeAliases.php | 323 - ...lineResponse202.php => PropertiesBody.php} | 10 +- lib/model/PropertiesDeltas.php | 14 +- lib/model/PropertiesObject.php | 14 +- lib/model/Purchase.php | 8 +- ...ateLimiterError.php => RateLimitError.php} | 54 +- lib/model/Segment.php | 8 +- lib/model/SegmentData.php | 503 ++ lib/model/SegmentNotificationTarget.php | 2 +- ...ubscriptionObject.php => Subscription.php} | 40 +- ...neResponse201.php => SubscriptionBody.php} | 16 +- ...php => SubscriptionNotificationTarget.php} | 88 +- lib/model/TransferSubscriptionRequestBody.php | 23 +- lib/model/UpdateLiveActivityRequest.php | 222 +- .../UpdateLiveActivitySuccessResponse.php | 58 +- lib/model/UpdatePlayerSuccessResponse.php | 323 - lib/model/UpdatePlayerTagsRequestBody.php | 323 - lib/model/UpdatePlayerTagsSuccessResponse.php | 323 - lib/model/UpdateSubscriptionRequestBody.php | 323 - lib/model/UpdateUserRequest.php | 2 +- lib/model/User.php | 52 +- ...neResponse200.php => UserIdentityBody.php} | 16 +- lib/model/UserIdentityRequestBody.php | 323 - lib/model/UserIdentityResponse.php | 323 - lib/model/UserSubscriptionOptions.php | 323 - ...layerSuccessResponse.php => WebButton.php} | 125 +- 136 files changed, 4375 insertions(+), 13331 deletions(-) create mode 100644 .github/workflows/project.yml delete mode 100644 docs/Model/CreateSubscriptionRequestBody.md delete mode 100644 docs/Model/DeletePlayerNotFoundResponse.md delete mode 100644 docs/Model/DeleteSegmentSuccessResponse.md rename docs/Model/{ExportPlayersRequestBody.md => ExportSubscriptionsRequestBody.md} (95%) rename docs/Model/{ExportPlayersSuccessResponse.md => ExportSubscriptionsSuccessResponse.md} (88%) create mode 100644 docs/Model/FilterExpression.md delete mode 100644 docs/Model/FilterExpressions.md rename docs/Model/{DeletePlayerSuccessResponse.md => GenericSuccessBoolResponse.md} (89%) rename docs/Model/{GetNotificationRequestBody.md => GetNotificationHistoryRequestBody.md} (95%) create mode 100644 docs/Model/GetSegmentsSuccessResponse.md delete mode 100644 docs/Model/InlineResponse200.md delete mode 100644 docs/Model/InlineResponse2003.md delete mode 100644 docs/Model/InlineResponse201.md delete mode 100644 docs/Model/InvalidIdentifierError.md rename docs/Model/{StringMap.md => LanguageStringMap.md} (99%) delete mode 100644 docs/Model/Notification200Errors.md delete mode 100644 docs/Model/Player.md delete mode 100644 docs/Model/PlayerNotificationTarget.md delete mode 100644 docs/Model/PlayerNotificationTargetIncludeAliases.md delete mode 100644 docs/Model/PlayerSlice.md rename docs/Model/{InlineResponse202.md => PropertiesBody.md} (93%) rename docs/Model/{BeginLiveActivityRequest.md => RateLimitError.md} (70%) create mode 100644 docs/Model/SegmentData.md rename docs/Model/{SubscriptionObject.md => Subscription.md} (74%) rename docs/Model/{CancelNotificationSuccessResponse.md => SubscriptionBody.md} (67%) create mode 100644 docs/Model/SubscriptionNotificationTarget.md delete mode 100644 docs/Model/UpdatePlayerSuccessResponse.md delete mode 100644 docs/Model/UpdatePlayerTagsRequestBody.md delete mode 100644 docs/Model/UpdatePlayerTagsSuccessResponse.md delete mode 100644 docs/Model/UpdateSubscriptionRequestBody.md rename docs/Model/{DeleteSegmentNotFoundResponse.md => UserIdentityBody.md} (75%) delete mode 100644 docs/Model/UserIdentityRequestBody.md delete mode 100644 docs/Model/UserIdentityResponse.md delete mode 100644 docs/Model/UserSubscriptionOptions.md rename docs/Model/{CreatePlayerSuccessResponse.md => WebButton.md} (61%) delete mode 100644 lib/model/BeginLiveActivityRequest.php delete mode 100644 lib/model/CancelNotificationSuccessResponse.php delete mode 100644 lib/model/CreateSubscriptionRequestBody.php delete mode 100644 lib/model/DeletePlayerNotFoundResponse.php delete mode 100644 lib/model/DeleteSegmentNotFoundResponse.php delete mode 100644 lib/model/DeleteSegmentSuccessResponse.php rename lib/model/{ExportPlayersRequestBody.php => ExportSubscriptionsRequestBody.php} (96%) rename lib/model/{ExportPlayersSuccessResponse.php => ExportSubscriptionsSuccessResponse.php} (95%) rename lib/model/{FilterExpressions.php => FilterExpression.php} (78%) delete mode 100644 lib/model/GenericErrorErrorsInner.php rename lib/model/{DeletePlayerSuccessResponse.php => GenericSuccessBoolResponse.php} (95%) rename lib/model/{GetNotificationRequestBody.php => GetNotificationHistoryRequestBody.php} (96%) rename lib/model/{PlayerSlice.php => GetSegmentsSuccessResponse.php} (87%) delete mode 100644 lib/model/InlineResponse2003.php delete mode 100644 lib/model/InvalidIdentifierError.php rename lib/model/{StringMap.php => LanguageStringMap.php} (99%) delete mode 100644 lib/model/Notification200Errors.php delete mode 100644 lib/model/Player.php delete mode 100644 lib/model/PlayerNotificationTargetIncludeAliases.php rename lib/model/{InlineResponse202.php => PropertiesBody.php} (96%) rename lib/model/{RateLimiterError.php => RateLimitError.php} (86%) create mode 100644 lib/model/SegmentData.php rename lib/model/{SubscriptionObject.php => Subscription.php} (95%) rename lib/model/{InlineResponse201.php => SubscriptionBody.php} (93%) rename lib/model/{PlayerNotificationTarget.php => SubscriptionNotificationTarget.php} (78%) delete mode 100644 lib/model/UpdatePlayerSuccessResponse.php delete mode 100644 lib/model/UpdatePlayerTagsRequestBody.php delete mode 100644 lib/model/UpdatePlayerTagsSuccessResponse.php delete mode 100644 lib/model/UpdateSubscriptionRequestBody.php rename lib/model/{InlineResponse200.php => UserIdentityBody.php} (94%) delete mode 100644 lib/model/UserIdentityRequestBody.php delete mode 100644 lib/model/UserIdentityResponse.php delete mode 100644 lib/model/UserSubscriptionOptions.php rename lib/model/{CreatePlayerSuccessResponse.php => WebButton.php} (76%) diff --git a/.github/ISSUE_TEMPLATE/ask-question.yml b/.github/ISSUE_TEMPLATE/ask-question.yml index 3da173f..6a3c282 100644 --- a/.github/ISSUE_TEMPLATE/ask-question.yml +++ b/.github/ISSUE_TEMPLATE/ask-question.yml @@ -1,7 +1,7 @@ name: 🙋‍♂️ Ask a question description: Tell us what's on your mind -title: "[question]: " -labels: ["triage"] +title: "[Question]: " +labels: ["Question"] body: - type: markdown attributes: @@ -22,4 +22,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f274813..f99d9f6 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,7 +1,7 @@ name: 🪳 Bug report description: File a bug report title: "[Bug]: " -labels: ["bug", "triage"] +labels: ["Bug"] body: - type: markdown attributes: @@ -48,4 +48,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/general-feedback.yml b/.github/ISSUE_TEMPLATE/general-feedback.yml index e632759..704514e 100644 --- a/.github/ISSUE_TEMPLATE/general-feedback.yml +++ b/.github/ISSUE_TEMPLATE/general-feedback.yml @@ -1,7 +1,7 @@ name: 📣 General feedback description: Tell us what's on your mind -title: "[Bug]: " -labels: ["triage"] +title: "[Feedback]: " +labels: ["Feedback"] body: - type: markdown attributes: @@ -22,4 +22,4 @@ body: description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) options: - label: I agree to follow this project's Code of Conduct - required: true \ No newline at end of file + required: true diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml new file mode 100644 index 0000000..69960fe --- /dev/null +++ b/.github/workflows/project.yml @@ -0,0 +1,17 @@ +name: Add issues to project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + runs-on: ubuntu-latest + steps: + - name: Add issue to project + uses: actions/add-to-project@v1.0.2 + with: + # SDK Server Project + project-url: https://github.com/orgs/OneSignal/projects/11 + github-token: ${{ secrets.GH_PROJECTS_TOKEN }} diff --git a/README.md b/README.md index e040400..eb6d26c 100644 --- a/README.md +++ b/README.md @@ -52,15 +52,15 @@ use GuzzleHttp; ### Constants ```php const APP_ID = ''; -const REST_KEY_TOKEN = ''; // App REST API key required for most endpoints -const ORG_KEY_TOKEN = ''; // Organization key is only required for creating new apps and other top-level endpoints +const APP_KEY_TOKEN = ''; +const USER_KEY_TOKEN = ''; ``` ### Configure authorization ```php $config = Configuration::getDefaultConfiguration() - ->setAppKeyToken(REST_KEY_TOKEN) - ->setUserKeyToken(ORG_KEY_TOKEN); + ->setAppKeyToken(APP_KEY_TOKEN) + ->setUserKeyToken(USER_KEY_TOKEN); $apiInstance = new DefaultApi( new GuzzleHttp\Client(), @@ -416,41 +416,34 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**beginLiveActivity**](docs/Api/DefaultApi.md#beginliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity *DefaultApi* | [**cancelNotification**](docs/Api/DefaultApi.md#cancelnotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +*DefaultApi* | [**createAlias**](docs/Api/DefaultApi.md#createalias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**createAliasBySubscription**](docs/Api/DefaultApi.md#createaliasbysubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | *DefaultApi* | [**createApp**](docs/Api/DefaultApi.md#createapp) | **POST** /apps | Create an app *DefaultApi* | [**createNotification**](docs/Api/DefaultApi.md#createnotification) | **POST** /notifications | Create notification -*DefaultApi* | [**createPlayer**](docs/Api/DefaultApi.md#createplayer) | **POST** /players | Add a device -*DefaultApi* | [**createSegments**](docs/Api/DefaultApi.md#createsegments) | **POST** /apps/{app_id}/segments | Create Segments +*DefaultApi* | [**createSegment**](docs/Api/DefaultApi.md#createsegment) | **POST** /apps/{app_id}/segments | Create Segment *DefaultApi* | [**createSubscription**](docs/Api/DefaultApi.md#createsubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | *DefaultApi* | [**createUser**](docs/Api/DefaultApi.md#createuser) | **POST** /apps/{app_id}/users | *DefaultApi* | [**deleteAlias**](docs/Api/DefaultApi.md#deletealias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | -*DefaultApi* | [**deletePlayer**](docs/Api/DefaultApi.md#deleteplayer) | **DELETE** /players/{player_id} | Delete a user record -*DefaultApi* | [**deleteSegments**](docs/Api/DefaultApi.md#deletesegments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +*DefaultApi* | [**deleteSegment**](docs/Api/DefaultApi.md#deletesegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment *DefaultApi* | [**deleteSubscription**](docs/Api/DefaultApi.md#deletesubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | *DefaultApi* | [**deleteUser**](docs/Api/DefaultApi.md#deleteuser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -*DefaultApi* | [**endLiveActivity**](docs/Api/DefaultApi.md#endliveactivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *DefaultApi* | [**exportEvents**](docs/Api/DefaultApi.md#exportevents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events -*DefaultApi* | [**exportPlayers**](docs/Api/DefaultApi.md#exportplayers) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players -*DefaultApi* | [**fetchAliases**](docs/Api/DefaultApi.md#fetchaliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | -*DefaultApi* | [**fetchUser**](docs/Api/DefaultApi.md#fetchuser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -*DefaultApi* | [**fetchUserIdentity**](docs/Api/DefaultApi.md#fetchuseridentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**exportSubscriptions**](docs/Api/DefaultApi.md#exportsubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions +*DefaultApi* | [**getAliases**](docs/Api/DefaultApi.md#getaliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**getAliasesBySubscription**](docs/Api/DefaultApi.md#getaliasesbysubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | *DefaultApi* | [**getApp**](docs/Api/DefaultApi.md#getapp) | **GET** /apps/{app_id} | View an app *DefaultApi* | [**getApps**](docs/Api/DefaultApi.md#getapps) | **GET** /apps | View apps -*DefaultApi* | [**getEligibleIams**](docs/Api/DefaultApi.md#geteligibleiams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | *DefaultApi* | [**getNotification**](docs/Api/DefaultApi.md#getnotification) | **GET** /notifications/{notification_id} | View notification *DefaultApi* | [**getNotificationHistory**](docs/Api/DefaultApi.md#getnotificationhistory) | **POST** /notifications/{notification_id}/history | Notification History *DefaultApi* | [**getNotifications**](docs/Api/DefaultApi.md#getnotifications) | **GET** /notifications | View notifications *DefaultApi* | [**getOutcomes**](docs/Api/DefaultApi.md#getoutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes -*DefaultApi* | [**getPlayer**](docs/Api/DefaultApi.md#getplayer) | **GET** /players/{player_id} | View device -*DefaultApi* | [**getPlayers**](docs/Api/DefaultApi.md#getplayers) | **GET** /players | View devices -*DefaultApi* | [**identifyUserByAlias**](docs/Api/DefaultApi.md#identifyuserbyalias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | -*DefaultApi* | [**identifyUserBySubscriptionId**](docs/Api/DefaultApi.md#identifyuserbysubscriptionid) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**getSegments**](docs/Api/DefaultApi.md#getsegments) | **GET** /apps/{app_id}/segments | Get Segments +*DefaultApi* | [**getUser**](docs/Api/DefaultApi.md#getuser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *DefaultApi* | [**transferSubscription**](docs/Api/DefaultApi.md#transfersubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | +*DefaultApi* | [**unsubscribeEmailWithToken**](docs/Api/DefaultApi.md#unsubscribeemailwithtoken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token *DefaultApi* | [**updateApp**](docs/Api/DefaultApi.md#updateapp) | **PUT** /apps/{app_id} | Update an app *DefaultApi* | [**updateLiveActivity**](docs/Api/DefaultApi.md#updateliveactivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push -*DefaultApi* | [**updatePlayer**](docs/Api/DefaultApi.md#updateplayer) | **PUT** /players/{player_id} | Edit device -*DefaultApi* | [**updatePlayerTags**](docs/Api/DefaultApi.md#updateplayertags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id *DefaultApi* | [**updateSubscription**](docs/Api/DefaultApi.md#updatesubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | *DefaultApi* | [**updateUser**](docs/Api/DefaultApi.md#updateuser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | @@ -460,37 +453,25 @@ Class | Method | HTTP request | Description - [BasicNotification](docs/Model/BasicNotification.md) - [BasicNotificationAllOf](docs/Model/BasicNotificationAllOf.md) - [BasicNotificationAllOfAndroidBackgroundLayout](docs/Model/BasicNotificationAllOfAndroidBackgroundLayout.md) -- [BeginLiveActivityRequest](docs/Model/BeginLiveActivityRequest.md) - [Button](docs/Model/Button.md) -- [CancelNotificationSuccessResponse](docs/Model/CancelNotificationSuccessResponse.md) - [CreateNotificationSuccessResponse](docs/Model/CreateNotificationSuccessResponse.md) -- [CreatePlayerSuccessResponse](docs/Model/CreatePlayerSuccessResponse.md) - [CreateSegmentConflictResponse](docs/Model/CreateSegmentConflictResponse.md) - [CreateSegmentSuccessResponse](docs/Model/CreateSegmentSuccessResponse.md) -- [CreateSubscriptionRequestBody](docs/Model/CreateSubscriptionRequestBody.md) - [CreateUserConflictResponse](docs/Model/CreateUserConflictResponse.md) - [CreateUserConflictResponseErrorsInner](docs/Model/CreateUserConflictResponseErrorsInner.md) - [CreateUserConflictResponseErrorsItemsMeta](docs/Model/CreateUserConflictResponseErrorsItemsMeta.md) -- [DeletePlayerNotFoundResponse](docs/Model/DeletePlayerNotFoundResponse.md) -- [DeletePlayerSuccessResponse](docs/Model/DeletePlayerSuccessResponse.md) -- [DeleteSegmentNotFoundResponse](docs/Model/DeleteSegmentNotFoundResponse.md) -- [DeleteSegmentSuccessResponse](docs/Model/DeleteSegmentSuccessResponse.md) - [DeliveryData](docs/Model/DeliveryData.md) - [ExportEventsSuccessResponse](docs/Model/ExportEventsSuccessResponse.md) -- [ExportPlayersRequestBody](docs/Model/ExportPlayersRequestBody.md) -- [ExportPlayersSuccessResponse](docs/Model/ExportPlayersSuccessResponse.md) +- [ExportSubscriptionsRequestBody](docs/Model/ExportSubscriptionsRequestBody.md) +- [ExportSubscriptionsSuccessResponse](docs/Model/ExportSubscriptionsSuccessResponse.md) - [Filter](docs/Model/Filter.md) -- [FilterExpressions](docs/Model/FilterExpressions.md) +- [FilterExpression](docs/Model/FilterExpression.md) - [GenericError](docs/Model/GenericError.md) -- [GenericErrorErrorsInner](docs/Model/GenericErrorErrorsInner.md) -- [GetNotificationRequestBody](docs/Model/GetNotificationRequestBody.md) -- [InlineResponse200](docs/Model/InlineResponse200.md) -- [InlineResponse2003](docs/Model/InlineResponse2003.md) -- [InlineResponse201](docs/Model/InlineResponse201.md) -- [InlineResponse202](docs/Model/InlineResponse202.md) -- [InvalidIdentifierError](docs/Model/InvalidIdentifierError.md) +- [GenericSuccessBoolResponse](docs/Model/GenericSuccessBoolResponse.md) +- [GetNotificationHistoryRequestBody](docs/Model/GetNotificationHistoryRequestBody.md) +- [GetSegmentsSuccessResponse](docs/Model/GetSegmentsSuccessResponse.md) +- [LanguageStringMap](docs/Model/LanguageStringMap.md) - [Notification](docs/Model/Notification.md) -- [Notification200Errors](docs/Model/Notification200Errors.md) - [NotificationAllOf](docs/Model/NotificationAllOf.md) - [NotificationHistorySuccessResponse](docs/Model/NotificationHistorySuccessResponse.md) - [NotificationSlice](docs/Model/NotificationSlice.md) @@ -503,30 +484,24 @@ Class | Method | HTTP request | Description - [PlatformDeliveryData](docs/Model/PlatformDeliveryData.md) - [PlatformDeliveryDataEmailAllOf](docs/Model/PlatformDeliveryDataEmailAllOf.md) - [PlatformDeliveryDataSmsAllOf](docs/Model/PlatformDeliveryDataSmsAllOf.md) -- [Player](docs/Model/Player.md) -- [PlayerNotificationTarget](docs/Model/PlayerNotificationTarget.md) -- [PlayerNotificationTargetIncludeAliases](docs/Model/PlayerNotificationTargetIncludeAliases.md) -- [PlayerSlice](docs/Model/PlayerSlice.md) +- [PropertiesBody](docs/Model/PropertiesBody.md) - [PropertiesDeltas](docs/Model/PropertiesDeltas.md) - [PropertiesObject](docs/Model/PropertiesObject.md) - [Purchase](docs/Model/Purchase.md) -- [RateLimiterError](docs/Model/RateLimiterError.md) +- [RateLimitError](docs/Model/RateLimitError.md) - [Segment](docs/Model/Segment.md) +- [SegmentData](docs/Model/SegmentData.md) - [SegmentNotificationTarget](docs/Model/SegmentNotificationTarget.md) -- [StringMap](docs/Model/StringMap.md) -- [SubscriptionObject](docs/Model/SubscriptionObject.md) +- [Subscription](docs/Model/Subscription.md) +- [SubscriptionBody](docs/Model/SubscriptionBody.md) +- [SubscriptionNotificationTarget](docs/Model/SubscriptionNotificationTarget.md) - [TransferSubscriptionRequestBody](docs/Model/TransferSubscriptionRequestBody.md) - [UpdateLiveActivityRequest](docs/Model/UpdateLiveActivityRequest.md) - [UpdateLiveActivitySuccessResponse](docs/Model/UpdateLiveActivitySuccessResponse.md) -- [UpdatePlayerSuccessResponse](docs/Model/UpdatePlayerSuccessResponse.md) -- [UpdatePlayerTagsRequestBody](docs/Model/UpdatePlayerTagsRequestBody.md) -- [UpdatePlayerTagsSuccessResponse](docs/Model/UpdatePlayerTagsSuccessResponse.md) -- [UpdateSubscriptionRequestBody](docs/Model/UpdateSubscriptionRequestBody.md) - [UpdateUserRequest](docs/Model/UpdateUserRequest.md) - [User](docs/Model/User.md) -- [UserIdentityRequestBody](docs/Model/UserIdentityRequestBody.md) -- [UserIdentityResponse](docs/Model/UserIdentityResponse.md) -- [UserSubscriptionOptions](docs/Model/UserSubscriptionOptions.md) +- [UserIdentityBody](docs/Model/UserIdentityBody.md) +- [WebButton](docs/Model/WebButton.md) ## Authorization All the OneSignal endpoints require either an *app_key* or *user_key* tokens for authorization. It is recommended to @@ -536,12 +511,12 @@ requires app_key and which user_key. You can get the value of these keys from yo -### app_key +### rest_api_key - **Type**: Bearer authentication -### user_key +### user_auth_key - **Type**: Bearer authentication @@ -551,5 +526,5 @@ requires app_key and which user_key. You can get the value of these keys from yo devrel@onesignal.com -- API version: `1.4.0` - - Package version: `2.2.0` +- API version: `5.0.1` + - Package version: `5.0.0-beta1` diff --git a/composer.json b/composer.json index 690894a..e1e0bb8 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "onesignal/onesignal-php-api", - "version": "2.2.0", + "version": "5.0.0-beta1", "description": "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com", "keywords": [ "onesignal", diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index 49e0986..08c3d07 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -4,54 +4,47 @@ All URIs are relative to https://api.onesignal.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**beginLiveActivity()**](DefaultApi.md#beginLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity [**cancelNotification()**](DefaultApi.md#cancelNotification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +[**createAlias()**](DefaultApi.md#createAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +[**createAliasBySubscription()**](DefaultApi.md#createAliasBySubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | [**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 +[**createSegment()**](DefaultApi.md#createSegment) | **POST** /apps/{app_id}/segments | Create Segment [**createSubscription()**](DefaultApi.md#createSubscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | [**createUser()**](DefaultApi.md#createUser) | **POST** /apps/{app_id}/users | [**deleteAlias()**](DefaultApi.md#deleteAlias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | -[**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 +[**deleteSegment()**](DefaultApi.md#deleteSegment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment [**deleteSubscription()**](DefaultApi.md#deleteSubscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | [**deleteUser()**](DefaultApi.md#deleteUser) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -[**endLiveActivity()**](DefaultApi.md#endLiveActivity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity [**exportEvents()**](DefaultApi.md#exportEvents) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events -[**exportPlayers()**](DefaultApi.md#exportPlayers) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Players -[**fetchAliases()**](DefaultApi.md#fetchAliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | -[**fetchUser()**](DefaultApi.md#fetchUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -[**fetchUserIdentity()**](DefaultApi.md#fetchUserIdentity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +[**exportSubscriptions()**](DefaultApi.md#exportSubscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions +[**getAliases()**](DefaultApi.md#getAliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +[**getAliasesBySubscription()**](DefaultApi.md#getAliasesBySubscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | [**getApp()**](DefaultApi.md#getApp) | **GET** /apps/{app_id} | View an app [**getApps()**](DefaultApi.md#getApps) | **GET** /apps | View apps -[**getEligibleIams()**](DefaultApi.md#getEligibleIams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | [**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 -[**identifyUserByAlias()**](DefaultApi.md#identifyUserByAlias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | -[**identifyUserBySubscriptionId()**](DefaultApi.md#identifyUserBySubscriptionId) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +[**getSegments()**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments +[**getUser()**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | [**transferSubscription()**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | +[**unsubscribeEmailWithToken()**](DefaultApi.md#unsubscribeEmailWithToken) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token [**updateApp()**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app [**updateLiveActivity()**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push -[**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 [**updateSubscription()**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | [**updateUser()**](DefaultApi.md#updateUser) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -## `beginLiveActivity()` +## `cancelNotification()` ```php -beginLiveActivity($app_id, $activity_id, $begin_live_activity_request) +cancelNotification($app_id, $notification_id): \onesignal\client\model\GenericSuccessBoolResponse ``` -Start Live Activity +Stop a scheduled or currently outgoing notification -Starts a Live Activity +Used to stop a scheduled or currently outgoing notification ### Example @@ -60,7 +53,7 @@ Starts a Live Activity require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -73,14 +66,14 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs. -$activity_id = 'activity_id_example'; // string | Live Activity record ID -$begin_live_activity_request = new \onesignal\client\model\BeginLiveActivityRequest(); // \onesignal\client\model\BeginLiveActivityRequest +$app_id = 'app_id_example'; // string +$notification_id = 'notification_id_example'; // string try { - $apiInstance->beginLiveActivity($app_id, $activity_id, $begin_live_activity_request); + $result = $apiInstance->cancelNotification($app_id, $notification_id); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->beginLiveActivity: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->cancelNotification: ', $e->getMessage(), PHP_EOL; } ``` @@ -88,36 +81,35 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | - **activity_id** | **string**| Live Activity record ID | - **begin_live_activity_request** | [**\onesignal\client\model\BeginLiveActivityRequest**](../Model/BeginLiveActivityRequest.md)| | + **app_id** | **string**| | + **notification_id** | **string**| | ### Return type -void (empty response body) +[**\onesignal\client\model\GenericSuccessBoolResponse**](../Model/GenericSuccessBoolResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: `application/json` +- **Content-Type**: Not defined - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `cancelNotification()` +## `createAlias()` ```php -cancelNotification($app_id, $notification_id): \onesignal\client\model\CancelNotificationSuccessResponse +createAlias($app_id, $alias_label, $alias_id, $user_identity_body): \onesignal\client\model\UserIdentityBody ``` -Stop a scheduled or currently outgoing notification -Used to stop a scheduled or currently outgoing notification + +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). ### Example @@ -126,7 +118,7 @@ Used to stop a scheduled or currently outgoing notification require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -140,13 +132,15 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $config ); $app_id = 'app_id_example'; // string -$notification_id = 'notification_id_example'; // string +$alias_label = 'alias_label_example'; // string +$alias_id = 'alias_id_example'; // string +$user_identity_body = new \onesignal\client\model\UserIdentityBody(); // \onesignal\client\model\UserIdentityBody try { - $result = $apiInstance->cancelNotification($app_id, $notification_id); + $result = $apiInstance->createAlias($app_id, $alias_label, $alias_id, $user_identity_body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->cancelNotification: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->createAlias: ', $e->getMessage(), PHP_EOL; } ``` @@ -155,34 +149,36 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **string**| | - **notification_id** | **string**| | + **alias_label** | **string**| | + **alias_id** | **string**| | + **user_identity_body** | [**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md)| | ### Return type -[**\onesignal\client\model\CancelNotificationSuccessResponse**](../Model/CancelNotificationSuccessResponse.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: `application/json` - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `createApp()` +## `createAliasBySubscription()` ```php -createApp($app): \onesignal\client\model\App +createAliasBySubscription($app_id, $subscription_id, $user_identity_body): \onesignal\client\model\UserIdentityBody ``` -Create an app -Creates a new OneSignal app + +Upserts one or more Aliases for the User identified by :subscription_id. ### Example @@ -191,7 +187,7 @@ Creates a new OneSignal app require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: user_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -204,13 +200,15 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$app = new \onesignal\client\model\App(); // \onesignal\client\model\App +$app_id = 'app_id_example'; // string +$subscription_id = 'subscription_id_example'; // string +$user_identity_body = new \onesignal\client\model\UserIdentityBody(); // \onesignal\client\model\UserIdentityBody try { - $result = $apiInstance->createApp($app); + $result = $apiInstance->createAliasBySubscription($app_id, $subscription_id, $user_identity_body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->createApp: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->createAliasBySubscription: ', $e->getMessage(), PHP_EOL; } ``` @@ -218,15 +216,17 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **app** | [**\onesignal\client\model\App**](../Model/App.md)| | + **app_id** | **string**| | + **subscription_id** | **string**| | + **user_identity_body** | [**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md)| | ### Return type -[**\onesignal\client\model\App**](../Model/App.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[user_key](../../README.md#user_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -237,15 +237,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `createNotification()` +## `createApp()` ```php -createNotification($notification): \onesignal\client\model\CreateNotificationSuccessResponse +createApp($app): \onesignal\client\model\App ``` -Create notification +Create an app -Sends notifications to your users +Creates a new OneSignal app ### Example @@ -254,7 +254,7 @@ Sends notifications to your users require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: user_auth_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -267,13 +267,13 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$notification = new \onesignal\client\model\Notification(); // \onesignal\client\model\Notification +$app = new \onesignal\client\model\App(); // \onesignal\client\model\App try { - $result = $apiInstance->createNotification($notification); + $result = $apiInstance->createApp($app); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->createApp: ', $e->getMessage(), PHP_EOL; } ``` @@ -281,15 +281,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **notification** | [**\onesignal\client\model\Notification**](../Model/Notification.md)| | + **app** | [**\onesignal\client\model\App**](../Model/App.md)| | ### Return type -[**\onesignal\client\model\CreateNotificationSuccessResponse**](../Model/CreateNotificationSuccessResponse.md) +[**\onesignal\client\model\App**](../Model/App.md) ### Authorization -[app_key](../../README.md#app_key) +[user_auth_key](../../README.md#user_auth_key) ### HTTP request headers @@ -300,15 +300,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `createPlayer()` +## `createNotification()` ```php -createPlayer($player): \onesignal\client\model\CreatePlayerSuccessResponse +createNotification($notification): \onesignal\client\model\CreateNotificationSuccessResponse ``` -Add a device +Create notification -Register a new device to one of your OneSignal apps 🚧 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. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. +Sends notifications to your users ### Example @@ -317,7 +317,7 @@ Register a new device to one of your OneSignal apps 🚧 Don't use this Thi require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -330,13 +330,13 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$player = new \onesignal\client\model\Player(); // \onesignal\client\model\Player +$notification = new \onesignal\client\model\Notification(); // \onesignal\client\model\Notification try { - $result = $apiInstance->createPlayer($player); + $result = $apiInstance->createNotification($notification); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->createPlayer: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->createNotification: ', $e->getMessage(), PHP_EOL; } ``` @@ -344,15 +344,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **player** | [**\onesignal\client\model\Player**](../Model/Player.md)| | + **notification** | [**\onesignal\client\model\Notification**](../Model/Notification.md)| | ### Return type -[**\onesignal\client\model\CreatePlayerSuccessResponse**](../Model/CreatePlayerSuccessResponse.md) +[**\onesignal\client\model\CreateNotificationSuccessResponse**](../Model/CreateNotificationSuccessResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -363,15 +363,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `createSegments()` +## `createSegment()` ```php -createSegments($app_id, $segment): \onesignal\client\model\CreateSegmentSuccessResponse +createSegment($app_id, $segment): \onesignal\client\model\CreateSegmentSuccessResponse ``` -Create Segments +Create Segment -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. 🚧 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. +Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. ### Example @@ -380,7 +380,7 @@ Create segments visible and usable in the dashboard and API - Required: OneSigna require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -397,10 +397,10 @@ $app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Avai $segment = new \onesignal\client\model\Segment(); // \onesignal\client\model\Segment try { - $result = $apiInstance->createSegments($app_id, $segment); + $result = $apiInstance->createSegment($app_id, $segment); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->createSegments: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->createSegment: ', $e->getMessage(), PHP_EOL; } ``` @@ -417,7 +417,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -431,7 +431,7 @@ Name | Type | Description | Notes ## `createSubscription()` ```php -createSubscription($app_id, $alias_label, $alias_id, $create_subscription_request_body): \onesignal\client\model\InlineResponse201 +createSubscription($app_id, $alias_label, $alias_id, $subscription_body): \onesignal\client\model\SubscriptionBody ``` @@ -445,7 +445,7 @@ Creates a new Subscription under the User provided. Useful to add email addresse require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -461,10 +461,10 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $app_id = 'app_id_example'; // string $alias_label = 'alias_label_example'; // string $alias_id = 'alias_id_example'; // string -$create_subscription_request_body = new \onesignal\client\model\CreateSubscriptionRequestBody(); // \onesignal\client\model\CreateSubscriptionRequestBody +$subscription_body = new \onesignal\client\model\SubscriptionBody(); // \onesignal\client\model\SubscriptionBody try { - $result = $apiInstance->createSubscription($app_id, $alias_label, $alias_id, $create_subscription_request_body); + $result = $apiInstance->createSubscription($app_id, $alias_label, $alias_id, $subscription_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->createSubscription: ', $e->getMessage(), PHP_EOL; @@ -478,15 +478,15 @@ Name | Type | Description | Notes **app_id** | **string**| | **alias_label** | **string**| | **alias_id** | **string**| | - **create_subscription_request_body** | [**\onesignal\client\model\CreateSubscriptionRequestBody**](../Model/CreateSubscriptionRequestBody.md)| | + **subscription_body** | [**\onesignal\client\model\SubscriptionBody**](../Model/SubscriptionBody.md)| | ### Return type -[**\onesignal\client\model\InlineResponse201**](../Model/InlineResponse201.md) +[**\onesignal\client\model\SubscriptionBody**](../Model/SubscriptionBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -514,7 +514,7 @@ Creates a User, optionally Subscriptions owned by the User as well as Aliases. A require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -551,7 +551,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -565,7 +565,7 @@ Name | Type | Description | Notes ## `deleteAlias()` ```php -deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_delete): \onesignal\client\model\InlineResponse200 +deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_delete): \onesignal\client\model\UserIdentityBody ``` @@ -579,7 +579,7 @@ Deletes an alias by alias label require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -616,76 +616,11 @@ Name | Type | Description | Notes ### Return type -[**\onesignal\client\model\InlineResponse200**](../Model/InlineResponse200.md) - -### Authorization - -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deletePlayer()` - -```php -deletePlayer($app_id, $player_id): \onesignal\client\model\DeletePlayerSuccessResponse -``` - -Delete a user record - -Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - -### Example - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs. -$player_id = 'player_id_example'; // string | The OneSignal player_id - -try { - $result = $apiInstance->deletePlayer($app_id, $player_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->deletePlayer: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | - **player_id** | **string**| The OneSignal player_id | - -### Return type - -[**\onesignal\client\model\DeletePlayerSuccessResponse**](../Model/DeletePlayerSuccessResponse.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -696,15 +631,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `deleteSegments()` +## `deleteSegment()` ```php -deleteSegments($app_id, $segment_id): \onesignal\client\model\DeleteSegmentSuccessResponse +deleteSegment($app_id, $segment_id): \onesignal\client\model\GenericSuccessBoolResponse ``` -Delete Segments +Delete Segment -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. +Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. ### Example @@ -713,7 +648,7 @@ Delete segments (not user devices) - Required: OneSignal Paid Plan You can delet require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -730,10 +665,10 @@ $app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Avai $segment_id = 'segment_id_example'; // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard. try { - $result = $apiInstance->deleteSegments($app_id, $segment_id); + $result = $apiInstance->deleteSegment($app_id, $segment_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->deleteSegments: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->deleteSegment: ', $e->getMessage(), PHP_EOL; } ``` @@ -746,11 +681,11 @@ Name | Type | Description | Notes ### Return type -[**\onesignal\client\model\DeleteSegmentSuccessResponse**](../Model/DeleteSegmentSuccessResponse.md) +[**\onesignal\client\model\GenericSuccessBoolResponse**](../Model/GenericSuccessBoolResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -778,7 +713,7 @@ Deletes the Subscription. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -814,7 +749,7 @@ void (empty response body) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -842,7 +777,7 @@ Removes the User identified by (:alias_label, :alias_id), and all Subscriptions require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -880,73 +815,7 @@ void (empty response body) ### Authorization -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `endLiveActivity()` - -```php -endLiveActivity($app_id, $activity_id, $subscription_id) -``` - -Stop Live Activity - -Stops a Live Activity - -### Example - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs. -$activity_id = 'activity_id_example'; // string | Live Activity record ID -$subscription_id = 'subscription_id_example'; // string | Subscription ID - -try { - $apiInstance->endLiveActivity($app_id, $activity_id, $subscription_id); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->endLiveActivity: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | - **activity_id** | **string**| Live Activity record ID | - **subscription_id** | **string**| Subscription ID | - -### Return type - -void (empty response body) - -### Authorization - -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -974,7 +843,7 @@ Generate a compressed CSV report of all of the events data for a notification. T require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1011,7 +880,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1022,13 +891,13 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `exportPlayers()` +## `exportSubscriptions()` ```php -exportPlayers($app_id, $export_players_request_body): \onesignal\client\model\ExportPlayersSuccessResponse +exportSubscriptions($app_id, $export_subscriptions_request_body): \onesignal\client\model\ExportSubscriptionsSuccessResponse ``` -Export CSV of Players +Export CSV of Subscriptions Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 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. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 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. | @@ -1039,7 +908,7 @@ Generate a compressed CSV export of all of your current user data This method ca require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1053,13 +922,13 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $config ); $app_id = 'app_id_example'; // string | The app ID that you want to export devices from -$export_players_request_body = new \onesignal\client\model\ExportPlayersRequestBody(); // \onesignal\client\model\ExportPlayersRequestBody +$export_subscriptions_request_body = new \onesignal\client\model\ExportSubscriptionsRequestBody(); // \onesignal\client\model\ExportSubscriptionsRequestBody try { - $result = $apiInstance->exportPlayers($app_id, $export_players_request_body); + $result = $apiInstance->exportSubscriptions($app_id, $export_subscriptions_request_body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->exportPlayers: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->exportSubscriptions: ', $e->getMessage(), PHP_EOL; } ``` @@ -1068,15 +937,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **string**| The app ID that you want to export devices from | - **export_players_request_body** | [**\onesignal\client\model\ExportPlayersRequestBody**](../Model/ExportPlayersRequestBody.md)| | [optional] + **export_subscriptions_request_body** | [**\onesignal\client\model\ExportSubscriptionsRequestBody**](../Model/ExportSubscriptionsRequestBody.md)| | [optional] ### Return type -[**\onesignal\client\model\ExportPlayersSuccessResponse**](../Model/ExportPlayersSuccessResponse.md) +[**\onesignal\client\model\ExportSubscriptionsSuccessResponse**](../Model/ExportSubscriptionsSuccessResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1087,80 +956,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `fetchAliases()` - -```php -fetchAliases($app_id, $subscription_id): \onesignal\client\model\UserIdentityResponse -``` - - - -Lists all Aliases for the User identified by :subscription_id. - -### Example - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string -$subscription_id = 'subscription_id_example'; // string - -try { - $result = $apiInstance->fetchAliases($app_id, $subscription_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->fetchAliases: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| | - **subscription_id** | **string**| | - -### Return type - -[**\onesignal\client\model\UserIdentityResponse**](../Model/UserIdentityResponse.md) - -### Authorization - -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `fetchUser()` +## `getAliases()` ```php -fetchUser($app_id, $alias_label, $alias_id): \onesignal\client\model\User +getAliases($app_id, $alias_label, $alias_id): \onesignal\client\model\UserIdentityBody ``` -Returns the User’s properties, Aliases, and Subscriptions. +Lists all Aliases for the User identified by (:alias_label, :alias_id). ### Example @@ -1169,7 +973,7 @@ Returns the User’s properties, Aliases, and Subscriptions. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1187,10 +991,10 @@ $alias_label = 'alias_label_example'; // string $alias_id = 'alias_id_example'; // string try { - $result = $apiInstance->fetchUser($app_id, $alias_label, $alias_id); + $result = $apiInstance->getAliases($app_id, $alias_label, $alias_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->fetchUser: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->getAliases: ', $e->getMessage(), PHP_EOL; } ``` @@ -1204,11 +1008,11 @@ Name | Type | Description | Notes ### Return type -[**\onesignal\client\model\User**](../Model/User.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1219,15 +1023,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `fetchUserIdentity()` +## `getAliasesBySubscription()` ```php -fetchUserIdentity($app_id, $alias_label, $alias_id): \onesignal\client\model\InlineResponse200 +getAliasesBySubscription($app_id, $subscription_id): \onesignal\client\model\UserIdentityBody ``` -Lists all Aliases for the User identified by (:alias_label, :alias_id). +Lists all Aliases for the User identified by :subscription_id. ### Example @@ -1236,7 +1040,7 @@ Lists all Aliases for the User identified by (:alias_label, :alias_id). require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1250,14 +1054,13 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $config ); $app_id = 'app_id_example'; // string -$alias_label = 'alias_label_example'; // string -$alias_id = 'alias_id_example'; // string +$subscription_id = 'subscription_id_example'; // string try { - $result = $apiInstance->fetchUserIdentity($app_id, $alias_label, $alias_id); + $result = $apiInstance->getAliasesBySubscription($app_id, $subscription_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->fetchUserIdentity: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->getAliasesBySubscription: ', $e->getMessage(), PHP_EOL; } ``` @@ -1266,16 +1069,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **string**| | - **alias_label** | **string**| | - **alias_id** | **string**| | + **subscription_id** | **string**| | ### Return type -[**\onesignal\client\model\InlineResponse200**](../Model/InlineResponse200.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1303,7 +1105,7 @@ View the details of a single OneSignal app require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: user_key +// Configure Bearer authorization: user_auth_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1338,7 +1140,7 @@ Name | Type | Description | Notes ### Authorization -[user_key](../../README.md#user_key) +[user_auth_key](../../README.md#user_auth_key) ### HTTP request headers @@ -1366,7 +1168,7 @@ View the details of all of your current OneSignal apps require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: user_key +// Configure Bearer authorization: user_auth_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1398,72 +1200,7 @@ This endpoint does not need any parameter. ### Authorization -[user_key](../../README.md#user_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getEligibleIams()` - -```php -getEligibleIams($app_id, $subscription_id): \onesignal\client\model\InlineResponse2003 -``` - - - -Manifest of In-App Messages the Subscription is eligible to display by the SDK. - -### Example - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string -$subscription_id = 'subscription_id_example'; // string - -try { - $result = $apiInstance->getEligibleIams($app_id, $subscription_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->getEligibleIams: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| | - **subscription_id** | **string**| | - -### Return type - -[**\onesignal\client\model\InlineResponse2003**](../Model/InlineResponse2003.md) - -### Authorization - -[app_key](../../README.md#app_key) +[user_auth_key](../../README.md#user_auth_key) ### HTTP request headers @@ -1491,7 +1228,7 @@ View the details of a single notification and outcomes associated with it require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1528,7 +1265,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1542,7 +1279,7 @@ Name | Type | Description | Notes ## `getNotificationHistory()` ```php -getNotificationHistory($notification_id, $get_notification_request_body): \onesignal\client\model\NotificationHistorySuccessResponse +getNotificationHistory($notification_id, $get_notification_history_request_body): \onesignal\client\model\NotificationHistorySuccessResponse ``` Notification History @@ -1556,7 +1293,7 @@ Notification History require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1570,10 +1307,10 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $config ); $notification_id = 'notification_id_example'; // string | The \"id\" of the message found in the Notification object -$get_notification_request_body = new \onesignal\client\model\GetNotificationRequestBody(); // \onesignal\client\model\GetNotificationRequestBody +$get_notification_history_request_body = new \onesignal\client\model\GetNotificationHistoryRequestBody(); // \onesignal\client\model\GetNotificationHistoryRequestBody try { - $result = $apiInstance->getNotificationHistory($notification_id, $get_notification_request_body); + $result = $apiInstance->getNotificationHistory($notification_id, $get_notification_history_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->getNotificationHistory: ', $e->getMessage(), PHP_EOL; @@ -1585,7 +1322,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **notification_id** | **string**| The \"id\" of the message found in the Notification object | - **get_notification_request_body** | [**\onesignal\client\model\GetNotificationRequestBody**](../Model/GetNotificationRequestBody.md)| | + **get_notification_history_request_body** | [**\onesignal\client\model\GetNotificationHistoryRequestBody**](../Model/GetNotificationHistoryRequestBody.md)| | ### Return type @@ -1593,7 +1330,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1621,7 +1358,7 @@ View the details of multiple notifications require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1662,7 +1399,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1690,7 +1427,7 @@ View the details of all the outcomes associated with your app 🚧 Require require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1735,7 +1472,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1746,15 +1483,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getPlayer()` +## `getSegments()` ```php -getPlayer($app_id, $player_id, $email_auth_hash): \onesignal\client\model\Player +getSegments($app_id, $offset, $limit): \onesignal\client\model\GetSegmentsSuccessResponse ``` -View device +Get Segments -View the details of an existing device in one of your OneSignal apps +Returns an array of segments from an app. ### Example @@ -1763,7 +1500,7 @@ View the details of an existing device in one of your OneSignal apps require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1776,82 +1513,15 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$app_id = 'app_id_example'; // string | Your app_id for this device -$player_id = 'player_id_example'; // string | Player's OneSignal ID -$email_auth_hash = 'email_auth_hash_example'; // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). - -try { - $result = $apiInstance->getPlayer($app_id, $player_id, $email_auth_hash); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->getPlayer: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| Your app_id for this device | - **player_id** | **string**| Player's OneSignal ID | - **email_auth_hash** | **string**| Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] - -### Return type - -[**\onesignal\client\model\Player**](../Model/Player.md) - -### Authorization - -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getPlayers()` - -```php -getPlayers($app_id, $limit, $offset): \onesignal\client\model\PlayerSlice -``` - -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 - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string | The app ID that you want to view players from -$limit = 56; // int | How many devices to return. Max is 300. Default is 300 -$offset = 56; // int | Result offset. Default is 0. Results are sorted by id; +$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs. +$offset = 56; // int | Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. +$limit = 56; // int | The amount of Segments in the response. Maximum 300. try { - $result = $apiInstance->getPlayers($app_id, $limit, $offset); + $result = $apiInstance->getSegments($app_id, $offset, $limit); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->getPlayers: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->getSegments: ', $e->getMessage(), PHP_EOL; } ``` @@ -1859,17 +1529,17 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **app_id** | **string**| The app ID that you want to view players from | - **limit** | **int**| How many devices to return. Max is 300. Default is 300 | [optional] - **offset** | **int**| Result offset. Default is 0. Results are sorted by id; | [optional] + **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **offset** | **int**| Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. | [optional] + **limit** | **int**| The amount of Segments in the response. Maximum 300. | [optional] ### Return type -[**\onesignal\client\model\PlayerSlice**](../Model/PlayerSlice.md) +[**\onesignal\client\model\GetSegmentsSuccessResponse**](../Model/GetSegmentsSuccessResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -1880,15 +1550,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `identifyUserByAlias()` +## `getUser()` ```php -identifyUserByAlias($app_id, $alias_label, $alias_id, $user_identity_request_body): \onesignal\client\model\InlineResponse200 +getUser($app_id, $alias_label, $alias_id): \onesignal\client\model\User ``` -Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). +Returns the User’s properties, Aliases, and Subscriptions. ### Example @@ -1897,7 +1567,7 @@ Upserts one or more Aliases to an existing User identified by (:alias_label, :al require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1913,13 +1583,12 @@ $apiInstance = new onesignal\client\Api\DefaultApi( $app_id = 'app_id_example'; // string $alias_label = 'alias_label_example'; // string $alias_id = 'alias_id_example'; // string -$user_identity_request_body = new \onesignal\client\model\UserIdentityRequestBody(); // \onesignal\client\model\UserIdentityRequestBody try { - $result = $apiInstance->identifyUserByAlias($app_id, $alias_label, $alias_id, $user_identity_request_body); + $result = $apiInstance->getUser($app_id, $alias_label, $alias_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->identifyUserByAlias: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->getUser: ', $e->getMessage(), PHP_EOL; } ``` @@ -1930,34 +1599,33 @@ Name | Type | Description | Notes **app_id** | **string**| | **alias_label** | **string**| | **alias_id** | **string**| | - **user_identity_request_body** | [**\onesignal\client\model\UserIdentityRequestBody**](../Model/UserIdentityRequestBody.md)| | ### Return type -[**\onesignal\client\model\InlineResponse200**](../Model/InlineResponse200.md) +[**\onesignal\client\model\User**](../Model/User.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: `application/json` +- **Content-Type**: Not defined - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `identifyUserBySubscriptionId()` +## `transferSubscription()` ```php -identifyUserBySubscriptionId($app_id, $subscription_id, $user_identity_request_body): \onesignal\client\model\UserIdentityResponse +transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body): \onesignal\client\model\UserIdentityBody ``` -Upserts one or more Aliases for the User identified by :subscription_id. +Transfers this Subscription to the User identified by the identity in the payload. ### Example @@ -1966,7 +1634,7 @@ Upserts one or more Aliases for the User identified by :subscription_id. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -1981,13 +1649,13 @@ $apiInstance = new onesignal\client\Api\DefaultApi( ); $app_id = 'app_id_example'; // string $subscription_id = 'subscription_id_example'; // string -$user_identity_request_body = new \onesignal\client\model\UserIdentityRequestBody(); // \onesignal\client\model\UserIdentityRequestBody +$transfer_subscription_request_body = new \onesignal\client\model\TransferSubscriptionRequestBody(); // \onesignal\client\model\TransferSubscriptionRequestBody try { - $result = $apiInstance->identifyUserBySubscriptionId($app_id, $subscription_id, $user_identity_request_body); + $result = $apiInstance->transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->identifyUserBySubscriptionId: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->transferSubscription: ', $e->getMessage(), PHP_EOL; } ``` @@ -1997,15 +1665,15 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **string**| | **subscription_id** | **string**| | - **user_identity_request_body** | [**\onesignal\client\model\UserIdentityRequestBody**](../Model/UserIdentityRequestBody.md)| | + **transfer_subscription_request_body** | [**\onesignal\client\model\TransferSubscriptionRequestBody**](../Model/TransferSubscriptionRequestBody.md)| | ### Return type -[**\onesignal\client\model\UserIdentityResponse**](../Model/UserIdentityResponse.md) +[**\onesignal\client\model\UserIdentityBody**](../Model/UserIdentityBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -2016,15 +1684,15 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `transferSubscription()` +## `unsubscribeEmailWithToken()` ```php -transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body): \onesignal\client\model\UserIdentityResponse +unsubscribeEmailWithToken($app_id, $notification_id, $token): \onesignal\client\model\GenericSuccessBoolResponse ``` +Unsubscribe with token - -Transfers this Subscription to the User identified by the identity in the payload. +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Example @@ -2033,7 +1701,7 @@ Transfers this Subscription to the User identified by the identity in the payloa require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -2046,15 +1714,15 @@ $apiInstance = new onesignal\client\Api\DefaultApi( new GuzzleHttp\Client(), $config ); -$app_id = 'app_id_example'; // string -$subscription_id = 'subscription_id_example'; // string -$transfer_subscription_request_body = new \onesignal\client\model\TransferSubscriptionRequestBody(); // \onesignal\client\model\TransferSubscriptionRequestBody +$app_id = 'app_id_example'; // string | The OneSignal App ID for your app. Available in Keys & IDs. +$notification_id = 'notification_id_example'; // string | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. +$token = 'token_example'; // string | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. try { - $result = $apiInstance->transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body); + $result = $apiInstance->unsubscribeEmailWithToken($app_id, $notification_id, $token); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DefaultApi->transferSubscription: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DefaultApi->unsubscribeEmailWithToken: ', $e->getMessage(), PHP_EOL; } ``` @@ -2062,21 +1730,21 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **app_id** | **string**| | - **subscription_id** | **string**| | - **transfer_subscription_request_body** | [**\onesignal\client\model\TransferSubscriptionRequestBody**](../Model/TransferSubscriptionRequestBody.md)| | + **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **notification_id** | **string**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | + **token** | **string**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | ### Return type -[**\onesignal\client\model\UserIdentityResponse**](../Model/UserIdentityResponse.md) +[**\onesignal\client\model\GenericSuccessBoolResponse**](../Model/GenericSuccessBoolResponse.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers -- **Content-Type**: `application/json` +- **Content-Type**: Not defined - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) @@ -2100,7 +1768,7 @@ Updates the name or configuration settings of an existing OneSignal app require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: user_key +// Configure Bearer authorization: user_auth_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -2137,7 +1805,7 @@ Name | Type | Description | Notes ### Authorization -[user_key](../../README.md#user_key) +[user_auth_key](../../README.md#user_auth_key) ### HTTP request headers @@ -2165,7 +1833,7 @@ Updates a specified live activity. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -2204,139 +1872,7 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `updatePlayer()` - -```php -updatePlayer($player_id, $player): \onesignal\client\model\UpdatePlayerSuccessResponse -``` - -Edit device - -Update an existing device in one of your OneSignal apps - -### Example - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$player_id = 'player_id_example'; // string | Player's OneSignal ID -$player = new \onesignal\client\model\Player(); // \onesignal\client\model\Player - -try { - $result = $apiInstance->updatePlayer($player_id, $player); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->updatePlayer: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **player_id** | **string**| Player's OneSignal ID | - **player** | [**\onesignal\client\model\Player**](../Model/Player.md)| | - -### Return type - -[**\onesignal\client\model\UpdatePlayerSuccessResponse**](../Model/UpdatePlayerSuccessResponse.md) - -### Authorization - -[app_key](../../README.md#app_key) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `updatePlayerTags()` - -```php -updatePlayerTags($app_id, $external_user_id, $update_player_tags_request_body): \onesignal\client\model\UpdatePlayerTagsSuccessResponse -``` - -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. 📘 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 - -```php -setAppKeyToken('YOUR_APP_KEY_TOKEN') - ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); - - - -$apiInstance = new onesignal\client\Api\DefaultApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$app_id = 'app_id_example'; // string | The OneSignal App ID the user record is found under. -$external_user_id = 'external_user_id_example'; // string | The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. -$update_player_tags_request_body = new \onesignal\client\model\UpdatePlayerTagsRequestBody(); // \onesignal\client\model\UpdatePlayerTagsRequestBody - -try { - $result = $apiInstance->updatePlayerTags($app_id, $external_user_id, $update_player_tags_request_body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->updatePlayerTags: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **string**| The OneSignal App ID the user record is found under. | - **external_user_id** | **string**| The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. | - **update_player_tags_request_body** | [**\onesignal\client\model\UpdatePlayerTagsRequestBody**](../Model/UpdatePlayerTagsRequestBody.md)| | [optional] - -### Return type - -[**\onesignal\client\model\UpdatePlayerTagsSuccessResponse**](../Model/UpdatePlayerTagsSuccessResponse.md) - -### Authorization - -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -2350,7 +1886,7 @@ Name | Type | Description | Notes ## `updateSubscription()` ```php -updateSubscription($app_id, $subscription_id, $update_subscription_request_body) +updateSubscription($app_id, $subscription_id, $subscription_body) ``` @@ -2364,7 +1900,7 @@ Updates an existing Subscription’s properties. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -2379,10 +1915,10 @@ $apiInstance = new onesignal\client\Api\DefaultApi( ); $app_id = 'app_id_example'; // string $subscription_id = 'subscription_id_example'; // string -$update_subscription_request_body = new \onesignal\client\model\UpdateSubscriptionRequestBody(); // \onesignal\client\model\UpdateSubscriptionRequestBody +$subscription_body = new \onesignal\client\model\SubscriptionBody(); // \onesignal\client\model\SubscriptionBody try { - $apiInstance->updateSubscription($app_id, $subscription_id, $update_subscription_request_body); + $apiInstance->updateSubscription($app_id, $subscription_id, $subscription_body); } catch (Exception $e) { echo 'Exception when calling DefaultApi->updateSubscription: ', $e->getMessage(), PHP_EOL; } @@ -2394,7 +1930,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **string**| | **subscription_id** | **string**| | - **update_subscription_request_body** | [**\onesignal\client\model\UpdateSubscriptionRequestBody**](../Model/UpdateSubscriptionRequestBody.md)| | + **subscription_body** | [**\onesignal\client\model\SubscriptionBody**](../Model/SubscriptionBody.md)| | ### Return type @@ -2402,7 +1938,7 @@ void (empty response body) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers @@ -2416,7 +1952,7 @@ void (empty response body) ## `updateUser()` ```php -updateUser($app_id, $alias_label, $alias_id, $update_user_request): \onesignal\client\model\InlineResponse202 +updateUser($app_id, $alias_label, $alias_id, $update_user_request): \onesignal\client\model\PropertiesBody ``` @@ -2430,7 +1966,7 @@ Updates an existing User’s properties. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure Bearer authorization: app_key +// Configure Bearer authorization: rest_api_key $config = onesignal\client\Configuration::getDefaultConfiguration() ->setAppKeyToken('YOUR_APP_KEY_TOKEN') ->setUserKeyToken('YOUR_USER_KEY_TOKEN'); @@ -2467,11 +2003,11 @@ Name | Type | Description | Notes ### Return type -[**\onesignal\client\model\InlineResponse202**](../Model/InlineResponse202.md) +[**\onesignal\client\model\PropertiesBody**](../Model/PropertiesBody.md) ### Authorization -[app_key](../../README.md#app_key) +[rest_api_key](../../README.md#rest_api_key) ### HTTP request headers diff --git a/docs/Model/BasicNotification.md b/docs/Model/BasicNotification.md index 725c3c4..5c40e2c 100644 --- a/docs/Model/BasicNotification.md +++ b/docs/Model/BasicNotification.md @@ -6,17 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **included_segments** | **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] **excluded_segments** | **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] -**include_player_ids** | **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] -**include_external_user_ids** | **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] +**include_subscription_ids** | **string[]** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] **include_email_tokens** | **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] **include_phone_numbers** | **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] -**include_ios_tokens** | **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] -**include_wp_wns_uris** | **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] -**include_amazon_reg_ids** | **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] -**include_chrome_reg_ids** | **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] -**include_chrome_web_reg_ids** | **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] -**include_android_reg_ids** | **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] -**include_aliases** | [**\onesignal\client\model\PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**include_ios_tokens** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_wp_wns_uris** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_amazon_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_web_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_android_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_aliases** | **array** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] **target_channel** | **string** | | [optional] **id** | **string** | | [optional] **value** | **int** | | [optional] [readonly] @@ -32,13 +31,12 @@ Name | Type | Description | Notes **is_wp_wns** | **bool** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] **is_adm** | **bool** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] **is_chrome** | **bool** | 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] -**channel_for_external_user_ids** | **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] **app_id** | **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. | **external_id** | **string** | [DEPRECATED] 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] **idempotency_key** | **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] -**contents** | [**StringMap**](StringMap.md) | | [optional] -**headings** | [**StringMap**](StringMap.md) | | [optional] -**subtitle** | [**StringMap**](StringMap.md) | | [optional] +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**subtitle** | [**LanguageStringMap**](LanguageStringMap.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] **huawei_msg_type** | **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] @@ -55,7 +53,7 @@ Name | Type | Description | Notes **chrome_big_picture** | **string** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] **chrome_web_image** | **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** | [**\onesignal\client\model\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] -**web_buttons** | [**\onesignal\client\model\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] +**web_buttons** | [**\onesignal\client\model\WebButton[]**](WebButton.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] **ios_category** | **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] **android_channel_id** | **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] **huawei_channel_id** | **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] @@ -101,6 +99,8 @@ Name | Type | Description | Notes **thread_id** | **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] **summary_arg** | **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] **summary_arg_count** | **int** | 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] +**ios_relevance_score** | **float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] +**ios_interruption_level** | **string** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] **email_subject** | **string** | Channel: Email Required. The subject of the email. | [optional] **email_body** | **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] **email_from_name** | **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] @@ -109,7 +109,7 @@ Name | Type | Description | Notes **include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] **sms_from** | **string** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] **sms_media_urls** | **string[]** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] -**filters** | [**\onesignal\client\model\Filter[]**](Filter.md) | | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | | [optional] **custom_data** | **object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicNotificationAllOf.md b/docs/Model/BasicNotificationAllOf.md index aab603e..98f3b1c 100644 --- a/docs/Model/BasicNotificationAllOf.md +++ b/docs/Model/BasicNotificationAllOf.md @@ -18,13 +18,12 @@ Name | Type | Description | Notes **is_wp_wns** | **bool** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] **is_adm** | **bool** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] **is_chrome** | **bool** | 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] -**channel_for_external_user_ids** | **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] **app_id** | **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] **external_id** | **string** | [DEPRECATED] 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] **idempotency_key** | **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] -**contents** | [**StringMap**](StringMap.md) | | [optional] -**headings** | [**StringMap**](StringMap.md) | | [optional] -**subtitle** | [**StringMap**](StringMap.md) | | [optional] +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**subtitle** | [**LanguageStringMap**](LanguageStringMap.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] **huawei_msg_type** | **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] @@ -41,7 +40,7 @@ Name | Type | Description | Notes **chrome_big_picture** | **string** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] **chrome_web_image** | **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** | [**\onesignal\client\model\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] -**web_buttons** | [**\onesignal\client\model\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] +**web_buttons** | [**\onesignal\client\model\WebButton[]**](WebButton.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] **ios_category** | **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] **android_channel_id** | **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] **huawei_channel_id** | **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] @@ -87,6 +86,8 @@ Name | Type | Description | Notes **thread_id** | **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] **summary_arg** | **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] **summary_arg_count** | **int** | 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] +**ios_relevance_score** | **float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] +**ios_interruption_level** | **string** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] **email_subject** | **string** | Channel: Email Required. The subject of the email. | [optional] **email_body** | **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] **email_from_name** | **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] @@ -95,7 +96,7 @@ Name | Type | Description | Notes **include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] **sms_from** | **string** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] **sms_media_urls** | **string[]** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] -**filters** | [**\onesignal\client\model\Filter[]**](Filter.md) | | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | | [optional] **custom_data** | **object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateNotificationSuccessResponse.md b/docs/Model/CreateNotificationSuccessResponse.md index 4d917c9..c089ecc 100644 --- a/docs/Model/CreateNotificationSuccessResponse.md +++ b/docs/Model/CreateNotificationSuccessResponse.md @@ -5,8 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | | [optional] -**recipients** | **int** | Estimated number of subscribers targetted by notification. | [optional] **external_id** | **string** | | [optional] -**errors** | [**\onesignal\client\model\Notification200Errors**](Notification200Errors.md) | | [optional] +**errors** | **mixed** | Errors include the identifiers that are invalid, or that there are no subscribers. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubscriptionRequestBody.md b/docs/Model/CreateSubscriptionRequestBody.md deleted file mode 100644 index a80941d..0000000 --- a/docs/Model/CreateSubscriptionRequestBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# # CreateSubscriptionRequestBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subscription** | [**\onesignal\client\model\SubscriptionObject**](SubscriptionObject.md) | | [optional] -**retain_previous_owner** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeletePlayerNotFoundResponse.md b/docs/Model/DeletePlayerNotFoundResponse.md deleted file mode 100644 index 05f1ad6..0000000 --- a/docs/Model/DeletePlayerNotFoundResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DeletePlayerNotFoundResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteSegmentSuccessResponse.md b/docs/Model/DeleteSegmentSuccessResponse.md deleted file mode 100644 index afb45fc..0000000 --- a/docs/Model/DeleteSegmentSuccessResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DeleteSegmentSuccessResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExportPlayersRequestBody.md b/docs/Model/ExportSubscriptionsRequestBody.md similarity index 95% rename from docs/Model/ExportPlayersRequestBody.md rename to docs/Model/ExportSubscriptionsRequestBody.md index 86cb64e..b5b5c1b 100644 --- a/docs/Model/ExportPlayersRequestBody.md +++ b/docs/Model/ExportSubscriptionsRequestBody.md @@ -1,4 +1,4 @@ -# # ExportPlayersRequestBody +# # ExportSubscriptionsRequestBody ## Properties diff --git a/docs/Model/ExportPlayersSuccessResponse.md b/docs/Model/ExportSubscriptionsSuccessResponse.md similarity index 88% rename from docs/Model/ExportPlayersSuccessResponse.md rename to docs/Model/ExportSubscriptionsSuccessResponse.md index e11d3a6..3d77ffc 100644 --- a/docs/Model/ExportPlayersSuccessResponse.md +++ b/docs/Model/ExportSubscriptionsSuccessResponse.md @@ -1,4 +1,4 @@ -# # ExportPlayersSuccessResponse +# # ExportSubscriptionsSuccessResponse ## Properties diff --git a/docs/Model/Filter.md b/docs/Model/Filter.md index ce40830..48b2bac 100644 --- a/docs/Model/Filter.md +++ b/docs/Model/Filter.md @@ -4,9 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**field** | **string** | Name of the field to use as the first operand in the filter expression. | +**field** | **string** | Required. Name of the field to use as the first operand in the filter expression. | [optional] **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** | **string** | Operator of a filter expression. | +**hours_ago** | **string** | If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. | [optional] +**radius** | **float** | If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. | [optional] +**lat** | **float** | If `field` is `location`, this is *required* to specify the user's latitude. | [optional] +**long** | **float** | If `field` is `location`, this is *required* to specify the user's longitude. | [optional] +**relation** | **string** | Required. Operator of a filter expression. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterExpression.md b/docs/Model/FilterExpression.md new file mode 100644 index 0000000..a8a7dd1 --- /dev/null +++ b/docs/Model/FilterExpression.md @@ -0,0 +1,17 @@ +# # FilterExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | Required. Name of the field to use as the first operand in the filter expression. | [optional] +**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] +**hours_ago** | **string** | If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. | [optional] +**radius** | **float** | If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. | [optional] +**lat** | **float** | If `field` is `location`, this is *required* to specify the user's latitude. | [optional] +**long** | **float** | If `field` is `location`, this is *required* to specify the user's longitude. | [optional] +**relation** | **string** | Required. Operator of a filter expression. | [optional] +**operator** | **string** | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterExpressions.md b/docs/Model/FilterExpressions.md deleted file mode 100644 index d578254..0000000 --- a/docs/Model/FilterExpressions.md +++ /dev/null @@ -1,13 +0,0 @@ -# # 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** | **string** | Operator of a filter expression. | -**operator** | **string** | Strictly, this must be either `\"OR\"`, or `\"AND\"`. It can be used to compose Filters as part of a Filters object. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenericError.md b/docs/Model/GenericError.md index b39c9f4..ec1d1c3 100644 --- a/docs/Model/GenericError.md +++ b/docs/Model/GenericError.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | [**\onesignal\client\model\GenericErrorErrorsInner[]**](GenericErrorErrorsInner.md) | | [optional] +**errors** | **mixed** | | [optional] +**success** | **bool** | | [optional] +**reference** | **mixed** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeletePlayerSuccessResponse.md b/docs/Model/GenericSuccessBoolResponse.md similarity index 89% rename from docs/Model/DeletePlayerSuccessResponse.md rename to docs/Model/GenericSuccessBoolResponse.md index c3f13d3..4ae2458 100644 --- a/docs/Model/DeletePlayerSuccessResponse.md +++ b/docs/Model/GenericSuccessBoolResponse.md @@ -1,4 +1,4 @@ -# # DeletePlayerSuccessResponse +# # GenericSuccessBoolResponse ## Properties diff --git a/docs/Model/GetNotificationRequestBody.md b/docs/Model/GetNotificationHistoryRequestBody.md similarity index 95% rename from docs/Model/GetNotificationRequestBody.md rename to docs/Model/GetNotificationHistoryRequestBody.md index fb94805..18455c1 100644 --- a/docs/Model/GetNotificationRequestBody.md +++ b/docs/Model/GetNotificationHistoryRequestBody.md @@ -1,4 +1,4 @@ -# # GetNotificationRequestBody +# # GetNotificationHistoryRequestBody ## Properties diff --git a/docs/Model/GetSegmentsSuccessResponse.md b/docs/Model/GetSegmentsSuccessResponse.md new file mode 100644 index 0000000..7828a45 --- /dev/null +++ b/docs/Model/GetSegmentsSuccessResponse.md @@ -0,0 +1,12 @@ +# # GetSegmentsSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_count** | **int** | The number of Segments in the response. | [optional] +**offset** | **int** | Set with the offset query parameter. Default 0. | [optional] +**limit** | **int** | Maximum number of Segments returned. Default 300. | [optional] +**segments** | [**\onesignal\client\model\SegmentData[]**](SegmentData.md) | An array containing the Segment information. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse200.md b/docs/Model/InlineResponse200.md deleted file mode 100644 index e2f13c4..0000000 --- a/docs/Model/InlineResponse200.md +++ /dev/null @@ -1,9 +0,0 @@ -# # InlineResponse200 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | **array** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse2003.md b/docs/Model/InlineResponse2003.md deleted file mode 100644 index ed397dd..0000000 --- a/docs/Model/InlineResponse2003.md +++ /dev/null @@ -1,9 +0,0 @@ -# # InlineResponse2003 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**in_app_messages** | **object[]** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse201.md b/docs/Model/InlineResponse201.md deleted file mode 100644 index 7b4a90f..0000000 --- a/docs/Model/InlineResponse201.md +++ /dev/null @@ -1,9 +0,0 @@ -# # InlineResponse201 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subscription** | [**\onesignal\client\model\SubscriptionObject**](SubscriptionObject.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InvalidIdentifierError.md b/docs/Model/InvalidIdentifierError.md deleted file mode 100644 index 83af621..0000000 --- a/docs/Model/InvalidIdentifierError.md +++ /dev/null @@ -1,10 +0,0 @@ -# # InvalidIdentifierError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invalid_external_user_ids** | **string[]** | Returned if using include_external_user_ids | [optional] -**invalid_player_ids** | **string[]** | Returned if using include_player_ids and some were valid and others were not. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StringMap.md b/docs/Model/LanguageStringMap.md similarity index 99% rename from docs/Model/StringMap.md rename to docs/Model/LanguageStringMap.md index 66aa509..dfc9726 100644 --- a/docs/Model/StringMap.md +++ b/docs/Model/LanguageStringMap.md @@ -1,4 +1,4 @@ -# # StringMap +# # LanguageStringMap ## Properties diff --git a/docs/Model/Notification.md b/docs/Model/Notification.md index a7945f4..9127a4c 100644 --- a/docs/Model/Notification.md +++ b/docs/Model/Notification.md @@ -6,17 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **included_segments** | **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] **excluded_segments** | **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] -**include_player_ids** | **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] -**include_external_user_ids** | **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] +**include_subscription_ids** | **string[]** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] **include_email_tokens** | **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] **include_phone_numbers** | **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] -**include_ios_tokens** | **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] -**include_wp_wns_uris** | **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] -**include_amazon_reg_ids** | **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] -**include_chrome_reg_ids** | **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] -**include_chrome_web_reg_ids** | **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] -**include_android_reg_ids** | **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] -**include_aliases** | [**\onesignal\client\model\PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**include_ios_tokens** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_wp_wns_uris** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_amazon_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_web_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_android_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_aliases** | **array** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] **target_channel** | **string** | | [optional] **id** | **string** | | [optional] **value** | **int** | | [optional] [readonly] @@ -32,13 +31,12 @@ Name | Type | Description | Notes **is_wp_wns** | **bool** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] **is_adm** | **bool** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] **is_chrome** | **bool** | 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] -**channel_for_external_user_ids** | **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] **app_id** | **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. | **external_id** | **string** | [DEPRECATED] 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] **idempotency_key** | **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] -**contents** | [**StringMap**](StringMap.md) | | [optional] -**headings** | [**StringMap**](StringMap.md) | | [optional] -**subtitle** | [**StringMap**](StringMap.md) | | [optional] +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**subtitle** | [**LanguageStringMap**](LanguageStringMap.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] **huawei_msg_type** | **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] @@ -55,7 +53,7 @@ Name | Type | Description | Notes **chrome_big_picture** | **string** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] **chrome_web_image** | **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** | [**\onesignal\client\model\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] -**web_buttons** | [**\onesignal\client\model\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] +**web_buttons** | [**\onesignal\client\model\WebButton[]**](WebButton.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] **ios_category** | **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] **android_channel_id** | **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] **huawei_channel_id** | **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] @@ -101,6 +99,8 @@ Name | Type | Description | Notes **thread_id** | **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] **summary_arg** | **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] **summary_arg_count** | **int** | 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] +**ios_relevance_score** | **float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] +**ios_interruption_level** | **string** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] **email_subject** | **string** | Channel: Email Required. The subject of the email. | [optional] **email_body** | **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] **email_from_name** | **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] @@ -109,7 +109,7 @@ Name | Type | Description | Notes **include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] **sms_from** | **string** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] **sms_media_urls** | **string[]** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] -**filters** | [**\onesignal\client\model\Filter[]**](Filter.md) | | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | | [optional] **custom_data** | **object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] **send_after** | **\DateTime** | 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] diff --git a/docs/Model/Notification200Errors.md b/docs/Model/Notification200Errors.md deleted file mode 100644 index f0fabd7..0000000 --- a/docs/Model/Notification200Errors.md +++ /dev/null @@ -1,10 +0,0 @@ -# # Notification200Errors - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invalid_external_user_ids** | **string[]** | Returned if using include_external_user_ids | [optional] -**invalid_player_ids** | **string[]** | Returned if using include_player_ids and some were valid and others were not. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NotificationTarget.md b/docs/Model/NotificationTarget.md index 81045c8..4bffb27 100644 --- a/docs/Model/NotificationTarget.md +++ b/docs/Model/NotificationTarget.md @@ -6,17 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **included_segments** | **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] **excluded_segments** | **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] -**include_player_ids** | **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] -**include_external_user_ids** | **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] +**include_subscription_ids** | **string[]** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] **include_email_tokens** | **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] **include_phone_numbers** | **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] -**include_ios_tokens** | **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] -**include_wp_wns_uris** | **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] -**include_amazon_reg_ids** | **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] -**include_chrome_reg_ids** | **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] -**include_chrome_web_reg_ids** | **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] -**include_android_reg_ids** | **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] -**include_aliases** | [**\onesignal\client\model\PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**include_ios_tokens** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_wp_wns_uris** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_amazon_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_web_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_android_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_aliases** | **array** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] **target_channel** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NotificationWithMeta.md b/docs/Model/NotificationWithMeta.md index 4f3a8df..d72c645 100644 --- a/docs/Model/NotificationWithMeta.md +++ b/docs/Model/NotificationWithMeta.md @@ -6,17 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **included_segments** | **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] **excluded_segments** | **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] -**include_player_ids** | **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] -**include_external_user_ids** | **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] +**include_subscription_ids** | **string[]** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] **include_email_tokens** | **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] **include_phone_numbers** | **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] -**include_ios_tokens** | **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] -**include_wp_wns_uris** | **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] -**include_amazon_reg_ids** | **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] -**include_chrome_reg_ids** | **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] -**include_chrome_web_reg_ids** | **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] -**include_android_reg_ids** | **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] -**include_aliases** | [**\onesignal\client\model\PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**include_ios_tokens** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_wp_wns_uris** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_amazon_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_web_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_android_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_aliases** | **array** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] **target_channel** | **string** | | [optional] **id** | **string** | | [optional] **value** | **int** | | [optional] [readonly] @@ -32,13 +31,12 @@ Name | Type | Description | Notes **is_wp_wns** | **bool** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] **is_adm** | **bool** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] **is_chrome** | **bool** | 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] -**channel_for_external_user_ids** | **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] **app_id** | **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. | **external_id** | **string** | [DEPRECATED] 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] **idempotency_key** | **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] -**contents** | [**StringMap**](StringMap.md) | | [optional] -**headings** | [**StringMap**](StringMap.md) | | [optional] -**subtitle** | [**StringMap**](StringMap.md) | | [optional] +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**subtitle** | [**LanguageStringMap**](LanguageStringMap.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] **huawei_msg_type** | **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] @@ -55,7 +53,7 @@ Name | Type | Description | Notes **chrome_big_picture** | **string** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] **chrome_web_image** | **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** | [**\onesignal\client\model\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] -**web_buttons** | [**\onesignal\client\model\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] +**web_buttons** | [**\onesignal\client\model\WebButton[]**](WebButton.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] **ios_category** | **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] **android_channel_id** | **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] **huawei_channel_id** | **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] @@ -101,6 +99,8 @@ Name | Type | Description | Notes **thread_id** | **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] **summary_arg** | **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] **summary_arg_count** | **int** | 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] +**ios_relevance_score** | **float** | Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. | [optional] +**ios_interruption_level** | **string** | Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. | [optional] **email_subject** | **string** | Channel: Email Required. The subject of the email. | [optional] **email_body** | **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] **email_from_name** | **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] @@ -109,7 +109,7 @@ Name | Type | Description | Notes **include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional] **sms_from** | **string** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] **sms_media_urls** | **string[]** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] -**filters** | [**\onesignal\client\model\Filter[]**](Filter.md) | | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | | [optional] **custom_data** | **object** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional] **successful** | **int** | Number of notifications that were successfully delivered. | [optional] **failed** | **int** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional] diff --git a/docs/Model/Player.md b/docs/Model/Player.md deleted file mode 100644 index c17c853..0000000 --- a/docs/Model/Player.md +++ /dev/null @@ -1,35 +0,0 @@ -# # Player - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The device's OneSignal ID | [optional] [readonly] -**invalid_identifier** | **bool** | If true, this is the equivalent of a user being Unsubscribed | [optional] [readonly] -**app_id** | **string** | | [optional] -**device_type** | **int** | 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 | -**external_user_id** | **string** | a custom user ID | [optional] -**external_user_id_auth_hash** | **string** | Only required if you have enabled Identity Verification and device_type is NOT 11 email. | [optional] -**email_auth_hash** | **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** | **int** | Number of seconds away from UTC. Example: -28800 | [optional] -**game_version** | **string** | Version of your app. Example: 1.1 | [optional] -**device_model** | **string** | Device make and model. Example: iPhone5,1 | [optional] -**device_os** | **string** | Device operating system version. Example: 7.0.4 | [optional] -**ad_id** | **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] -**session_count** | **int** | 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] -**amount_spent** | **float** | Amount the user has spent in USD, up to two decimal places | [optional] -**created_at** | **int** | Unixtime when the player joined the game | [optional] -**playtime** | **int** | Seconds player was running your app. | [optional] -**badge_count** | **int** | 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] -**last_active** | **int** | Unixtime when the player was last active | [optional] -**notification_types** | **int** | 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] -**test_type** | **int** | 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** | **float** | Longitude of the device, used for geotagging to segment on. | [optional] -**lat** | **float** | Latitude of the device, used for geotagging to segment on. | [optional] -**country** | **string** | Country code in the ISO 3166-1 Alpha 2 format | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PlayerNotificationTarget.md b/docs/Model/PlayerNotificationTarget.md deleted file mode 100644 index 88efbaa..0000000 --- a/docs/Model/PlayerNotificationTarget.md +++ /dev/null @@ -1,20 +0,0 @@ -# # PlayerNotificationTarget - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**include_player_ids** | **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] -**include_external_user_ids** | **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] -**include_email_tokens** | **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] -**include_phone_numbers** | **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] -**include_ios_tokens** | **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] -**include_wp_wns_uris** | **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] -**include_amazon_reg_ids** | **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] -**include_chrome_reg_ids** | **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] -**include_chrome_web_reg_ids** | **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] -**include_android_reg_ids** | **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] -**include_aliases** | [**\onesignal\client\model\PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] -**target_channel** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PlayerNotificationTargetIncludeAliases.md b/docs/Model/PlayerNotificationTargetIncludeAliases.md deleted file mode 100644 index 9870448..0000000 --- a/docs/Model/PlayerNotificationTargetIncludeAliases.md +++ /dev/null @@ -1,9 +0,0 @@ -# # PlayerNotificationTargetIncludeAliases - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**alias_label** | **string[]** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PlayerSlice.md b/docs/Model/PlayerSlice.md deleted file mode 100644 index 2925bd4..0000000 --- a/docs/Model/PlayerSlice.md +++ /dev/null @@ -1,12 +0,0 @@ -# # PlayerSlice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | **int** | | [optional] -**offset** | **int** | | [optional] -**limit** | **int** | | [optional] -**players** | [**\onesignal\client\model\Player[]**](Player.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse202.md b/docs/Model/PropertiesBody.md similarity index 93% rename from docs/Model/InlineResponse202.md rename to docs/Model/PropertiesBody.md index f459608..039bd3a 100644 --- a/docs/Model/InlineResponse202.md +++ b/docs/Model/PropertiesBody.md @@ -1,4 +1,4 @@ -# # InlineResponse202 +# # PropertiesBody ## Properties diff --git a/docs/Model/PropertiesDeltas.md b/docs/Model/PropertiesDeltas.md index a44801a..f985eae 100644 --- a/docs/Model/PropertiesDeltas.md +++ b/docs/Model/PropertiesDeltas.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**session_time** | **float** | | [optional] -**session_count** | **float** | | [optional] +**session_time** | **int** | | [optional] +**session_count** | **int** | | [optional] **purchases** | [**\onesignal\client\model\Purchase[]**](Purchase.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PropertiesObject.md b/docs/Model/PropertiesObject.md index 72b0627..ce659e6 100644 --- a/docs/Model/PropertiesObject.md +++ b/docs/Model/PropertiesObject.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **lat** | **float** | | [optional] **long** | **float** | | [optional] **country** | **string** | | [optional] -**first_active** | **float** | | [optional] -**last_active** | **float** | | [optional] +**first_active** | **int** | | [optional] +**last_active** | **int** | | [optional] **amount_spent** | **float** | | [optional] **purchases** | [**\onesignal\client\model\Purchase[]**](Purchase.md) | | [optional] **ip** | **string** | | [optional] diff --git a/docs/Model/Purchase.md b/docs/Model/Purchase.md index d9c2742..351999c 100644 --- a/docs/Model/Purchase.md +++ b/docs/Model/Purchase.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes **sku** | **string** | The unique identifier of the purchased item. | **amount** | **string** | 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. | -**count** | **float** | | [optional] +**count** | **int** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BeginLiveActivityRequest.md b/docs/Model/RateLimitError.md similarity index 70% rename from docs/Model/BeginLiveActivityRequest.md rename to docs/Model/RateLimitError.md index 0ae783b..39d2963 100644 --- a/docs/Model/BeginLiveActivityRequest.md +++ b/docs/Model/RateLimitError.md @@ -1,10 +1,10 @@ -# # BeginLiveActivityRequest +# # RateLimitError ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**push_token** | **string** | | -**subscription_id** | **string** | | +**errors** | **string[]** | | [optional] +**limit** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Segment.md b/docs/Model/Segment.md index 4ea10b7..fd58519 100644 --- a/docs/Model/Segment.md +++ b/docs/Model/Segment.md @@ -6,6 +6,6 @@ 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** | [**\onesignal\client\model\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. | +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SegmentData.md b/docs/Model/SegmentData.md new file mode 100644 index 0000000..1ef469d --- /dev/null +++ b/docs/Model/SegmentData.md @@ -0,0 +1,15 @@ +# # SegmentData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The segment ID | [optional] +**name** | **string** | The segment name | [optional] +**created_at** | **string** | Date segment created | [optional] +**updated_at** | **string** | Date segment last updated | [optional] +**app_id** | **string** | The app id | [optional] +**read_only** | **bool** | Is the segment read only? | [optional] +**is_active** | **bool** | Is the segment active? | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionObject.md b/docs/Model/Subscription.md similarity index 74% rename from docs/Model/SubscriptionObject.md rename to docs/Model/Subscription.md index f23e436..522bd7b 100644 --- a/docs/Model/SubscriptionObject.md +++ b/docs/Model/Subscription.md @@ -1,4 +1,4 @@ -# # SubscriptionObject +# # Subscription ## Properties @@ -8,16 +8,16 @@ Name | Type | Description | Notes **type** | **string** | | [optional] **token** | **string** | | [optional] **enabled** | **bool** | | [optional] -**notification_types** | **float** | | [optional] -**session_time** | **float** | | [optional] -**session_count** | **float** | | [optional] +**notification_types** | **int** | | [optional] +**session_time** | **int** | | [optional] +**session_count** | **int** | | [optional] **sdk** | **string** | | [optional] **device_model** | **string** | | [optional] **device_os** | **string** | | [optional] **rooted** | **bool** | | [optional] -**test_type** | **float** | | [optional] +**test_type** | **int** | | [optional] **app_version** | **string** | | [optional] -**net_type** | **float** | | [optional] +**net_type** | **int** | | [optional] **carrier** | **string** | | [optional] **web_auth** | **string** | | [optional] **web_p256** | **string** | | [optional] diff --git a/docs/Model/CancelNotificationSuccessResponse.md b/docs/Model/SubscriptionBody.md similarity index 67% rename from docs/Model/CancelNotificationSuccessResponse.md rename to docs/Model/SubscriptionBody.md index fcd0065..14b2efc 100644 --- a/docs/Model/CancelNotificationSuccessResponse.md +++ b/docs/Model/SubscriptionBody.md @@ -1,9 +1,9 @@ -# # CancelNotificationSuccessResponse +# # SubscriptionBody ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] +**subscription** | [**\onesignal\client\model\Subscription**](Subscription.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionNotificationTarget.md b/docs/Model/SubscriptionNotificationTarget.md new file mode 100644 index 0000000..05814cd --- /dev/null +++ b/docs/Model/SubscriptionNotificationTarget.md @@ -0,0 +1,19 @@ +# # SubscriptionNotificationTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**include_subscription_ids** | **string[]** | Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] +**include_email_tokens** | **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] +**include_phone_numbers** | **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] +**include_ios_tokens** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_wp_wns_uris** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_amazon_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_chrome_web_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_android_reg_ids** | **string[]** | Not Recommended: Please consider using include_subscription_ids or include_aliases 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] +**include_aliases** | **array** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**target_channel** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransferSubscriptionRequestBody.md b/docs/Model/TransferSubscriptionRequestBody.md index 848070d..3ac629e 100644 --- a/docs/Model/TransferSubscriptionRequestBody.md +++ b/docs/Model/TransferSubscriptionRequestBody.md @@ -4,6 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**identity** | **array** | | [optional] +**identity** | **array** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateLiveActivityRequest.md b/docs/Model/UpdateLiveActivityRequest.md index f17262b..3f9da91 100644 --- a/docs/Model/UpdateLiveActivityRequest.md +++ b/docs/Model/UpdateLiveActivityRequest.md @@ -4,9 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Type of live activity | +**name** | **string** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | **event** | **string** | | -**event_updates** | **object** | | -**dismiss_at** | **float** | Timestamp; only allowed if event is \"end\" | [optional] +**event_updates** | **object** | This must match the ContentState interface you have defined within your Live Activity in your app. | +**contents** | [**\onesignal\client\model\LanguageStringMap**](LanguageStringMap.md) | | [optional] +**headings** | [**\onesignal\client\model\LanguageStringMap**](LanguageStringMap.md) | | [optional] +**sound** | **string** | Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. | [optional] +**stale_date** | **int** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] +**dismissal_date** | **int** | Accepts Unix timestamp in seconds; only allowed if event is \"end\" | [optional] +**priority** | **int** | Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateLiveActivitySuccessResponse.md b/docs/Model/UpdateLiveActivitySuccessResponse.md index bfd58ce..c7a4f7a 100644 --- a/docs/Model/UpdateLiveActivitySuccessResponse.md +++ b/docs/Model/UpdateLiveActivitySuccessResponse.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**notification_id** | **string** | | [optional] -**errors** | [**\onesignal\client\model\Notification200Errors**](Notification200Errors.md) | | [optional] +**id** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePlayerSuccessResponse.md b/docs/Model/UpdatePlayerSuccessResponse.md deleted file mode 100644 index a6cf59d..0000000 --- a/docs/Model/UpdatePlayerSuccessResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UpdatePlayerSuccessResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePlayerTagsRequestBody.md b/docs/Model/UpdatePlayerTagsRequestBody.md deleted file mode 100644 index e2f95c8..0000000 --- a/docs/Model/UpdatePlayerTagsRequestBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# # 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] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePlayerTagsSuccessResponse.md b/docs/Model/UpdatePlayerTagsSuccessResponse.md deleted file mode 100644 index 46749df..0000000 --- a/docs/Model/UpdatePlayerTagsSuccessResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UpdatePlayerTagsSuccessResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSubscriptionRequestBody.md b/docs/Model/UpdateSubscriptionRequestBody.md deleted file mode 100644 index 42c64ae..0000000 --- a/docs/Model/UpdateSubscriptionRequestBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UpdateSubscriptionRequestBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subscription** | [**\onesignal\client\model\SubscriptionObject**](SubscriptionObject.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/User.md b/docs/Model/User.md index 21e1843..b0d0e2b 100644 --- a/docs/Model/User.md +++ b/docs/Model/User.md @@ -5,8 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **properties** | [**\onesignal\client\model\PropertiesObject**](PropertiesObject.md) | | [optional] -**identity** | **array** | | [optional] -**subscriptions** | [**\onesignal\client\model\SubscriptionObject[]**](SubscriptionObject.md) | | [optional] -**subscription_options** | [**\onesignal\client\model\UserSubscriptionOptions**](UserSubscriptionOptions.md) | | [optional] +**identity** | **array** | | [optional] +**subscriptions** | [**\onesignal\client\model\Subscription[]**](Subscription.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteSegmentNotFoundResponse.md b/docs/Model/UserIdentityBody.md similarity index 75% rename from docs/Model/DeleteSegmentNotFoundResponse.md rename to docs/Model/UserIdentityBody.md index f65c241..cf50311 100644 --- a/docs/Model/DeleteSegmentNotFoundResponse.md +++ b/docs/Model/UserIdentityBody.md @@ -1,9 +1,9 @@ -# # DeleteSegmentNotFoundResponse +# # UserIdentityBody ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] +**identity** | **array** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserIdentityRequestBody.md b/docs/Model/UserIdentityRequestBody.md deleted file mode 100644 index 4272466..0000000 --- a/docs/Model/UserIdentityRequestBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UserIdentityRequestBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | **array** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserIdentityResponse.md b/docs/Model/UserIdentityResponse.md deleted file mode 100644 index a13d917..0000000 --- a/docs/Model/UserIdentityResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UserIdentityResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | **array** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserSubscriptionOptions.md b/docs/Model/UserSubscriptionOptions.md deleted file mode 100644 index 0d2341f..0000000 --- a/docs/Model/UserSubscriptionOptions.md +++ /dev/null @@ -1,9 +0,0 @@ -# # UserSubscriptionOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**retain_previous_owner** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreatePlayerSuccessResponse.md b/docs/Model/WebButton.md similarity index 61% rename from docs/Model/CreatePlayerSuccessResponse.md rename to docs/Model/WebButton.md index 85bd3e6..6c5465d 100644 --- a/docs/Model/CreatePlayerSuccessResponse.md +++ b/docs/Model/WebButton.md @@ -1,10 +1,12 @@ -# # CreatePlayerSuccessResponse +# # WebButton ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**success** | **bool** | | [optional] -**id** | **string** | | [optional] +**id** | **string** | | +**text** | **string** | | [optional] +**icon** | **string** | | [optional] +**url** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/ApiException.php b/lib/ApiException.php index a28b80a..18cd25e 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -14,7 +14,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/Configuration.php b/lib/Configuration.php index 3b7703d..4ffd71a 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -14,7 +14,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -59,18 +59,18 @@ class Configuration protected $apiKeyPrefixes = []; /** - * appKey access token for OAuth/Bearer authentication + * restApiKey access token for OAuth/Bearer authentication * * @var string */ - protected $appKeyToken = ''; + protected $restApiKeyToken = ''; /** - * userKey access token for OAuth/Bearer authentication + * userAuthKey access token for OAuth/Bearer authentication * * @var string */ - protected $userKeyToken = ''; + protected $userAuthKeyToken = ''; /** @@ -99,7 +99,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/2.2.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.0.0-beta1/PHP'; /** * Debug switch (default set to false) @@ -157,49 +157,49 @@ public function getApiKey($apiKeyIdentifier) } /** - * Sets the appKey access token for OAuth + * Sets the restApiKey access token for OAuth * * @param string $accessToken Token for OAuth * * @return $this */ - public function setAppKeyToken($accessToken) + public function setRestApiKeyToken($accessToken) { - $this->appKeyToken = $accessToken; + $this->restApiKeyToken = $accessToken; return $this; } /** - * Gets the appKey access token for OAuth + * Gets the restApiKey access token for OAuth * * @return string Access token for OAuth */ - public function getAppKeyToken() + public function getRestApiKeyToken() { - return $this->appKeyToken; + return $this->restApiKeyToken; } /** - * Sets the userKey access token for OAuth + * Sets the userAuthKey access token for OAuth * * @param string $accessToken Token for OAuth * * @return $this */ - public function setUserKeyToken($accessToken) + public function setUserAuthKeyToken($accessToken) { - $this->userKeyToken = $accessToken; + $this->userAuthKeyToken = $accessToken; return $this; } /** - * Gets the userKey access token for OAuth + * Gets the userAuthKey access token for OAuth * * @return string Access token for OAuth */ - public function getUserKeyToken() + public function getUserAuthKeyToken() { - return $this->userKeyToken; + return $this->userAuthKeyToken; } /** @@ -430,8 +430,8 @@ public static function toDebugReport() $report = 'PHP SDK (onesignal\client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 1.4.0' . PHP_EOL; - $report .= ' SDK Package Version: 2.2.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 5.0.1' . PHP_EOL; + $report .= ' SDK Package Version: 5.0.0-beta1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 64757a5..c0d08fa 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -14,7 +14,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index b2e230e..eae6247 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/api/DefaultApi.php b/lib/api/DefaultApi.php index 51cf133..4df7beb 100644 --- a/lib/api/DefaultApi.php +++ b/lib/api/DefaultApi.php @@ -14,7 +14,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -117,39 +117,38 @@ public function getConfig() } /** - * Operation beginLiveActivity + * Operation cancelNotification * - * Start Live Activity + * Stop a scheduled or currently outgoing notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\BeginLiveActivityRequest $begin_live_activity_request begin_live_activity_request (required) + * @param string $app_id app_id (required) + * @param string $notification_id notification_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function beginLiveActivity($app_id, $activity_id, $begin_live_activity_request) + public function cancelNotification($app_id, $notification_id) { - $this->beginLiveActivityWithHttpInfo($app_id, $activity_id, $begin_live_activity_request); + list($response) = $this->cancelNotificationWithHttpInfo($app_id, $notification_id); + return $response; } /** - * Operation beginLiveActivityWithHttpInfo + * Operation cancelNotificationWithHttpInfo * - * Start Live Activity + * Stop a scheduled or currently outgoing notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\BeginLiveActivityRequest $begin_live_activity_request (required) + * @param string $app_id (required) + * @param string $notification_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function beginLiveActivityWithHttpInfo($app_id, $activity_id, $begin_live_activity_request) + public function cancelNotificationWithHttpInfo($app_id, $notification_id) { - $request = $this->beginLiveActivityRequest($app_id, $activity_id, $begin_live_activity_request); + $request = $this->cancelNotificationRequest($app_id, $notification_id); try { $options = $this->createHttpClientOption(); @@ -186,10 +185,95 @@ public function beginLiveActivityWithHttpInfo($app_id, $activity_id, $begin_live ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericSuccessBoolResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -198,10 +282,18 @@ public function beginLiveActivityWithHttpInfo($app_id, $activity_id, $begin_live ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -212,20 +304,19 @@ public function beginLiveActivityWithHttpInfo($app_id, $activity_id, $begin_live } /** - * Operation beginLiveActivityAsync + * Operation cancelNotificationAsync * - * Start Live Activity + * Stop a scheduled or currently outgoing notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\BeginLiveActivityRequest $begin_live_activity_request (required) + * @param string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function beginLiveActivityAsync($app_id, $activity_id, $begin_live_activity_request) + public function cancelNotificationAsync($app_id, $notification_id) { - return $this->beginLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $begin_live_activity_request) + return $this->cancelNotificationAsyncWithHttpInfo($app_id, $notification_id) ->then( function ($response) { return $response[0]; @@ -234,27 +325,39 @@ function ($response) { } /** - * Operation beginLiveActivityAsyncWithHttpInfo + * Operation cancelNotificationAsyncWithHttpInfo * - * Start Live Activity + * Stop a scheduled or currently outgoing notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\BeginLiveActivityRequest $begin_live_activity_request (required) + * @param string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function beginLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $begin_live_activity_request) + public function cancelNotificationAsyncWithHttpInfo($app_id, $notification_id) { - $returnType = ''; - $request = $this->beginLiveActivityRequest($app_id, $activity_id, $begin_live_activity_request); + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + $request = $this->cancelNotificationRequest($app_id, $notification_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -274,58 +377,52 @@ function ($exception) { } /** - * Create request for operation 'beginLiveActivity' + * Create request for operation 'cancelNotification' * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\BeginLiveActivityRequest $begin_live_activity_request (required) + * @param string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_activity_request) + public function cancelNotificationRequest($app_id, $notification_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling beginLiveActivity' - ); - } - // verify the required parameter 'activity_id' is set - if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $activity_id when calling beginLiveActivity' + 'Missing the required parameter $app_id when calling cancelNotification' ); } - // verify the required parameter 'begin_live_activity_request' is set - if ($begin_live_activity_request === null || (is_array($begin_live_activity_request) && count($begin_live_activity_request) === 0)) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $begin_live_activity_request when calling beginLiveActivity' + 'Missing the required parameter $notification_id when calling cancelNotification' ); } - $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/token'; + $resourcePath = '/notifications/{notification_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $app_id, + 'app_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($activity_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'activity_id' . '}', - ObjectSerializer::toPathValue($activity_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -338,18 +435,12 @@ public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_acti } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($begin_live_activity_request)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($begin_live_activity_request)); - } else { - $httpBody = $begin_live_activity_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -373,8 +464,8 @@ public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_acti } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -383,7 +474,7 @@ public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_acti } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -393,7 +484,7 @@ public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_acti $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -401,38 +492,38 @@ public function beginLiveActivityRequest($app_id, $activity_id, $begin_live_acti } /** - * Operation cancelNotification - * - * Stop a scheduled or currently outgoing notification + * Operation createAlias * * @param string $app_id app_id (required) - * @param string $notification_id notification_id (required) + * @param string $alias_label alias_label (required) + * @param string $alias_id alias_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body user_identity_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CancelNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function cancelNotification($app_id, $notification_id) + public function createAlias($app_id, $alias_label, $alias_id, $user_identity_body) { - list($response) = $this->cancelNotificationWithHttpInfo($app_id, $notification_id); + list($response) = $this->createAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_body); return $response; } /** - * Operation cancelNotificationWithHttpInfo - * - * Stop a scheduled or currently outgoing notification + * Operation createAliasWithHttpInfo * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CancelNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function cancelNotificationWithHttpInfo($app_id, $notification_id) + public function createAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_body) { - $request = $this->cancelNotificationRequest($app_id, $notification_id); + $request = $this->createAliasRequest($app_id, $alias_label, $alias_id, $user_identity_body); try { $options = $this->createHttpClientOption(); @@ -471,17 +562,17 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\CancelNotificationSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\CancelNotificationSuccessResponse' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\CancelNotificationSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -495,29 +586,59 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\CancelNotificationSuccessResponse'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -538,7 +659,7 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\CancelNotificationSuccessResponse', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -551,10 +672,26 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -565,19 +702,19 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) } /** - * Operation cancelNotificationAsync - * - * Stop a scheduled or currently outgoing notification + * Operation createAliasAsync * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function cancelNotificationAsync($app_id, $notification_id) + public function createAliasAsync($app_id, $alias_label, $alias_id, $user_identity_body) { - return $this->cancelNotificationAsyncWithHttpInfo($app_id, $notification_id) + return $this->createAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_body) ->then( function ($response) { return $response[0]; @@ -586,20 +723,20 @@ function ($response) { } /** - * Operation cancelNotificationAsyncWithHttpInfo - * - * Stop a scheduled or currently outgoing notification + * Operation createAliasAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function cancelNotificationAsyncWithHttpInfo($app_id, $notification_id) + public function createAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_body) { - $returnType = '\onesignal\client\model\CancelNotificationSuccessResponse'; - $request = $this->cancelNotificationRequest($app_id, $notification_id); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->createAliasRequest($app_id, $alias_label, $alias_id, $user_identity_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -638,52 +775,73 @@ function ($exception) { } /** - * Create request for operation 'cancelNotification' + * Create request for operation 'createAlias' * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function cancelNotificationRequest($app_id, $notification_id) + public function createAliasRequest($app_id, $alias_label, $alias_id, $user_identity_body) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling cancelNotification' + 'Missing the required parameter $app_id when calling createAlias' ); } - // verify the required parameter 'notification_id' is set - if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { + // verify the required parameter 'alias_label' is set + if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notification_id when calling cancelNotification' + 'Missing the required parameter $alias_label when calling createAlias' + ); + } + // verify the required parameter 'alias_id' is set + if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_id when calling createAlias' + ); + } + // verify the required parameter 'user_identity_body' is set + if ($user_identity_body === null || (is_array($user_identity_body) && count($user_identity_body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_identity_body when calling createAlias' ); } - $resourcePath = '/notifications/{notification_id}'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params - if ($notification_id !== null) { + if ($app_id !== null) { $resourcePath = str_replace( - '{' . 'notification_id' . '}', - ObjectSerializer::toPathValue($notification_id), + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } + // path params + if ($alias_label !== null) { + $resourcePath = str_replace( + '{' . 'alias_label' . '}', + ObjectSerializer::toPathValue($alias_label), + $resourcePath + ); + } + // path params + if ($alias_id !== null) { + $resourcePath = str_replace( + '{' . 'alias_id' . '}', + ObjectSerializer::toPathValue($alias_id), $resourcePath ); } @@ -696,12 +854,18 @@ public function cancelNotificationRequest($app_id, $notification_id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($user_identity_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user_identity_body)); + } else { + $httpBody = $user_identity_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -725,8 +889,8 @@ public function cancelNotificationRequest($app_id, $notification_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -735,7 +899,7 @@ public function cancelNotificationRequest($app_id, $notification_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -745,7 +909,7 @@ public function cancelNotificationRequest($app_id, $notification_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -753,36 +917,36 @@ public function cancelNotificationRequest($app_id, $notification_id) } /** - * Operation createApp - * - * Create an app + * Operation createAliasBySubscription * - * @param \onesignal\client\model\App $app app (required) + * @param string $app_id app_id (required) + * @param string $subscription_id subscription_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body user_identity_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function createApp($app) + public function createAliasBySubscription($app_id, $subscription_id, $user_identity_body) { - list($response) = $this->createAppWithHttpInfo($app); + list($response) = $this->createAliasBySubscriptionWithHttpInfo($app_id, $subscription_id, $user_identity_body); return $response; } /** - * Operation createAppWithHttpInfo - * - * Create an app + * Operation createAliasBySubscriptionWithHttpInfo * - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function createAppWithHttpInfo($app) + public function createAliasBySubscriptionWithHttpInfo($app_id, $subscription_id, $user_identity_body) { - $request = $this->createAppRequest($app); + $request = $this->createAliasBySubscriptionRequest($app_id, $subscription_id, $user_identity_body); try { $options = $this->createHttpClientOption(); @@ -821,17 +985,17 @@ public function createAppWithHttpInfo($app) switch($statusCode) { case 200: - if ('\onesignal\client\model\App' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\App' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -845,29 +1009,59 @@ public function createAppWithHttpInfo($app) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\App'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -888,7 +1082,7 @@ public function createAppWithHttpInfo($app) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\App', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -901,10 +1095,26 @@ public function createAppWithHttpInfo($app) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -915,18 +1125,18 @@ public function createAppWithHttpInfo($app) } /** - * Operation createAppAsync - * - * Create an app + * Operation createAliasBySubscriptionAsync * - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAppAsync($app) + public function createAliasBySubscriptionAsync($app_id, $subscription_id, $user_identity_body) { - return $this->createAppAsyncWithHttpInfo($app) + return $this->createAliasBySubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $user_identity_body) ->then( function ($response) { return $response[0]; @@ -935,19 +1145,19 @@ function ($response) { } /** - * Operation createAppAsyncWithHttpInfo - * - * Create an app + * Operation createAliasBySubscriptionAsyncWithHttpInfo * - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAppAsyncWithHttpInfo($app) + public function createAliasBySubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $user_identity_body) { - $returnType = '\onesignal\client\model\App'; - $request = $this->createAppRequest($app); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->createAliasBySubscriptionRequest($app_id, $subscription_id, $user_identity_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -986,23 +1196,37 @@ function ($exception) { } /** - * Create request for operation 'createApp' + * Create request for operation 'createAliasBySubscription' * - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\UserIdentityBody $user_identity_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createAppRequest($app) + public function createAliasBySubscriptionRequest($app_id, $subscription_id, $user_identity_body) { - // verify the required parameter 'app' is set - if ($app === null || (is_array($app) && count($app) === 0)) { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app when calling createApp' + 'Missing the required parameter $app_id when calling createAliasBySubscription' + ); + } + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_id when calling createAliasBySubscription' + ); + } + // verify the required parameter 'user_identity_body' is set + if ($user_identity_body === null || (is_array($user_identity_body) && count($user_identity_body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_identity_body when calling createAliasBySubscription' ); } - $resourcePath = '/apps'; + $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1011,6 +1235,22 @@ public function createAppRequest($app) + // path params + if ($app_id !== null) { + $resourcePath = str_replace( + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } if ($multipart) { @@ -1025,11 +1265,11 @@ public function createAppRequest($app) } // for model (json/xml) - if (isset($app)) { + if (isset($user_identity_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user_identity_body)); } else { - $httpBody = $app; + $httpBody = $user_identity_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1055,8 +1295,8 @@ public function createAppRequest($app) } } - if (!empty($this->config->getUserKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getUserKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -1065,7 +1305,7 @@ public function createAppRequest($app) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -1075,7 +1315,7 @@ public function createAppRequest($app) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1083,36 +1323,36 @@ public function createAppRequest($app) } /** - * Operation createNotification + * Operation createApp * - * Create notification + * Create an app * - * @param \onesignal\client\model\Notification $notification notification (required) + * @param \onesignal\client\model\App $app app (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function createNotification($notification) + public function createApp($app) { - list($response) = $this->createNotificationWithHttpInfo($notification); + list($response) = $this->createAppWithHttpInfo($app); return $response; } /** - * Operation createNotificationWithHttpInfo + * Operation createAppWithHttpInfo * - * Create notification + * Create an app * - * @param \onesignal\client\model\Notification $notification (required) + * @param \onesignal\client\model\App $app (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function createNotificationWithHttpInfo($notification) + public function createAppWithHttpInfo($app) { - $request = $this->createNotificationRequest($notification); + $request = $this->createAppRequest($app); try { $options = $this->createHttpClientOption(); @@ -1151,17 +1391,17 @@ public function createNotificationWithHttpInfo($notification) switch($statusCode) { case 200: - if ('\onesignal\client\model\CreateNotificationSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\App' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\CreateNotificationSuccessResponse' !== 'string') { + if ('\onesignal\client\model\App' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\CreateNotificationSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1181,23 +1421,23 @@ public function createNotificationWithHttpInfo($notification) $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\CreateNotificationSuccessResponse'; + $returnType = '\onesignal\client\model\App'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1218,7 +1458,7 @@ public function createNotificationWithHttpInfo($notification) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\CreateNotificationSuccessResponse', + '\onesignal\client\model\App', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1234,7 +1474,7 @@ public function createNotificationWithHttpInfo($notification) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1245,18 +1485,18 @@ public function createNotificationWithHttpInfo($notification) } /** - * Operation createNotificationAsync + * Operation createAppAsync * - * Create notification + * Create an app * - * @param \onesignal\client\model\Notification $notification (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createNotificationAsync($notification) + public function createAppAsync($app) { - return $this->createNotificationAsyncWithHttpInfo($notification) + return $this->createAppAsyncWithHttpInfo($app) ->then( function ($response) { return $response[0]; @@ -1265,19 +1505,19 @@ function ($response) { } /** - * Operation createNotificationAsyncWithHttpInfo + * Operation createAppAsyncWithHttpInfo * - * Create notification + * Create an app * - * @param \onesignal\client\model\Notification $notification (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createNotificationAsyncWithHttpInfo($notification) + public function createAppAsyncWithHttpInfo($app) { - $returnType = '\onesignal\client\model\CreateNotificationSuccessResponse'; - $request = $this->createNotificationRequest($notification); + $returnType = '\onesignal\client\model\App'; + $request = $this->createAppRequest($app); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1316,23 +1556,23 @@ function ($exception) { } /** - * Create request for operation 'createNotification' + * Create request for operation 'createApp' * - * @param \onesignal\client\model\Notification $notification (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createNotificationRequest($notification) + public function createAppRequest($app) { - // verify the required parameter 'notification' is set - if ($notification === null || (is_array($notification) && count($notification) === 0)) { + // verify the required parameter 'app' is set + if ($app === null || (is_array($app) && count($app) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notification when calling createNotification' + 'Missing the required parameter $app when calling createApp' ); } - $resourcePath = '/notifications'; + $resourcePath = '/apps'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1355,11 +1595,11 @@ public function createNotificationRequest($notification) } // for model (json/xml) - if (isset($notification)) { + if (isset($app)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($notification)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); } else { - $httpBody = $notification; + $httpBody = $app; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1385,8 +1625,8 @@ public function createNotificationRequest($notification) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getUserAuthKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getUserAuthKeyToken(); } $defaultHeaders = []; @@ -1395,7 +1635,7 @@ public function createNotificationRequest($notification) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -1413,36 +1653,36 @@ public function createNotificationRequest($notification) } /** - * Operation createPlayer + * Operation createNotification * - * Add a device + * Create notification * - * @param \onesignal\client\model\Player $player player (required) + * @param \onesignal\client\model\Notification $notification notification (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreatePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function createPlayer($player) + public function createNotification($notification) { - list($response) = $this->createPlayerWithHttpInfo($player); + list($response) = $this->createNotificationWithHttpInfo($notification); return $response; } /** - * Operation createPlayerWithHttpInfo + * Operation createNotificationWithHttpInfo * - * Add a device + * Create notification * - * @param \onesignal\client\model\Player $player (required) + * @param \onesignal\client\model\Notification $notification (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreatePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function createPlayerWithHttpInfo($player) + public function createNotificationWithHttpInfo($notification) { - $request = $this->createPlayerRequest($player); + $request = $this->createNotificationRequest($notification); try { $options = $this->createHttpClientOption(); @@ -1481,17 +1721,17 @@ public function createPlayerWithHttpInfo($player) switch($statusCode) { case 200: - if ('\onesignal\client\model\CreatePlayerSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\CreateNotificationSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\CreatePlayerSuccessResponse' !== 'string') { + if ('\onesignal\client\model\CreateNotificationSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\CreatePlayerSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\CreateNotificationSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1505,44 +1745,29 @@ public function createPlayerWithHttpInfo($player) } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\CreatePlayerSuccessResponse'; + $returnType = '\onesignal\client\model\CreateNotificationSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1563,7 +1788,7 @@ public function createPlayerWithHttpInfo($player) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\CreatePlayerSuccessResponse', + '\onesignal\client\model\CreateNotificationSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1576,18 +1801,10 @@ public function createPlayerWithHttpInfo($player) ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1598,18 +1815,18 @@ public function createPlayerWithHttpInfo($player) } /** - * Operation createPlayerAsync + * Operation createNotificationAsync * - * Add a device + * Create notification * - * @param \onesignal\client\model\Player $player (required) + * @param \onesignal\client\model\Notification $notification (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPlayerAsync($player) + public function createNotificationAsync($notification) { - return $this->createPlayerAsyncWithHttpInfo($player) + return $this->createNotificationAsyncWithHttpInfo($notification) ->then( function ($response) { return $response[0]; @@ -1618,19 +1835,19 @@ function ($response) { } /** - * Operation createPlayerAsyncWithHttpInfo + * Operation createNotificationAsyncWithHttpInfo * - * Add a device + * Create notification * - * @param \onesignal\client\model\Player $player (required) + * @param \onesignal\client\model\Notification $notification (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPlayerAsyncWithHttpInfo($player) + public function createNotificationAsyncWithHttpInfo($notification) { - $returnType = '\onesignal\client\model\CreatePlayerSuccessResponse'; - $request = $this->createPlayerRequest($player); + $returnType = '\onesignal\client\model\CreateNotificationSuccessResponse'; + $request = $this->createNotificationRequest($notification); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1669,23 +1886,23 @@ function ($exception) { } /** - * Create request for operation 'createPlayer' + * Create request for operation 'createNotification' * - * @param \onesignal\client\model\Player $player (required) + * @param \onesignal\client\model\Notification $notification (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPlayerRequest($player) + public function createNotificationRequest($notification) { - // verify the required parameter 'player' is set - if ($player === null || (is_array($player) && count($player) === 0)) { + // verify the required parameter 'notification' is set + if ($notification === null || (is_array($notification) && count($notification) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $player when calling createPlayer' + 'Missing the required parameter $notification when calling createNotification' ); } - $resourcePath = '/players'; + $resourcePath = '/notifications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1708,11 +1925,11 @@ public function createPlayerRequest($player) } // for model (json/xml) - if (isset($player)) { + if (isset($notification)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($player)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($notification)); } else { - $httpBody = $player; + $httpBody = $notification; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1738,8 +1955,8 @@ public function createPlayerRequest($player) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -1748,7 +1965,7 @@ public function createPlayerRequest($player) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -1766,38 +1983,38 @@ public function createPlayerRequest($player) } /** - * Operation createSegments + * Operation createSegment * - * Create Segments + * Create Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param \onesignal\client\model\Segment $segment segment (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError */ - public function createSegments($app_id, $segment = null) + public function createSegment($app_id, $segment = null) { - list($response) = $this->createSegmentsWithHttpInfo($app_id, $segment); + list($response) = $this->createSegmentWithHttpInfo($app_id, $segment); return $response; } /** - * Operation createSegmentsWithHttpInfo + * Operation createSegmentWithHttpInfo * - * Create Segments + * Create Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param \onesignal\client\model\Segment $segment (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function createSegmentsWithHttpInfo($app_id, $segment = null) + public function createSegmentWithHttpInfo($app_id, $segment = null) { - $request = $this->createSegmentsRequest($app_id, $segment); + $request = $this->createSegmentRequest($app_id, $segment); try { $options = $this->createHttpClientOption(); @@ -1881,17 +2098,17 @@ public function createSegmentsWithHttpInfo($app_id, $segment = null) $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1942,7 +2159,7 @@ public function createSegmentsWithHttpInfo($app_id, $segment = null) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1953,9 +2170,9 @@ public function createSegmentsWithHttpInfo($app_id, $segment = null) } /** - * Operation createSegmentsAsync + * Operation createSegmentAsync * - * Create Segments + * Create Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param \onesignal\client\model\Segment $segment (optional) @@ -1963,9 +2180,9 @@ public function createSegmentsWithHttpInfo($app_id, $segment = null) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSegmentsAsync($app_id, $segment = null) + public function createSegmentAsync($app_id, $segment = null) { - return $this->createSegmentsAsyncWithHttpInfo($app_id, $segment) + return $this->createSegmentAsyncWithHttpInfo($app_id, $segment) ->then( function ($response) { return $response[0]; @@ -1974,9 +2191,9 @@ function ($response) { } /** - * Operation createSegmentsAsyncWithHttpInfo + * Operation createSegmentAsyncWithHttpInfo * - * Create Segments + * Create Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param \onesignal\client\model\Segment $segment (optional) @@ -1984,10 +2201,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSegmentsAsyncWithHttpInfo($app_id, $segment = null) + public function createSegmentAsyncWithHttpInfo($app_id, $segment = null) { $returnType = '\onesignal\client\model\CreateSegmentSuccessResponse'; - $request = $this->createSegmentsRequest($app_id, $segment); + $request = $this->createSegmentRequest($app_id, $segment); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2026,7 +2243,7 @@ function ($exception) { } /** - * Create request for operation 'createSegments' + * Create request for operation 'createSegment' * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) * @param \onesignal\client\model\Segment $segment (optional) @@ -2034,12 +2251,12 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createSegmentsRequest($app_id, $segment = null) + public function createSegmentRequest($app_id, $segment = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling createSegments' + 'Missing the required parameter $app_id when calling createSegment' ); } @@ -2104,8 +2321,8 @@ public function createSegmentsRequest($app_id, $segment = null) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -2114,7 +2331,7 @@ public function createSegmentsRequest($app_id, $segment = null) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -2137,15 +2354,15 @@ public function createSegmentsRequest($app_id, $segment = null) * @param string $app_id app_id (required) * @param string $alias_label alias_label (required) * @param string $alias_id alias_id (required) - * @param \onesignal\client\model\CreateSubscriptionRequestBody $create_subscription_request_body create_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body subscription_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse201|\onesignal\client\model\InlineResponse201|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function createSubscription($app_id, $alias_label, $alias_id, $create_subscription_request_body) + public function createSubscription($app_id, $alias_label, $alias_id, $subscription_body) { - list($response) = $this->createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $create_subscription_request_body); + list($response) = $this->createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $subscription_body); return $response; } @@ -2155,15 +2372,15 @@ public function createSubscription($app_id, $alias_label, $alias_id, $create_sub * @param string $app_id (required) * @param string $alias_label (required) * @param string $alias_id (required) - * @param \onesignal\client\model\CreateSubscriptionRequestBody $create_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse201|\onesignal\client\model\InlineResponse201|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $create_subscription_request_body) + public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $subscription_body) { - $request = $this->createSubscriptionRequest($app_id, $alias_label, $alias_id, $create_subscription_request_body); + $request = $this->createSubscriptionRequest($app_id, $alias_label, $alias_id, $subscription_body); try { $options = $this->createHttpClientOption(); @@ -2202,32 +2419,32 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, switch($statusCode) { case 201: - if ('\onesignal\client\model\InlineResponse201' === '\SplFileObject') { + if ('\onesignal\client\model\SubscriptionBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse201' !== 'string') { + if ('\onesignal\client\model\SubscriptionBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse201', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\SubscriptionBody', []), $response->getStatusCode(), $response->getHeaders() ]; case 202: - if ('\onesignal\client\model\InlineResponse201' === '\SplFileObject') { + if ('\onesignal\client\model\SubscriptionBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse201' !== 'string') { + if ('\onesignal\client\model\SubscriptionBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse201', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\SubscriptionBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2241,6 +2458,21 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -2262,23 +2494,23 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\InlineResponse201'; + $returnType = '\onesignal\client\model\SubscriptionBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2299,7 +2531,7 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse201', + '\onesignal\client\model\SubscriptionBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2307,7 +2539,7 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse201', + '\onesignal\client\model\SubscriptionBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2320,6 +2552,14 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2331,7 +2571,7 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2347,14 +2587,14 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, * @param string $app_id (required) * @param string $alias_label (required) * @param string $alias_id (required) - * @param \onesignal\client\model\CreateSubscriptionRequestBody $create_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSubscriptionAsync($app_id, $alias_label, $alias_id, $create_subscription_request_body) + public function createSubscriptionAsync($app_id, $alias_label, $alias_id, $subscription_body) { - return $this->createSubscriptionAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $create_subscription_request_body) + return $this->createSubscriptionAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $subscription_body) ->then( function ($response) { return $response[0]; @@ -2368,15 +2608,15 @@ function ($response) { * @param string $app_id (required) * @param string $alias_label (required) * @param string $alias_id (required) - * @param \onesignal\client\model\CreateSubscriptionRequestBody $create_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSubscriptionAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $create_subscription_request_body) + public function createSubscriptionAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $subscription_body) { - $returnType = '\onesignal\client\model\InlineResponse201'; - $request = $this->createSubscriptionRequest($app_id, $alias_label, $alias_id, $create_subscription_request_body); + $returnType = '\onesignal\client\model\SubscriptionBody'; + $request = $this->createSubscriptionRequest($app_id, $alias_label, $alias_id, $subscription_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2420,12 +2660,12 @@ function ($exception) { * @param string $app_id (required) * @param string $alias_label (required) * @param string $alias_id (required) - * @param \onesignal\client\model\CreateSubscriptionRequestBody $create_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $create_subscription_request_body) + public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $subscription_body) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { @@ -2445,10 +2685,10 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $cre 'Missing the required parameter $alias_id when calling createSubscription' ); } - // verify the required parameter 'create_subscription_request_body' is set - if ($create_subscription_request_body === null || (is_array($create_subscription_request_body) && count($create_subscription_request_body) === 0)) { + // verify the required parameter 'subscription_body' is set + if ($subscription_body === null || (is_array($subscription_body) && count($subscription_body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_subscription_request_body when calling createSubscription' + 'Missing the required parameter $subscription_body when calling createSubscription' ); } @@ -2499,11 +2739,11 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $cre } // for model (json/xml) - if (isset($create_subscription_request_body)) { + if (isset($subscription_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request_body)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_body)); } else { - $httpBody = $create_subscription_request_body; + $httpBody = $subscription_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2529,8 +2769,8 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $cre } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -2539,7 +2779,7 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $cre } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -2564,7 +2804,7 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $cre * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError */ public function createUser($app_id, $user) { @@ -2580,7 +2820,7 @@ public function createUser($app_id, $user) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ public function createUserWithHttpInfo($app_id, $user) { @@ -2698,17 +2938,17 @@ public function createUserWithHttpInfo($app_id, $user) $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2775,7 +3015,7 @@ public function createUserWithHttpInfo($app_id, $user) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2816,2371 +3056,7 @@ function ($response) { public function createUserAsyncWithHttpInfo($app_id, $user) { $returnType = '\onesignal\client\model\User'; - $request = $this->createUserRequest($app_id, $user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'createUser' - * - * @param string $app_id (required) - * @param \onesignal\client\model\User $user (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function createUserRequest($app_id, $user) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling createUser' - ); - } - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling createUser' - ); - } - - $resourcePath = '/apps/{app_id}/users'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); - } else { - $httpBody = $user; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deleteAlias - * - * @param string $app_id app_id (required) - * @param string $alias_label alias_label (required) - * @param string $alias_id alias_id (required) - * @param string $alias_label_to_delete alias_label_to_delete (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError - */ - public function deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_delete) - { - list($response) = $this->deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete); - return $response; - } - - /** - * Operation deleteAliasWithHttpInfo - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param string $alias_label_to_delete (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) - { - $request = $this->deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\onesignal\client\model\InlineResponse200' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse200' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse200', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\InlineResponse200'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\InlineResponse200', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteAliasAsync - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param string $alias_label_to_delete (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteAliasAsync($app_id, $alias_label, $alias_id, $alias_label_to_delete) - { - return $this->deleteAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteAliasAsyncWithHttpInfo - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param string $alias_label_to_delete (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) - { - $returnType = '\onesignal\client\model\InlineResponse200'; - $request = $this->deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteAlias' - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param string $alias_label_to_delete (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling deleteAlias' - ); - } - // verify the required parameter 'alias_label' is set - if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling deleteAlias' - ); - } - // verify the required parameter 'alias_id' is set - if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling deleteAlias' - ); - } - // verify the required parameter 'alias_label_to_delete' is set - if ($alias_label_to_delete === null || (is_array($alias_label_to_delete) && count($alias_label_to_delete) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label_to_delete when calling deleteAlias' - ); - } - - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($alias_label !== null) { - $resourcePath = str_replace( - '{' . 'alias_label' . '}', - ObjectSerializer::toPathValue($alias_label), - $resourcePath - ); - } - // path params - if ($alias_id !== null) { - $resourcePath = str_replace( - '{' . 'alias_id' . '}', - ObjectSerializer::toPathValue($alias_id), - $resourcePath - ); - } - // path params - if ($alias_label_to_delete !== null) { - $resourcePath = str_replace( - '{' . 'alias_label_to_delete' . '}', - ObjectSerializer::toPathValue($alias_label_to_delete), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deletePlayer - * - * Delete a user record - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $player_id The OneSignal player_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \onesignal\client\model\DeletePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\DeletePlayerNotFoundResponse|\onesignal\client\model\RateLimiterError - */ - public function deletePlayer($app_id, $player_id) - { - list($response) = $this->deletePlayerWithHttpInfo($app_id, $player_id); - return $response; - } - - /** - * Operation deletePlayerWithHttpInfo - * - * Delete a user record - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $player_id The OneSignal player_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\DeletePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\DeletePlayerNotFoundResponse|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) - */ - public function deletePlayerWithHttpInfo($app_id, $player_id) - { - $request = $this->deletePlayerRequest($app_id, $player_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\onesignal\client\model\DeletePlayerSuccessResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\DeletePlayerSuccessResponse' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\DeletePlayerSuccessResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\onesignal\client\model\DeletePlayerNotFoundResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\DeletePlayerNotFoundResponse' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\DeletePlayerNotFoundResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\DeletePlayerSuccessResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\DeletePlayerSuccessResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\DeletePlayerNotFoundResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deletePlayerAsync - * - * Delete a user record - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $player_id The OneSignal player_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deletePlayerAsync($app_id, $player_id) - { - return $this->deletePlayerAsyncWithHttpInfo($app_id, $player_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deletePlayerAsyncWithHttpInfo - * - * Delete a user record - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $player_id The OneSignal player_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deletePlayerAsyncWithHttpInfo($app_id, $player_id) - { - $returnType = '\onesignal\client\model\DeletePlayerSuccessResponse'; - $request = $this->deletePlayerRequest($app_id, $player_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deletePlayer' - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $player_id The OneSignal player_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function deletePlayerRequest($app_id, $player_id) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling deletePlayer' - ); - } - // verify the required parameter 'player_id' is set - if ($player_id === null || (is_array($player_id) && count($player_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $player_id when calling deletePlayer' - ); - } - - $resourcePath = '/players/{player_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - - - // path params - if ($player_id !== null) { - $resourcePath = str_replace( - '{' . 'player_id' . '}', - ObjectSerializer::toPathValue($player_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deleteSegments - * - * Delete Segments - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \onesignal\client\model\DeleteSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\DeleteSegmentNotFoundResponse|\onesignal\client\model\RateLimiterError - */ - public function deleteSegments($app_id, $segment_id) - { - list($response) = $this->deleteSegmentsWithHttpInfo($app_id, $segment_id); - return $response; - } - - /** - * Operation deleteSegmentsWithHttpInfo - * - * Delete Segments - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\DeleteSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\DeleteSegmentNotFoundResponse|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteSegmentsWithHttpInfo($app_id, $segment_id) - { - $request = $this->deleteSegmentsRequest($app_id, $segment_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\onesignal\client\model\DeleteSegmentSuccessResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\DeleteSegmentSuccessResponse' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\DeleteSegmentSuccessResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\onesignal\client\model\DeleteSegmentNotFoundResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\DeleteSegmentNotFoundResponse' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\DeleteSegmentNotFoundResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\DeleteSegmentSuccessResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\DeleteSegmentSuccessResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\DeleteSegmentNotFoundResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteSegmentsAsync - * - * Delete Segments - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteSegmentsAsync($app_id, $segment_id) - { - return $this->deleteSegmentsAsyncWithHttpInfo($app_id, $segment_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteSegmentsAsyncWithHttpInfo - * - * Delete Segments - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteSegmentsAsyncWithHttpInfo($app_id, $segment_id) - { - $returnType = '\onesignal\client\model\DeleteSegmentSuccessResponse'; - $request = $this->deleteSegmentsRequest($app_id, $segment_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteSegments' - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function deleteSegmentsRequest($app_id, $segment_id) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling deleteSegments' - ); - } - // verify the required parameter 'segment_id' is set - if ($segment_id === null || (is_array($segment_id) && count($segment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $segment_id when calling deleteSegments' - ); - } - - $resourcePath = '/apps/{app_id}/segments/{segment_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($segment_id !== null) { - $resourcePath = str_replace( - '{' . 'segment_id' . '}', - ObjectSerializer::toPathValue($segment_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deleteSubscription - * - * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function deleteSubscription($app_id, $subscription_id) - { - $this->deleteSubscriptionWithHttpInfo($app_id, $subscription_id); - } - - /** - * Operation deleteSubscriptionWithHttpInfo - * - * @param string $app_id (required) - * @param string $subscription_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteSubscriptionWithHttpInfo($app_id, $subscription_id) - { - $request = $this->deleteSubscriptionRequest($app_id, $subscription_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteSubscriptionAsync - * - * @param string $app_id (required) - * @param string $subscription_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteSubscriptionAsync($app_id, $subscription_id) - { - return $this->deleteSubscriptionAsyncWithHttpInfo($app_id, $subscription_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteSubscriptionAsyncWithHttpInfo - * - * @param string $app_id (required) - * @param string $subscription_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteSubscriptionAsyncWithHttpInfo($app_id, $subscription_id) - { - $returnType = ''; - $request = $this->deleteSubscriptionRequest($app_id, $subscription_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteSubscription' - * - * @param string $app_id (required) - * @param string $subscription_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function deleteSubscriptionRequest($app_id, $subscription_id) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling deleteSubscription' - ); - } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling deleteSubscription' - ); - } - - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($subscription_id !== null) { - $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deleteUser - * - * @param string $app_id app_id (required) - * @param string $alias_label alias_label (required) - * @param string $alias_id alias_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function deleteUser($app_id, $alias_label, $alias_id) - { - $this->deleteUserWithHttpInfo($app_id, $alias_label, $alias_id); - } - - /** - * Operation deleteUserWithHttpInfo - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteUserWithHttpInfo($app_id, $alias_label, $alias_id) - { - $request = $this->deleteUserRequest($app_id, $alias_label, $alias_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation deleteUserAsync - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteUserAsync($app_id, $alias_label, $alias_id) - { - return $this->deleteUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteUserAsyncWithHttpInfo - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) - { - $returnType = ''; - $request = $this->deleteUserRequest($app_id, $alias_label, $alias_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteUser' - * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function deleteUserRequest($app_id, $alias_label, $alias_id) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling deleteUser' - ); - } - // verify the required parameter 'alias_label' is set - if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling deleteUser' - ); - } - // verify the required parameter 'alias_id' is set - if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling deleteUser' - ); - } - - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($alias_label !== null) { - $resourcePath = str_replace( - '{' . 'alias_label' . '}', - ObjectSerializer::toPathValue($alias_label), - $resourcePath - ); - } - // path params - if ($alias_id !== null) { - $resourcePath = str_replace( - '{' . 'alias_id' . '}', - ObjectSerializer::toPathValue($alias_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation endLiveActivity - * - * Stop Live Activity - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param string $subscription_id Subscription ID (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function endLiveActivity($app_id, $activity_id, $subscription_id) - { - $this->endLiveActivityWithHttpInfo($app_id, $activity_id, $subscription_id); - } - - /** - * Operation endLiveActivityWithHttpInfo - * - * Stop Live Activity - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param string $subscription_id Subscription ID (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function endLiveActivityWithHttpInfo($app_id, $activity_id, $subscription_id) - { - $request = $this->endLiveActivityRequest($app_id, $activity_id, $subscription_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation endLiveActivityAsync - * - * Stop Live Activity - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param string $subscription_id Subscription ID (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function endLiveActivityAsync($app_id, $activity_id, $subscription_id) - { - return $this->endLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $subscription_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation endLiveActivityAsyncWithHttpInfo - * - * Stop Live Activity - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param string $subscription_id Subscription ID (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function endLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $subscription_id) - { - $returnType = ''; - $request = $this->endLiveActivityRequest($app_id, $activity_id, $subscription_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'endLiveActivity' - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param string $subscription_id Subscription ID (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function endLiveActivityRequest($app_id, $activity_id, $subscription_id) - { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling endLiveActivity' - ); - } - // verify the required parameter 'activity_id' is set - if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $activity_id when calling endLiveActivity' - ); - } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling endLiveActivity' - ); - } - - $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($app_id !== null) { - $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), - $resourcePath - ); - } - // path params - if ($activity_id !== null) { - $resourcePath = str_replace( - '{' . 'activity_id' . '}', - ObjectSerializer::toPathValue($activity_id), - $resourcePath - ); - } - // path params - if ($subscription_id !== null) { - $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation exportEvents - * - * Export CSV of Events - * - * @param string $notification_id The ID of the notification to export events from. (required) - * @param string $app_id The ID of the app that the notification belongs to. (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError - */ - public function exportEvents($notification_id, $app_id) - { - list($response) = $this->exportEventsWithHttpInfo($notification_id, $app_id); - return $response; - } - - /** - * Operation exportEventsWithHttpInfo - * - * Export CSV of Events - * - * @param string $notification_id The ID of the notification to export events from. (required) - * @param string $app_id The ID of the app that the notification belongs to. (required) - * - * @throws \onesignal\client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) - */ - public function exportEventsWithHttpInfo($notification_id, $app_id) - { - $request = $this->exportEventsRequest($notification_id, $app_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\onesignal\client\model\ExportEventsSuccessResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\ExportEventsSuccessResponse' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\ExportEventsSuccessResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\ExportEventsSuccessResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\ExportEventsSuccessResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation exportEventsAsync - * - * Export CSV of Events - * - * @param string $notification_id The ID of the notification to export events from. (required) - * @param string $app_id The ID of the app that the notification belongs to. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportEventsAsync($notification_id, $app_id) - { - return $this->exportEventsAsyncWithHttpInfo($notification_id, $app_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation exportEventsAsyncWithHttpInfo - * - * Export CSV of Events - * - * @param string $notification_id The ID of the notification to export events from. (required) - * @param string $app_id The ID of the app that the notification belongs to. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportEventsAsyncWithHttpInfo($notification_id, $app_id) - { - $returnType = '\onesignal\client\model\ExportEventsSuccessResponse'; - $request = $this->exportEventsRequest($notification_id, $app_id); + $request = $this->createUserRequest($app_id, $user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5219,52 +3095,43 @@ function ($exception) { } /** - * Create request for operation 'exportEvents' + * Create request for operation 'createUser' * - * @param string $notification_id The ID of the notification to export events from. (required) - * @param string $app_id The ID of the app that the notification belongs to. (required) + * @param string $app_id (required) + * @param \onesignal\client\model\User $user (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportEventsRequest($notification_id, $app_id) + public function createUserRequest($app_id, $user) { - // verify the required parameter 'notification_id' is set - if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notification_id when calling exportEvents' + 'Missing the required parameter $app_id when calling createUser' ); } - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling exportEvents' + 'Missing the required parameter $user when calling createUser' ); } - $resourcePath = '/notifications/{notification_id}/export_events?app_id={app_id}'; + $resourcePath = '/apps/{app_id}/users'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params - if ($notification_id !== null) { + if ($app_id !== null) { $resourcePath = str_replace( - '{' . 'notification_id' . '}', - ObjectSerializer::toPathValue($notification_id), + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), $resourcePath ); } @@ -5277,12 +3144,18 @@ public function exportEventsRequest($notification_id, $app_id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($user)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); + } else { + $httpBody = $user; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -5306,8 +3179,8 @@ public function exportEventsRequest($notification_id, $app_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -5316,7 +3189,7 @@ public function exportEventsRequest($notification_id, $app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -5334,38 +3207,38 @@ public function exportEventsRequest($notification_id, $app_id) } /** - * Operation exportPlayers - * - * Export CSV of Players + * Operation deleteAlias * - * @param string $app_id The app ID that you want to export devices from (required) - * @param \onesignal\client\model\ExportPlayersRequestBody $export_players_request_body export_players_request_body (optional) + * @param string $app_id app_id (required) + * @param string $alias_label alias_label (required) + * @param string $alias_id alias_id (required) + * @param string $alias_label_to_delete alias_label_to_delete (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\ExportPlayersSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function exportPlayers($app_id, $export_players_request_body = null) + public function deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_delete) { - list($response) = $this->exportPlayersWithHttpInfo($app_id, $export_players_request_body); + list($response) = $this->deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete); return $response; } /** - * Operation exportPlayersWithHttpInfo - * - * Export CSV of Players + * Operation deleteAliasWithHttpInfo * - * @param string $app_id The app ID that you want to export devices from (required) - * @param \onesignal\client\model\ExportPlayersRequestBody $export_players_request_body (optional) + * @param string $app_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param string $alias_label_to_delete (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\ExportPlayersSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function exportPlayersWithHttpInfo($app_id, $export_players_request_body = null) + public function deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) { - $request = $this->exportPlayersRequest($app_id, $export_players_request_body); + $request = $this->deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete); try { $options = $this->createHttpClientOption(); @@ -5404,17 +3277,17 @@ public function exportPlayersWithHttpInfo($app_id, $export_players_request_body switch($statusCode) { case 200: - if ('\onesignal\client\model\ExportPlayersSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\ExportPlayersSuccessResponse' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\ExportPlayersSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5428,29 +3301,59 @@ public function exportPlayersWithHttpInfo($app_id, $export_players_request_body } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\ExportPlayersSuccessResponse'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5471,7 +3374,7 @@ public function exportPlayersWithHttpInfo($app_id, $export_players_request_body case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\ExportPlayersSuccessResponse', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5484,10 +3387,26 @@ public function exportPlayersWithHttpInfo($app_id, $export_players_request_body ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5498,19 +3417,19 @@ public function exportPlayersWithHttpInfo($app_id, $export_players_request_body } /** - * Operation exportPlayersAsync - * - * Export CSV of Players + * Operation deleteAliasAsync * - * @param string $app_id The app ID that you want to export devices from (required) - * @param \onesignal\client\model\ExportPlayersRequestBody $export_players_request_body (optional) + * @param string $app_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param string $alias_label_to_delete (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPlayersAsync($app_id, $export_players_request_body = null) + public function deleteAliasAsync($app_id, $alias_label, $alias_id, $alias_label_to_delete) { - return $this->exportPlayersAsyncWithHttpInfo($app_id, $export_players_request_body) + return $this->deleteAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) ->then( function ($response) { return $response[0]; @@ -5519,20 +3438,20 @@ function ($response) { } /** - * Operation exportPlayersAsyncWithHttpInfo - * - * Export CSV of Players + * Operation deleteAliasAsyncWithHttpInfo * - * @param string $app_id The app ID that you want to export devices from (required) - * @param \onesignal\client\model\ExportPlayersRequestBody $export_players_request_body (optional) + * @param string $app_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param string $alias_label_to_delete (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPlayersAsyncWithHttpInfo($app_id, $export_players_request_body = null) + public function deleteAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) { - $returnType = '\onesignal\client\model\ExportPlayersSuccessResponse'; - $request = $this->exportPlayersRequest($app_id, $export_players_request_body); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5571,24 +3490,44 @@ function ($exception) { } /** - * Create request for operation 'exportPlayers' + * Create request for operation 'deleteAlias' * - * @param string $app_id The app ID that you want to export devices from (required) - * @param \onesignal\client\model\ExportPlayersRequestBody $export_players_request_body (optional) + * @param string $app_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) + * @param string $alias_label_to_delete (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportPlayersRequest($app_id, $export_players_request_body = null) + public function deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_label_to_delete) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling exportPlayers' + 'Missing the required parameter $app_id when calling deleteAlias' + ); + } + // verify the required parameter 'alias_label' is set + if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_label when calling deleteAlias' + ); + } + // verify the required parameter 'alias_id' is set + if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_id when calling deleteAlias' + ); + } + // verify the required parameter 'alias_label_to_delete' is set + if ($alias_label_to_delete === null || (is_array($alias_label_to_delete) && count($alias_label_to_delete) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_label_to_delete when calling deleteAlias' ); } - $resourcePath = '/players/csv_export?app_id={app_id}'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5605,6 +3544,30 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul $resourcePath ); } + // path params + if ($alias_label !== null) { + $resourcePath = str_replace( + '{' . 'alias_label' . '}', + ObjectSerializer::toPathValue($alias_label), + $resourcePath + ); + } + // path params + if ($alias_id !== null) { + $resourcePath = str_replace( + '{' . 'alias_id' . '}', + ObjectSerializer::toPathValue($alias_id), + $resourcePath + ); + } + // path params + if ($alias_label_to_delete !== null) { + $resourcePath = str_replace( + '{' . 'alias_label_to_delete' . '}', + ObjectSerializer::toPathValue($alias_label_to_delete), + $resourcePath + ); + } if ($multipart) { @@ -5614,18 +3577,12 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($export_players_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($export_players_request_body)); - } else { - $httpBody = $export_players_request_body; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -5649,8 +3606,8 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -5659,7 +3616,7 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -5669,7 +3626,7 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5677,34 +3634,38 @@ public function exportPlayersRequest($app_id, $export_players_request_body = nul } /** - * Operation fetchAliases + * Operation deleteSegment * - * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) + * Delete Segment + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError */ - public function fetchAliases($app_id, $subscription_id) + public function deleteSegment($app_id, $segment_id) { - list($response) = $this->fetchAliasesWithHttpInfo($app_id, $subscription_id); + list($response) = $this->deleteSegmentWithHttpInfo($app_id, $segment_id); return $response; } /** - * Operation fetchAliasesWithHttpInfo + * Operation deleteSegmentWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) + * Delete Segment + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAliasesWithHttpInfo($app_id, $subscription_id) + public function deleteSegmentWithHttpInfo($app_id, $segment_id) { - $request = $this->fetchAliasesRequest($app_id, $subscription_id); + $request = $this->deleteSegmentRequest($app_id, $segment_id); try { $options = $this->createHttpClientOption(); @@ -5743,17 +3704,17 @@ public function fetchAliasesWithHttpInfo($app_id, $subscription_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\UserIdentityResponse' === '\SplFileObject') { + if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UserIdentityResponse' !== 'string') { + if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5772,9 +3733,39 @@ public function fetchAliasesWithHttpInfo($app_id, $subscription_id) $response->getStatusCode(), $response->getHeaders() ]; + case 404: + if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } - $returnType = '\onesignal\client\model\UserIdentityResponse'; + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5795,7 +3786,7 @@ public function fetchAliasesWithHttpInfo($app_id, $subscription_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UserIdentityResponse', + '\onesignal\client\model\GenericSuccessBoolResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5808,23 +3799,41 @@ public function fetchAliasesWithHttpInfo($app_id, $subscription_id) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericSuccessBoolResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation fetchAliasesAsync + * Operation deleteSegmentAsync * - * @param string $app_id (required) - * @param string $subscription_id (required) + * Delete Segment + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAliasesAsync($app_id, $subscription_id) + public function deleteSegmentAsync($app_id, $segment_id) { - return $this->fetchAliasesAsyncWithHttpInfo($app_id, $subscription_id) + return $this->deleteSegmentAsyncWithHttpInfo($app_id, $segment_id) ->then( function ($response) { return $response[0]; @@ -5833,18 +3842,20 @@ function ($response) { } /** - * Operation fetchAliasesAsyncWithHttpInfo + * Operation deleteSegmentAsyncWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) + * Delete Segment + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAliasesAsyncWithHttpInfo($app_id, $subscription_id) + public function deleteSegmentAsyncWithHttpInfo($app_id, $segment_id) { - $returnType = '\onesignal\client\model\UserIdentityResponse'; - $request = $this->fetchAliasesRequest($app_id, $subscription_id); + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + $request = $this->deleteSegmentRequest($app_id, $segment_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5883,30 +3894,30 @@ function ($exception) { } /** - * Create request for operation 'fetchAliases' + * Create request for operation 'deleteSegment' * - * @param string $app_id (required) - * @param string $subscription_id (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAliasesRequest($app_id, $subscription_id) + public function deleteSegmentRequest($app_id, $segment_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling fetchAliases' + 'Missing the required parameter $app_id when calling deleteSegment' ); } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + // verify the required parameter 'segment_id' is set + if ($segment_id === null || (is_array($segment_id) && count($segment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling fetchAliases' + 'Missing the required parameter $segment_id when calling deleteSegment' ); } - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'; + $resourcePath = '/apps/{app_id}/segments/{segment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5924,10 +3935,10 @@ public function fetchAliasesRequest($app_id, $subscription_id) ); } // path params - if ($subscription_id !== null) { + if ($segment_id !== null) { $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), + '{' . 'segment_id' . '}', + ObjectSerializer::toPathValue($segment_id), $resourcePath ); } @@ -5969,8 +3980,8 @@ public function fetchAliasesRequest($app_id, $subscription_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -5979,7 +3990,7 @@ public function fetchAliasesRequest($app_id, $subscription_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -5989,7 +4000,7 @@ public function fetchAliasesRequest($app_id, $subscription_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5997,36 +4008,33 @@ public function fetchAliasesRequest($app_id, $subscription_id) } /** - * Operation fetchUser + * Operation deleteSubscription * * @param string $app_id app_id (required) - * @param string $alias_label alias_label (required) - * @param string $alias_id alias_id (required) + * @param string $subscription_id subscription_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return void */ - public function fetchUser($app_id, $alias_label, $alias_id) + public function deleteSubscription($app_id, $subscription_id) { - list($response) = $this->fetchUserWithHttpInfo($app_id, $alias_label, $alias_id); - return $response; + $this->deleteSubscriptionWithHttpInfo($app_id, $subscription_id); } /** - * Operation fetchUserWithHttpInfo + * Operation deleteSubscriptionWithHttpInfo * * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * @param string $subscription_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function fetchUserWithHttpInfo($app_id, $alias_label, $alias_id) + public function deleteSubscriptionWithHttpInfo($app_id, $subscription_id) { - $request = $this->fetchUserRequest($app_id, $alias_label, $alias_id); + $request = $this->deleteSubscriptionRequest($app_id, $subscription_id); try { $options = $this->createHttpClientOption(); @@ -6063,81 +4071,27 @@ public function fetchUserWithHttpInfo($app_id, $alias_label, $alias_id) ); } - switch($statusCode) { - case 200: - if ('\onesignal\client\model\User' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\User' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\User', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\User'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\User', + '\onesignal\client\model\GenericError', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\onesignal\client\model\GenericError', @@ -6148,7 +4102,7 @@ public function fetchUserWithHttpInfo($app_id, $alias_label, $alias_id) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6159,18 +4113,17 @@ public function fetchUserWithHttpInfo($app_id, $alias_label, $alias_id) } /** - * Operation fetchUserAsync + * Operation deleteSubscriptionAsync * * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUserAsync($app_id, $alias_label, $alias_id) + public function deleteSubscriptionAsync($app_id, $subscription_id) { - return $this->fetchUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + return $this->deleteSubscriptionAsyncWithHttpInfo($app_id, $subscription_id) ->then( function ($response) { return $response[0]; @@ -6179,38 +4132,24 @@ function ($response) { } /** - * Operation fetchUserAsyncWithHttpInfo + * Operation deleteSubscriptionAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + public function deleteSubscriptionAsyncWithHttpInfo($app_id, $subscription_id) { - $returnType = '\onesignal\client\model\User'; - $request = $this->fetchUserRequest($app_id, $alias_label, $alias_id); + $returnType = ''; + $request = $this->deleteSubscriptionRequest($app_id, $subscription_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -6230,37 +4169,30 @@ function ($exception) { } /** - * Create request for operation 'fetchUser' + * Create request for operation 'deleteSubscription' * * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchUserRequest($app_id, $alias_label, $alias_id) + public function deleteSubscriptionRequest($app_id, $subscription_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling fetchUser' - ); - } - // verify the required parameter 'alias_label' is set - if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling fetchUser' + 'Missing the required parameter $app_id when calling deleteSubscription' ); } - // verify the required parameter 'alias_id' is set - if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling fetchUser' + 'Missing the required parameter $subscription_id when calling deleteSubscription' ); } - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; + $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6278,18 +4210,10 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) ); } // path params - if ($alias_label !== null) { - $resourcePath = str_replace( - '{' . 'alias_label' . '}', - ObjectSerializer::toPathValue($alias_label), - $resourcePath - ); - } - // path params - if ($alias_id !== null) { + if ($subscription_id !== null) { $resourcePath = str_replace( - '{' . 'alias_id' . '}', - ObjectSerializer::toPathValue($alias_id), + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), $resourcePath ); } @@ -6331,8 +4255,8 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -6341,7 +4265,7 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -6351,7 +4275,7 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6359,7 +4283,7 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) } /** - * Operation fetchUserIdentity + * Operation deleteUser * * @param string $app_id app_id (required) * @param string $alias_label alias_label (required) @@ -6367,16 +4291,15 @@ public function fetchUserRequest($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return void */ - public function fetchUserIdentity($app_id, $alias_label, $alias_id) + public function deleteUser($app_id, $alias_label, $alias_id) { - list($response) = $this->fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id); - return $response; + $this->deleteUserWithHttpInfo($app_id, $alias_label, $alias_id); } /** - * Operation fetchUserIdentityWithHttpInfo + * Operation deleteUserWithHttpInfo * * @param string $app_id (required) * @param string $alias_label (required) @@ -6384,11 +4307,11 @@ public function fetchUserIdentity($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id) + public function deleteUserWithHttpInfo($app_id, $alias_label, $alias_id) { - $request = $this->fetchUserIdentityRequest($app_id, $alias_label, $alias_id); + $request = $this->deleteUserRequest($app_id, $alias_label, $alias_id); try { $options = $this->createHttpClientOption(); @@ -6425,81 +4348,19 @@ public function fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id) ); } - switch($statusCode) { - case 200: - if ('\onesignal\client\model\InlineResponse200' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse200' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse200', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\onesignal\client\model\InlineResponse200'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse200', + '\onesignal\client\model\GenericError', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\onesignal\client\model\GenericError', @@ -6510,7 +4371,7 @@ public function fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6521,7 +4382,7 @@ public function fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id) } /** - * Operation fetchUserIdentityAsync + * Operation deleteUserAsync * * @param string $app_id (required) * @param string $alias_label (required) @@ -6530,9 +4391,9 @@ public function fetchUserIdentityWithHttpInfo($app_id, $alias_label, $alias_id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUserIdentityAsync($app_id, $alias_label, $alias_id) + public function deleteUserAsync($app_id, $alias_label, $alias_id) { - return $this->fetchUserIdentityAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + return $this->deleteUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) ->then( function ($response) { return $response[0]; @@ -6541,7 +4402,7 @@ function ($response) { } /** - * Operation fetchUserIdentityAsyncWithHttpInfo + * Operation deleteUserAsyncWithHttpInfo * * @param string $app_id (required) * @param string $alias_label (required) @@ -6550,29 +4411,16 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUserIdentityAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + public function deleteUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) { - $returnType = '\onesignal\client\model\InlineResponse200'; - $request = $this->fetchUserIdentityRequest($app_id, $alias_label, $alias_id); + $returnType = ''; + $request = $this->deleteUserRequest($app_id, $alias_label, $alias_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -6592,7 +4440,7 @@ function ($exception) { } /** - * Create request for operation 'fetchUserIdentity' + * Create request for operation 'deleteUser' * * @param string $app_id (required) * @param string $alias_label (required) @@ -6601,28 +4449,28 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchUserIdentityRequest($app_id, $alias_label, $alias_id) + public function deleteUserRequest($app_id, $alias_label, $alias_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling fetchUserIdentity' + 'Missing the required parameter $app_id when calling deleteUser' ); } // verify the required parameter 'alias_label' is set if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling fetchUserIdentity' + 'Missing the required parameter $alias_label when calling deleteUser' ); } // verify the required parameter 'alias_id' is set if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling fetchUserIdentity' + 'Missing the required parameter $alias_id when calling deleteUser' ); } - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6693,8 +4541,8 @@ public function fetchUserIdentityRequest($app_id, $alias_label, $alias_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -6703,7 +4551,7 @@ public function fetchUserIdentityRequest($app_id, $alias_label, $alias_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -6713,7 +4561,7 @@ public function fetchUserIdentityRequest($app_id, $alias_label, $alias_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6721,36 +4569,38 @@ public function fetchUserIdentityRequest($app_id, $alias_label, $alias_id) } /** - * Operation getApp + * Operation exportEvents * - * View an app + * Export CSV of Events * - * @param string $app_id An app id (required) + * @param string $notification_id The ID of the notification to export events from. (required) + * @param string $app_id The ID of the app that the notification belongs to. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getApp($app_id) + public function exportEvents($notification_id, $app_id) { - list($response) = $this->getAppWithHttpInfo($app_id); + list($response) = $this->exportEventsWithHttpInfo($notification_id, $app_id); return $response; } /** - * Operation getAppWithHttpInfo + * Operation exportEventsWithHttpInfo * - * View an app + * Export CSV of Events * - * @param string $app_id An app id (required) + * @param string $notification_id The ID of the notification to export events from. (required) + * @param string $app_id The ID of the app that the notification belongs to. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getAppWithHttpInfo($app_id) + public function exportEventsWithHttpInfo($notification_id, $app_id) { - $request = $this->getAppRequest($app_id); + $request = $this->exportEventsRequest($notification_id, $app_id); try { $options = $this->createHttpClientOption(); @@ -6789,17 +4639,17 @@ public function getAppWithHttpInfo($app_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\App' === '\SplFileObject') { + if ('\onesignal\client\model\ExportEventsSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\App' !== 'string') { + if ('\onesignal\client\model\ExportEventsSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\ExportEventsSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6813,29 +4663,44 @@ public function getAppWithHttpInfo($app_id) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\App'; + $returnType = '\onesignal\client\model\ExportEventsSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6856,7 +4721,7 @@ public function getAppWithHttpInfo($app_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\App', + '\onesignal\client\model\ExportEventsSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6869,10 +4734,18 @@ public function getAppWithHttpInfo($app_id) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6883,18 +4756,19 @@ public function getAppWithHttpInfo($app_id) } /** - * Operation getAppAsync + * Operation exportEventsAsync * - * View an app + * Export CSV of Events * - * @param string $app_id An app id (required) + * @param string $notification_id The ID of the notification to export events from. (required) + * @param string $app_id The ID of the app that the notification belongs to. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAppAsync($app_id) + public function exportEventsAsync($notification_id, $app_id) { - return $this->getAppAsyncWithHttpInfo($app_id) + return $this->exportEventsAsyncWithHttpInfo($notification_id, $app_id) ->then( function ($response) { return $response[0]; @@ -6903,19 +4777,20 @@ function ($response) { } /** - * Operation getAppAsyncWithHttpInfo + * Operation exportEventsAsyncWithHttpInfo * - * View an app + * Export CSV of Events * - * @param string $app_id An app id (required) + * @param string $notification_id The ID of the notification to export events from. (required) + * @param string $app_id The ID of the app that the notification belongs to. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAppAsyncWithHttpInfo($app_id) + public function exportEventsAsyncWithHttpInfo($notification_id, $app_id) { - $returnType = '\onesignal\client\model\App'; - $request = $this->getAppRequest($app_id); + $returnType = '\onesignal\client\model\ExportEventsSuccessResponse'; + $request = $this->exportEventsRequest($notification_id, $app_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6954,36 +4829,52 @@ function ($exception) { } /** - * Create request for operation 'getApp' + * Create request for operation 'exportEvents' * - * @param string $app_id An app id (required) + * @param string $notification_id The ID of the notification to export events from. (required) + * @param string $app_id The ID of the app that the notification belongs to. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAppRequest($app_id) + public function exportEventsRequest($notification_id, $app_id) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $notification_id when calling exportEvents' + ); + } // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getApp' + 'Missing the required parameter $app_id when calling exportEvents' ); } - $resourcePath = '/apps/{app_id}'; + $resourcePath = '/notifications/{notification_id}/export_events?app_id={app_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $app_id, + 'app_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params - if ($app_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -7025,8 +4916,8 @@ public function getAppRequest($app_id) } } - if (!empty($this->config->getUserKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getUserKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -7035,7 +4926,7 @@ public function getAppRequest($app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -7045,7 +4936,7 @@ public function getAppRequest($app_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7053,34 +4944,38 @@ public function getAppRequest($app_id) } /** - * Operation getApps + * Operation exportSubscriptions * - * View apps + * Export CSV of Subscriptions * + * @param string $app_id The app ID that you want to export devices from (required) + * @param \onesignal\client\model\ExportSubscriptionsRequestBody $export_subscriptions_request_body export_subscriptions_request_body (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getApps() + public function exportSubscriptions($app_id, $export_subscriptions_request_body = null) { - list($response) = $this->getAppsWithHttpInfo(); + list($response) = $this->exportSubscriptionsWithHttpInfo($app_id, $export_subscriptions_request_body); return $response; } /** - * Operation getAppsWithHttpInfo + * Operation exportSubscriptionsWithHttpInfo * - * View apps + * Export CSV of Subscriptions * + * @param string $app_id The app ID that you want to export devices from (required) + * @param \onesignal\client\model\ExportSubscriptionsRequestBody $export_subscriptions_request_body (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getAppsWithHttpInfo() + public function exportSubscriptionsWithHttpInfo($app_id, $export_subscriptions_request_body = null) { - $request = $this->getAppsRequest(); + $request = $this->exportSubscriptionsRequest($app_id, $export_subscriptions_request_body); try { $options = $this->createHttpClientOption(); @@ -7119,17 +5014,17 @@ public function getAppsWithHttpInfo() switch($statusCode) { case 200: - if ('\onesignal\client\model\App[]' === '\SplFileObject') { + if ('\onesignal\client\model\ExportSubscriptionsSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\App[]' !== 'string') { + if ('\onesignal\client\model\ExportSubscriptionsSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\App[]', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\ExportSubscriptionsSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7149,23 +5044,23 @@ public function getAppsWithHttpInfo() $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\App[]'; + $returnType = '\onesignal\client\model\ExportSubscriptionsSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7186,7 +5081,7 @@ public function getAppsWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\App[]', + '\onesignal\client\model\ExportSubscriptionsSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7202,7 +5097,7 @@ public function getAppsWithHttpInfo() case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7213,17 +5108,19 @@ public function getAppsWithHttpInfo() } /** - * Operation getAppsAsync + * Operation exportSubscriptionsAsync * - * View apps + * Export CSV of Subscriptions * + * @param string $app_id The app ID that you want to export devices from (required) + * @param \onesignal\client\model\ExportSubscriptionsRequestBody $export_subscriptions_request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAppsAsync() + public function exportSubscriptionsAsync($app_id, $export_subscriptions_request_body = null) { - return $this->getAppsAsyncWithHttpInfo() + return $this->exportSubscriptionsAsyncWithHttpInfo($app_id, $export_subscriptions_request_body) ->then( function ($response) { return $response[0]; @@ -7232,18 +5129,20 @@ function ($response) { } /** - * Operation getAppsAsyncWithHttpInfo + * Operation exportSubscriptionsAsyncWithHttpInfo * - * View apps + * Export CSV of Subscriptions * + * @param string $app_id The app ID that you want to export devices from (required) + * @param \onesignal\client\model\ExportSubscriptionsRequestBody $export_subscriptions_request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAppsAsyncWithHttpInfo() + public function exportSubscriptionsAsyncWithHttpInfo($app_id, $export_subscriptions_request_body = null) { - $returnType = '\onesignal\client\model\App[]'; - $request = $this->getAppsRequest(); + $returnType = '\onesignal\client\model\ExportSubscriptionsSuccessResponse'; + $request = $this->exportSubscriptionsRequest($app_id, $export_subscriptions_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7282,16 +5181,24 @@ function ($exception) { } /** - * Create request for operation 'getApps' + * Create request for operation 'exportSubscriptions' * + * @param string $app_id The app ID that you want to export devices from (required) + * @param \onesignal\client\model\ExportSubscriptionsRequestBody $export_subscriptions_request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAppsRequest() + public function exportSubscriptionsRequest($app_id, $export_subscriptions_request_body = null) { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $app_id when calling exportSubscriptions' + ); + } - $resourcePath = '/apps'; + $resourcePath = '/players/csv_export?app_id={app_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7300,6 +5207,14 @@ public function getAppsRequest() + // path params + if ($app_id !== null) { + $resourcePath = str_replace( + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } if ($multipart) { @@ -7309,12 +5224,18 @@ public function getAppsRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($export_subscriptions_request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($export_subscriptions_request_body)); + } else { + $httpBody = $export_subscriptions_request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7338,8 +5259,8 @@ public function getAppsRequest() } } - if (!empty($this->config->getUserKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getUserKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -7348,7 +5269,7 @@ public function getAppsRequest() } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -7358,7 +5279,7 @@ public function getAppsRequest() $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7366,34 +5287,36 @@ public function getAppsRequest() } /** - * Operation getEligibleIams + * Operation getAliases * * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) + * @param string $alias_label alias_label (required) + * @param string $alias_id alias_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse2003|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getEligibleIams($app_id, $subscription_id) + public function getAliases($app_id, $alias_label, $alias_id) { - list($response) = $this->getEligibleIamsWithHttpInfo($app_id, $subscription_id); + list($response) = $this->getAliasesWithHttpInfo($app_id, $alias_label, $alias_id); return $response; } /** - * Operation getEligibleIamsWithHttpInfo + * Operation getAliasesWithHttpInfo * * @param string $app_id (required) - * @param string $subscription_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse2003|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) + public function getAliasesWithHttpInfo($app_id, $alias_label, $alias_id) { - $request = $this->getEligibleIamsRequest($app_id, $subscription_id); + $request = $this->getAliasesRequest($app_id, $alias_label, $alias_id); try { $options = $this->createHttpClientOption(); @@ -7432,17 +5355,17 @@ public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\InlineResponse2003' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse2003' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7456,29 +5379,44 @@ public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\InlineResponse2003'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7499,7 +5437,7 @@ public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse2003', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7512,10 +5450,18 @@ public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7526,17 +5472,18 @@ public function getEligibleIamsWithHttpInfo($app_id, $subscription_id) } /** - * Operation getEligibleIamsAsync + * Operation getAliasesAsync * * @param string $app_id (required) - * @param string $subscription_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEligibleIamsAsync($app_id, $subscription_id) + public function getAliasesAsync($app_id, $alias_label, $alias_id) { - return $this->getEligibleIamsAsyncWithHttpInfo($app_id, $subscription_id) + return $this->getAliasesAsyncWithHttpInfo($app_id, $alias_label, $alias_id) ->then( function ($response) { return $response[0]; @@ -7545,18 +5492,19 @@ function ($response) { } /** - * Operation getEligibleIamsAsyncWithHttpInfo + * Operation getAliasesAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $subscription_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEligibleIamsAsyncWithHttpInfo($app_id, $subscription_id) + public function getAliasesAsyncWithHttpInfo($app_id, $alias_label, $alias_id) { - $returnType = '\onesignal\client\model\InlineResponse2003'; - $request = $this->getEligibleIamsRequest($app_id, $subscription_id); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->getAliasesRequest($app_id, $alias_label, $alias_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7595,30 +5543,37 @@ function ($exception) { } /** - * Create request for operation 'getEligibleIams' + * Create request for operation 'getAliases' * * @param string $app_id (required) - * @param string $subscription_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getEligibleIamsRequest($app_id, $subscription_id) + public function getAliasesRequest($app_id, $alias_label, $alias_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getEligibleIams' + 'Missing the required parameter $app_id when calling getAliases' ); } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + // verify the required parameter 'alias_label' is set + if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_label when calling getAliases' + ); + } + // verify the required parameter 'alias_id' is set + if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling getEligibleIams' + 'Missing the required parameter $alias_id when calling getAliases' ); } - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/iams'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7636,10 +5591,18 @@ public function getEligibleIamsRequest($app_id, $subscription_id) ); } // path params - if ($subscription_id !== null) { + if ($alias_label !== null) { $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), + '{' . 'alias_label' . '}', + ObjectSerializer::toPathValue($alias_label), + $resourcePath + ); + } + // path params + if ($alias_id !== null) { + $resourcePath = str_replace( + '{' . 'alias_id' . '}', + ObjectSerializer::toPathValue($alias_id), $resourcePath ); } @@ -7681,8 +5644,8 @@ public function getEligibleIamsRequest($app_id, $subscription_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -7691,7 +5654,7 @@ public function getEligibleIamsRequest($app_id, $subscription_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -7709,38 +5672,34 @@ public function getEligibleIamsRequest($app_id, $subscription_id) } /** - * Operation getNotification - * - * View notification + * Operation getAliasesBySubscription * * @param string $app_id app_id (required) - * @param string $notification_id notification_id (required) + * @param string $subscription_id subscription_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ - public function getNotification($app_id, $notification_id) + public function getAliasesBySubscription($app_id, $subscription_id) { - list($response) = $this->getNotificationWithHttpInfo($app_id, $notification_id); + list($response) = $this->getAliasesBySubscriptionWithHttpInfo($app_id, $subscription_id); return $response; } /** - * Operation getNotificationWithHttpInfo - * - * View notification + * Operation getAliasesBySubscriptionWithHttpInfo * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $subscription_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ - public function getNotificationWithHttpInfo($app_id, $notification_id) + public function getAliasesBySubscriptionWithHttpInfo($app_id, $subscription_id) { - $request = $this->getNotificationRequest($app_id, $notification_id); + $request = $this->getAliasesBySubscriptionRequest($app_id, $subscription_id); try { $options = $this->createHttpClientOption(); @@ -7779,17 +5738,17 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\NotificationWithMeta' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\NotificationWithMeta' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationWithMeta', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7808,24 +5767,24 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) $response->getStatusCode(), $response->getHeaders() ]; - case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\GenericError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\NotificationWithMeta'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7846,7 +5805,7 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\NotificationWithMeta', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7859,10 +5818,10 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) ); $e->setResponseObject($data); break; - case 429: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\GenericError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7873,19 +5832,17 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) } /** - * Operation getNotificationAsync - * - * View notification + * Operation getAliasesBySubscriptionAsync * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationAsync($app_id, $notification_id) + public function getAliasesBySubscriptionAsync($app_id, $subscription_id) { - return $this->getNotificationAsyncWithHttpInfo($app_id, $notification_id) + return $this->getAliasesBySubscriptionAsyncWithHttpInfo($app_id, $subscription_id) ->then( function ($response) { return $response[0]; @@ -7894,20 +5851,18 @@ function ($response) { } /** - * Operation getNotificationAsyncWithHttpInfo - * - * View notification + * Operation getAliasesBySubscriptionAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationAsyncWithHttpInfo($app_id, $notification_id) + public function getAliasesBySubscriptionAsyncWithHttpInfo($app_id, $subscription_id) { - $returnType = '\onesignal\client\model\NotificationWithMeta'; - $request = $this->getNotificationRequest($app_id, $notification_id); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->getAliasesBySubscriptionRequest($app_id, $subscription_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7946,52 +5901,51 @@ function ($exception) { } /** - * Create request for operation 'getNotification' + * Create request for operation 'getAliasesBySubscription' * * @param string $app_id (required) - * @param string $notification_id (required) + * @param string $subscription_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getNotificationRequest($app_id, $notification_id) + public function getAliasesBySubscriptionRequest($app_id, $subscription_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getNotification' + 'Missing the required parameter $app_id when calling getAliasesBySubscription' ); } - // verify the required parameter 'notification_id' is set - if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notification_id when calling getNotification' + 'Missing the required parameter $subscription_id when calling getAliasesBySubscription' ); } - $resourcePath = '/notifications/{notification_id}'; + $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params - if ($notification_id !== null) { + if ($app_id !== null) { $resourcePath = str_replace( - '{' . 'notification_id' . '}', - ObjectSerializer::toPathValue($notification_id), + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), $resourcePath ); } @@ -8033,8 +5987,8 @@ public function getNotificationRequest($app_id, $notification_id) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -8043,7 +5997,7 @@ public function getNotificationRequest($app_id, $notification_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -8061,38 +6015,36 @@ public function getNotificationRequest($app_id, $notification_id) } /** - * Operation getNotificationHistory + * Operation getApp * - * Notification History + * View an app * - * @param string $notification_id The \"id\" of the message found in the Notification object (required) - * @param \onesignal\client\model\GetNotificationRequestBody $get_notification_request_body get_notification_request_body (required) + * @param string $app_id An app id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getNotificationHistory($notification_id, $get_notification_request_body) + public function getApp($app_id) { - list($response) = $this->getNotificationHistoryWithHttpInfo($notification_id, $get_notification_request_body); + list($response) = $this->getAppWithHttpInfo($app_id); return $response; } /** - * Operation getNotificationHistoryWithHttpInfo + * Operation getAppWithHttpInfo * - * Notification History + * View an app * - * @param string $notification_id The \"id\" of the message found in the Notification object (required) - * @param \onesignal\client\model\GetNotificationRequestBody $get_notification_request_body (required) + * @param string $app_id An app id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getNotificationHistoryWithHttpInfo($notification_id, $get_notification_request_body) + public function getAppWithHttpInfo($app_id) { - $request = $this->getNotificationHistoryRequest($notification_id, $get_notification_request_body); + $request = $this->getAppRequest($app_id); try { $options = $this->createHttpClientOption(); @@ -8131,17 +6083,17 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi switch($statusCode) { case 200: - if ('\onesignal\client\model\NotificationHistorySuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\App' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\NotificationHistorySuccessResponse' !== 'string') { + if ('\onesignal\client\model\App' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationHistorySuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8161,23 +6113,23 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\NotificationHistorySuccessResponse'; + $returnType = '\onesignal\client\model\App'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8198,7 +6150,7 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\NotificationHistorySuccessResponse', + '\onesignal\client\model\App', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8214,7 +6166,7 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8225,19 +6177,18 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi } /** - * Operation getNotificationHistoryAsync + * Operation getAppAsync * - * Notification History + * View an app * - * @param string $notification_id The \"id\" of the message found in the Notification object (required) - * @param \onesignal\client\model\GetNotificationRequestBody $get_notification_request_body (required) + * @param string $app_id An app id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationHistoryAsync($notification_id, $get_notification_request_body) + public function getAppAsync($app_id) { - return $this->getNotificationHistoryAsyncWithHttpInfo($notification_id, $get_notification_request_body) + return $this->getAppAsyncWithHttpInfo($app_id) ->then( function ($response) { return $response[0]; @@ -8246,20 +6197,19 @@ function ($response) { } /** - * Operation getNotificationHistoryAsyncWithHttpInfo + * Operation getAppAsyncWithHttpInfo * - * Notification History + * View an app * - * @param string $notification_id The \"id\" of the message found in the Notification object (required) - * @param \onesignal\client\model\GetNotificationRequestBody $get_notification_request_body (required) + * @param string $app_id An app id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationHistoryAsyncWithHttpInfo($notification_id, $get_notification_request_body) + public function getAppAsyncWithHttpInfo($app_id) { - $returnType = '\onesignal\client\model\NotificationHistorySuccessResponse'; - $request = $this->getNotificationHistoryRequest($notification_id, $get_notification_request_body); + $returnType = '\onesignal\client\model\App'; + $request = $this->getAppRequest($app_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8298,30 +6248,23 @@ function ($exception) { } /** - * Create request for operation 'getNotificationHistory' + * Create request for operation 'getApp' * - * @param string $notification_id The \"id\" of the message found in the Notification object (required) - * @param \onesignal\client\model\GetNotificationRequestBody $get_notification_request_body (required) + * @param string $app_id An app id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getNotificationHistoryRequest($notification_id, $get_notification_request_body) + public function getAppRequest($app_id) { - // verify the required parameter 'notification_id' is set - if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $notification_id when calling getNotificationHistory' - ); - } - // verify the required parameter 'get_notification_request_body' is set - if ($get_notification_request_body === null || (is_array($get_notification_request_body) && count($get_notification_request_body) === 0)) { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_notification_request_body when calling getNotificationHistory' + 'Missing the required parameter $app_id when calling getApp' ); } - $resourcePath = '/notifications/{notification_id}/history'; + $resourcePath = '/apps/{app_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8331,10 +6274,10 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio // path params - if ($notification_id !== null) { + if ($app_id !== null) { $resourcePath = str_replace( - '{' . 'notification_id' . '}', - ObjectSerializer::toPathValue($notification_id), + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), $resourcePath ); } @@ -8347,18 +6290,12 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($get_notification_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($get_notification_request_body)); - } else { - $httpBody = $get_notification_request_body; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -8382,8 +6319,8 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getUserAuthKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getUserAuthKeyToken(); } $defaultHeaders = []; @@ -8392,7 +6329,7 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -8402,7 +6339,7 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8410,42 +6347,34 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio } /** - * Operation getNotifications + * Operation getApps * - * View notifications + * View apps * - * @param string $app_id The app ID that you want to view notifications from (required) - * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getNotifications($app_id, $limit = null, $offset = null, $kind = null) + public function getApps() { - list($response) = $this->getNotificationsWithHttpInfo($app_id, $limit, $offset, $kind); + list($response) = $this->getAppsWithHttpInfo(); return $response; } /** - * Operation getNotificationsWithHttpInfo + * Operation getAppsWithHttpInfo * - * View notifications + * View apps * - * @param string $app_id The app ID that you want to view notifications from (required) - * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) + public function getAppsWithHttpInfo() { - $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); + $request = $this->getAppsRequest(); try { $options = $this->createHttpClientOption(); @@ -8484,17 +6413,17 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n switch($statusCode) { case 200: - if ('\onesignal\client\model\NotificationSlice' === '\SplFileObject') { + if ('\onesignal\client\model\App[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\NotificationSlice' !== 'string') { + if ('\onesignal\client\model\App[]' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationSlice', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\App[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8514,23 +6443,23 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\NotificationSlice'; + $returnType = '\onesignal\client\model\App[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8551,7 +6480,7 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\NotificationSlice', + '\onesignal\client\model\App[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8567,7 +6496,7 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8578,21 +6507,17 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n } /** - * Operation getNotificationsAsync + * Operation getAppsAsync * - * View notifications + * View apps * - * @param string $app_id The app ID that you want to view notifications from (required) - * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationsAsync($app_id, $limit = null, $offset = null, $kind = null) + public function getAppsAsync() { - return $this->getNotificationsAsyncWithHttpInfo($app_id, $limit, $offset, $kind) + return $this->getAppsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -8601,22 +6526,18 @@ function ($response) { } /** - * Operation getNotificationsAsyncWithHttpInfo + * Operation getAppsAsyncWithHttpInfo * - * View notifications + * View apps * - * @param string $app_id The app ID that you want to view notifications from (required) - * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationsAsyncWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) + public function getAppsAsyncWithHttpInfo() { - $returnType = '\onesignal\client\model\NotificationSlice'; - $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); + $returnType = '\onesignal\client\model\App[]'; + $request = $this->getAppsRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8655,68 +6576,22 @@ function ($exception) { } /** - * Create request for operation 'getNotifications' + * Create request for operation 'getApps' * - * @param string $app_id The app ID that you want to view notifications from (required) - * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) - * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getNotificationsRequest($app_id, $limit = null, $offset = null, $kind = null) + public function getAppsRequest() { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getNotifications' - ); - } - $resourcePath = '/notifications'; + $resourcePath = '/apps'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $kind, - 'kind', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); @@ -8757,8 +6632,8 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getUserAuthKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getUserAuthKeyToken(); } $defaultHeaders = []; @@ -8767,7 +6642,7 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -8785,46 +6660,38 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, } /** - * Operation getOutcomes - * - * View Outcomes - * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) + * Operation getNotification + * + * View notification + * + * @param string $app_id app_id (required) + * @param string $notification_id notification_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getOutcomes($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) + public function getNotification($app_id, $notification_id) { - list($response) = $this->getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); + list($response) = $this->getNotificationWithHttpInfo($app_id, $notification_id); return $response; } /** - * Operation getOutcomesWithHttpInfo + * Operation getNotificationWithHttpInfo * - * View Outcomes + * View notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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 string $app_id (required) + * @param string $notification_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) + public function getNotificationWithHttpInfo($app_id, $notification_id) { - $request = $this->getOutcomesRequest($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); + $request = $this->getNotificationRequest($app_id, $notification_id); try { $options = $this->createHttpClientOption(); @@ -8863,17 +6730,17 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 switch($statusCode) { case 200: - if ('\onesignal\client\model\OutcomesData' === '\SplFileObject') { + if ('\onesignal\client\model\NotificationWithMeta' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\OutcomesData' !== 'string') { + if ('\onesignal\client\model\NotificationWithMeta' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\OutcomesData', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationWithMeta', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8887,29 +6754,44 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\OutcomesData'; + $returnType = '\onesignal\client\model\NotificationWithMeta'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -8930,7 +6812,7 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\OutcomesData', + '\onesignal\client\model\NotificationWithMeta', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8943,10 +6825,18 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8957,23 +6847,19 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 } /** - * Operation getOutcomesAsync + * Operation getNotificationAsync * - * View Outcomes + * View notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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 string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutcomesAsync($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) + public function getNotificationAsync($app_id, $notification_id) { - return $this->getOutcomesAsyncWithHttpInfo($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution) + return $this->getNotificationAsyncWithHttpInfo($app_id, $notification_id) ->then( function ($response) { return $response[0]; @@ -8982,24 +6868,20 @@ function ($response) { } /** - * Operation getOutcomesAsyncWithHttpInfo + * Operation getNotificationAsyncWithHttpInfo * - * View Outcomes + * View notification * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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 string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutcomesAsyncWithHttpInfo($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) + public function getNotificationAsyncWithHttpInfo($app_id, $notification_id) { - $returnType = '\onesignal\client\model\OutcomesData'; - $request = $this->getOutcomesRequest($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); + $returnType = '\onesignal\client\model\NotificationWithMeta'; + $request = $this->getNotificationRequest($app_id, $notification_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9038,34 +6920,30 @@ function ($exception) { } /** - * Create request for operation 'getOutcomes' + * Create request for operation 'getNotification' * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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 string $app_id (required) + * @param string $notification_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) + public function getNotificationRequest($app_id, $notification_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getOutcomes' + 'Missing the required parameter $app_id when calling getNotification' ); } - // verify the required parameter 'outcome_names' is set - if ($outcome_names === null || (is_array($outcome_names) && count($outcome_names) === 0)) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $outcome_names when calling getOutcomes' + 'Missing the required parameter $notification_id when calling getNotification' ); } - $resourcePath = '/apps/{app_id}/outcomes'; + $resourcePath = '/notifications/{notification_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9074,56 +6952,20 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $outcome_names, - 'outcome_names', // param base name + $app_id, + 'app_id', // param base name 'string', // openApiType 'form', // style true, // explode true // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $outcome_names2, - 'outcome_names[]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $outcome_time_range, - 'outcome_time_range', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $outcome_platforms, - 'outcome_platforms', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $outcome_attribution, - 'outcome_attribution', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params - if ($app_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'app_id' . '}', - ObjectSerializer::toPathValue($app_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -9165,8 +7007,8 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -9175,7 +7017,7 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -9193,40 +7035,38 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu } /** - * Operation getPlayer + * Operation getNotificationHistory * - * View device + * Notification History * - * @param string $app_id Your app_id for this device (required) - * @param string $player_id Player's OneSignal ID (required) - * @param string $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @param string $notification_id The \"id\" of the message found in the Notification object (required) + * @param \onesignal\client\model\GetNotificationHistoryRequestBody $get_notification_history_request_body get_notification_history_request_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\Player|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getPlayer($app_id, $player_id, $email_auth_hash = null) + public function getNotificationHistory($notification_id, $get_notification_history_request_body) { - list($response) = $this->getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash); + list($response) = $this->getNotificationHistoryWithHttpInfo($notification_id, $get_notification_history_request_body); return $response; } /** - * Operation getPlayerWithHttpInfo + * Operation getNotificationHistoryWithHttpInfo * - * View device + * Notification History * - * @param string $app_id Your app_id for this device (required) - * @param string $player_id Player's OneSignal ID (required) - * @param string $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @param string $notification_id The \"id\" of the message found in the Notification object (required) + * @param \onesignal\client\model\GetNotificationHistoryRequestBody $get_notification_history_request_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\Player|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = null) + public function getNotificationHistoryWithHttpInfo($notification_id, $get_notification_history_request_body) { - $request = $this->getPlayerRequest($app_id, $player_id, $email_auth_hash); + $request = $this->getNotificationHistoryRequest($notification_id, $get_notification_history_request_body); try { $options = $this->createHttpClientOption(); @@ -9265,17 +7105,17 @@ public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = nu switch($statusCode) { case 200: - if ('\onesignal\client\model\Player' === '\SplFileObject') { + if ('\onesignal\client\model\NotificationHistorySuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\Player' !== 'string') { + if ('\onesignal\client\model\NotificationHistorySuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\Player', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationHistorySuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9289,29 +7129,44 @@ public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = nu } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\Player'; + $returnType = '\onesignal\client\model\NotificationHistorySuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9332,7 +7187,7 @@ public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\Player', + '\onesignal\client\model\NotificationHistorySuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9345,10 +7200,18 @@ public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = nu ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9359,20 +7222,19 @@ public function getPlayerWithHttpInfo($app_id, $player_id, $email_auth_hash = nu } /** - * Operation getPlayerAsync + * Operation getNotificationHistoryAsync * - * View device + * Notification History * - * @param string $app_id Your app_id for this device (required) - * @param string $player_id Player's OneSignal ID (required) - * @param string $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @param string $notification_id The \"id\" of the message found in the Notification object (required) + * @param \onesignal\client\model\GetNotificationHistoryRequestBody $get_notification_history_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPlayerAsync($app_id, $player_id, $email_auth_hash = null) + public function getNotificationHistoryAsync($notification_id, $get_notification_history_request_body) { - return $this->getPlayerAsyncWithHttpInfo($app_id, $player_id, $email_auth_hash) + return $this->getNotificationHistoryAsyncWithHttpInfo($notification_id, $get_notification_history_request_body) ->then( function ($response) { return $response[0]; @@ -9381,21 +7243,20 @@ function ($response) { } /** - * Operation getPlayerAsyncWithHttpInfo + * Operation getNotificationHistoryAsyncWithHttpInfo * - * View device + * Notification History * - * @param string $app_id Your app_id for this device (required) - * @param string $player_id Player's OneSignal ID (required) - * @param string $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @param string $notification_id The \"id\" of the message found in the Notification object (required) + * @param \onesignal\client\model\GetNotificationHistoryRequestBody $get_notification_history_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPlayerAsyncWithHttpInfo($app_id, $player_id, $email_auth_hash = null) + public function getNotificationHistoryAsyncWithHttpInfo($notification_id, $get_notification_history_request_body) { - $returnType = '\onesignal\client\model\Player'; - $request = $this->getPlayerRequest($app_id, $player_id, $email_auth_hash); + $returnType = '\onesignal\client\model\NotificationHistorySuccessResponse'; + $request = $this->getNotificationHistoryRequest($notification_id, $get_notification_history_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9434,62 +7295,43 @@ function ($exception) { } /** - * Create request for operation 'getPlayer' + * Create request for operation 'getNotificationHistory' * - * @param string $app_id Your app_id for this device (required) - * @param string $player_id Player's OneSignal ID (required) - * @param string $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + * @param string $notification_id The \"id\" of the message found in the Notification object (required) + * @param \onesignal\client\model\GetNotificationHistoryRequestBody $get_notification_history_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) + public function getNotificationHistoryRequest($notification_id, $get_notification_history_request_body) { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getPlayer' + 'Missing the required parameter $notification_id when calling getNotificationHistory' ); } - // verify the required parameter 'player_id' is set - if ($player_id === null || (is_array($player_id) && count($player_id) === 0)) { + // verify the required parameter 'get_notification_history_request_body' is set + if ($get_notification_history_request_body === null || (is_array($get_notification_history_request_body) && count($get_notification_history_request_body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $player_id when calling getPlayer' + 'Missing the required parameter $get_notification_history_request_body when calling getNotificationHistory' ); } - $resourcePath = '/players/{player_id}'; + $resourcePath = '/notifications/{notification_id}/history'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $app_id, - 'app_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $email_auth_hash, - 'email_auth_hash', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params - if ($player_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'player_id' . '}', - ObjectSerializer::toPathValue($player_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -9502,12 +7344,18 @@ public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_notification_history_request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($get_notification_history_request_body)); + } else { + $httpBody = $get_notification_history_request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -9531,8 +7379,8 @@ public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -9541,7 +7389,7 @@ public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -9551,7 +7399,7 @@ public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -9559,40 +7407,42 @@ public function getPlayerRequest($app_id, $player_id, $email_auth_hash = null) } /** - * Operation getPlayers + * Operation getNotifications * - * View devices + * View notifications * - * @param string $app_id The app ID that you want to view players from (required) - * @param int $limit How many devices to return. Max is 300. Default is 300 (optional) - * @param int $offset Result offset. Default is 0. Results are sorted by id; (optional) + * @param string $app_id The app ID that you want to view notifications from (required) + * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\PlayerSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function getPlayers($app_id, $limit = null, $offset = null) + public function getNotifications($app_id, $limit = null, $offset = null, $kind = null) { - list($response) = $this->getPlayersWithHttpInfo($app_id, $limit, $offset); + list($response) = $this->getNotificationsWithHttpInfo($app_id, $limit, $offset, $kind); return $response; } /** - * Operation getPlayersWithHttpInfo + * Operation getNotificationsWithHttpInfo * - * View devices + * View notifications * - * @param string $app_id The app ID that you want to view players from (required) - * @param int $limit How many devices to return. Max is 300. Default is 300 (optional) - * @param int $offset Result offset. Default is 0. Results are sorted by id; (optional) + * @param string $app_id The app ID that you want to view notifications from (required) + * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\PlayerSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) + public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) { - $request = $this->getPlayersRequest($app_id, $limit, $offset); + $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); try { $options = $this->createHttpClientOption(); @@ -9631,17 +7481,17 @@ public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) switch($statusCode) { case 200: - if ('\onesignal\client\model\PlayerSlice' === '\SplFileObject') { + if ('\onesignal\client\model\NotificationSlice' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\PlayerSlice' !== 'string') { + if ('\onesignal\client\model\NotificationSlice' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\PlayerSlice', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\NotificationSlice', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9661,23 +7511,23 @@ public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\PlayerSlice'; + $returnType = '\onesignal\client\model\NotificationSlice'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -9698,7 +7548,7 @@ public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\PlayerSlice', + '\onesignal\client\model\NotificationSlice', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9714,7 +7564,7 @@ public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9725,20 +7575,21 @@ public function getPlayersWithHttpInfo($app_id, $limit = null, $offset = null) } /** - * Operation getPlayersAsync + * Operation getNotificationsAsync * - * View devices + * View notifications * - * @param string $app_id The app ID that you want to view players from (required) - * @param int $limit How many devices to return. Max is 300. Default is 300 (optional) - * @param int $offset Result offset. Default is 0. Results are sorted by id; (optional) + * @param string $app_id The app ID that you want to view notifications from (required) + * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPlayersAsync($app_id, $limit = null, $offset = null) + public function getNotificationsAsync($app_id, $limit = null, $offset = null, $kind = null) { - return $this->getPlayersAsyncWithHttpInfo($app_id, $limit, $offset) + return $this->getNotificationsAsyncWithHttpInfo($app_id, $limit, $offset, $kind) ->then( function ($response) { return $response[0]; @@ -9747,21 +7598,22 @@ function ($response) { } /** - * Operation getPlayersAsyncWithHttpInfo + * Operation getNotificationsAsyncWithHttpInfo * - * View devices + * View notifications * - * @param string $app_id The app ID that you want to view players from (required) - * @param int $limit How many devices to return. Max is 300. Default is 300 (optional) - * @param int $offset Result offset. Default is 0. Results are sorted by id; (optional) + * @param string $app_id The app ID that you want to view notifications from (required) + * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPlayersAsyncWithHttpInfo($app_id, $limit = null, $offset = null) + public function getNotificationsAsyncWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) { - $returnType = '\onesignal\client\model\PlayerSlice'; - $request = $this->getPlayersRequest($app_id, $limit, $offset); + $returnType = '\onesignal\client\model\NotificationSlice'; + $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9800,25 +7652,26 @@ function ($exception) { } /** - * Create request for operation 'getPlayers' + * Create request for operation 'getNotifications' * - * @param string $app_id The app ID that you want to view players from (required) - * @param int $limit How many devices to return. Max is 300. Default is 300 (optional) - * @param int $offset Result offset. Default is 0. Results are sorted by id; (optional) + * @param string $app_id The app ID that you want to view notifications from (required) + * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) + * @param int $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 int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPlayersRequest($app_id, $limit = null, $offset = null) + public function getNotificationsRequest($app_id, $limit = null, $offset = null, $kind = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getPlayers' + 'Missing the required parameter $app_id when calling getNotifications' ); } - $resourcePath = '/players'; + $resourcePath = '/notifications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9852,6 +7705,15 @@ public function getPlayersRequest($app_id, $limit = null, $offset = null) true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $kind, + 'kind', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -9892,8 +7754,8 @@ public function getPlayersRequest($app_id, $limit = null, $offset = null) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -9902,7 +7764,7 @@ public function getPlayersRequest($app_id, $limit = null, $offset = null) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -9920,38 +7782,46 @@ public function getPlayersRequest($app_id, $limit = null, $offset = null) } /** - * Operation identifyUserByAlias + * Operation getOutcomes * - * @param string $app_id app_id (required) - * @param string $alias_label alias_label (required) - * @param string $alias_id alias_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body user_identity_request_body (required) + * View Outcomes + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function identifyUserByAlias($app_id, $alias_label, $alias_id, $user_identity_request_body) + public function getOutcomes($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { - list($response) = $this->identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_request_body); + list($response) = $this->getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); return $response; } /** - * Operation identifyUserByAliasWithHttpInfo + * Operation getOutcomesWithHttpInfo * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * View Outcomes + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse200|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_request_body) + public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { - $request = $this->identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $user_identity_request_body); + $request = $this->getOutcomesRequest($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); try { $options = $this->createHttpClientOption(); @@ -9990,17 +7860,17 @@ public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id switch($statusCode) { case 200: - if ('\onesignal\client\model\InlineResponse200' === '\SplFileObject') { + if ('\onesignal\client\model\OutcomesData' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse200' !== 'string') { + if ('\onesignal\client\model\OutcomesData' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse200', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\OutcomesData', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10014,44 +7884,29 @@ public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\InlineResponse200'; + $returnType = '\onesignal\client\model\OutcomesData'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10072,7 +7927,7 @@ public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse200', + '\onesignal\client\model\OutcomesData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10085,18 +7940,10 @@ public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10107,19 +7954,23 @@ public function identifyUserByAliasWithHttpInfo($app_id, $alias_label, $alias_id } /** - * Operation identifyUserByAliasAsync + * Operation getOutcomesAsync * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * View Outcomes + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyUserByAliasAsync($app_id, $alias_label, $alias_id, $user_identity_request_body) + public function getOutcomesAsync($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { - return $this->identifyUserByAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_request_body) + return $this->getOutcomesAsyncWithHttpInfo($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution) ->then( function ($response) { return $response[0]; @@ -10128,20 +7979,24 @@ function ($response) { } /** - * Operation identifyUserByAliasAsyncWithHttpInfo + * Operation getOutcomesAsyncWithHttpInfo * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * View Outcomes + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyUserByAliasAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_request_body) + public function getOutcomesAsyncWithHttpInfo($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { - $returnType = '\onesignal\client\model\InlineResponse200'; - $request = $this->identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $user_identity_request_body); + $returnType = '\onesignal\client\model\OutcomesData'; + $request = $this->getOutcomesRequest($app_id, $outcome_names, $outcome_names2, $outcome_time_range, $outcome_platforms, $outcome_attribution); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10180,50 +8035,85 @@ function ($exception) { } /** - * Create request for operation 'identifyUserByAlias' + * Create request for operation 'getOutcomes' * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $outcome_names 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 string $outcome_names2 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 string $outcome_time_range 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 string $outcome_platforms 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 string $outcome_attribution 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $user_identity_request_body) + public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling identifyUserByAlias' - ); - } - // verify the required parameter 'alias_label' is set - if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling identifyUserByAlias' - ); - } - // verify the required parameter 'alias_id' is set - if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling identifyUserByAlias' + 'Missing the required parameter $app_id when calling getOutcomes' ); } - // verify the required parameter 'user_identity_request_body' is set - if ($user_identity_request_body === null || (is_array($user_identity_request_body) && count($user_identity_request_body) === 0)) { + // verify the required parameter 'outcome_names' is set + if ($outcome_names === null || (is_array($outcome_names) && count($outcome_names) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_identity_request_body when calling identifyUserByAlias' + 'Missing the required parameter $outcome_names when calling getOutcomes' ); } - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'; + $resourcePath = '/apps/{app_id}/outcomes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $outcome_names, + 'outcome_names', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $outcome_names2, + 'outcome_names[]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $outcome_time_range, + 'outcome_time_range', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $outcome_platforms, + 'outcome_platforms', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $outcome_attribution, + 'outcome_attribution', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -10234,22 +8124,6 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us $resourcePath ); } - // path params - if ($alias_label !== null) { - $resourcePath = str_replace( - '{' . 'alias_label' . '}', - ObjectSerializer::toPathValue($alias_label), - $resourcePath - ); - } - // path params - if ($alias_id !== null) { - $resourcePath = str_replace( - '{' . 'alias_id' . '}', - ObjectSerializer::toPathValue($alias_id), - $resourcePath - ); - } if ($multipart) { @@ -10259,18 +8133,12 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($user_identity_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user_identity_request_body)); - } else { - $httpBody = $user_identity_request_body; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -10294,8 +8162,8 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -10304,7 +8172,7 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -10314,7 +8182,7 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10322,36 +8190,40 @@ public function identifyUserByAliasRequest($app_id, $alias_label, $alias_id, $us } /** - * Operation identifyUserBySubscriptionId + * Operation getSegments * - * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body user_identity_request_body (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function identifyUserBySubscriptionId($app_id, $subscription_id, $user_identity_request_body) + public function getSegments($app_id, $offset = null, $limit = null) { - list($response) = $this->identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_id, $user_identity_request_body); + list($response) = $this->getSegmentsWithHttpInfo($app_id, $offset, $limit); return $response; } /** - * Operation identifyUserBySubscriptionIdWithHttpInfo + * Operation getSegmentsWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_id, $user_identity_request_body) + public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) { - $request = $this->identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $user_identity_request_body); + $request = $this->getSegmentsRequest($app_id, $offset, $limit); try { $options = $this->createHttpClientOption(); @@ -10389,18 +8261,18 @@ public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_ } switch($statusCode) { - case 200: - if ('\onesignal\client\model\UserIdentityResponse' === '\SplFileObject') { + case 201: + if ('\onesignal\client\model\GetSegmentsSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UserIdentityResponse' !== 'string') { + if ('\onesignal\client\model\GetSegmentsSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GetSegmentsSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10414,44 +8286,29 @@ public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_ } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\UserIdentityResponse'; + $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10469,10 +8326,10 @@ public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_ } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UserIdentityResponse', + '\onesignal\client\model\GetSegmentsSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10485,18 +8342,10 @@ public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_ ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10507,18 +8356,20 @@ public function identifyUserBySubscriptionIdWithHttpInfo($app_id, $subscription_ } /** - * Operation identifyUserBySubscriptionIdAsync + * Operation getSegmentsAsync * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyUserBySubscriptionIdAsync($app_id, $subscription_id, $user_identity_request_body) + public function getSegmentsAsync($app_id, $offset = null, $limit = null) { - return $this->identifyUserBySubscriptionIdAsyncWithHttpInfo($app_id, $subscription_id, $user_identity_request_body) + return $this->getSegmentsAsyncWithHttpInfo($app_id, $offset, $limit) ->then( function ($response) { return $response[0]; @@ -10527,19 +8378,21 @@ function ($response) { } /** - * Operation identifyUserBySubscriptionIdAsyncWithHttpInfo + * Operation getSegmentsAsyncWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyUserBySubscriptionIdAsyncWithHttpInfo($app_id, $subscription_id, $user_identity_request_body) + public function getSegmentsAsyncWithHttpInfo($app_id, $offset = null, $limit = null) { - $returnType = '\onesignal\client\model\UserIdentityResponse'; - $request = $this->identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $user_identity_request_body); + $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; + $request = $this->getSegmentsRequest($app_id, $offset, $limit); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10578,43 +8431,49 @@ function ($exception) { } /** - * Create request for operation 'identifyUserBySubscriptionId' + * Create request for operation 'getSegments' * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\UserIdentityRequestBody $user_identity_request_body (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $user_identity_request_body) + public function getSegmentsRequest($app_id, $offset = null, $limit = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling identifyUserBySubscriptionId' - ); - } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling identifyUserBySubscriptionId' - ); - } - // verify the required parameter 'user_identity_request_body' is set - if ($user_identity_request_body === null || (is_array($user_identity_request_body) && count($user_identity_request_body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user_identity_request_body when calling identifyUserBySubscriptionId' + 'Missing the required parameter $app_id when calling getSegments' ); } - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'; + $resourcePath = '/apps/{app_id}/segments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -10625,14 +8484,6 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ $resourcePath ); } - // path params - if ($subscription_id !== null) { - $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), - $resourcePath - ); - } if ($multipart) { @@ -10642,18 +8493,12 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($user_identity_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user_identity_request_body)); - } else { - $httpBody = $user_identity_request_body; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -10677,8 +8522,8 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -10687,7 +8532,7 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -10697,7 +8542,7 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10705,36 +8550,36 @@ public function identifyUserBySubscriptionIdRequest($app_id, $subscription_id, $ } /** - * Operation transferSubscription + * Operation getUser * * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body transfer_subscription_request_body (required) + * @param string $alias_label alias_label (required) + * @param string $alias_id alias_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body) + public function getUser($app_id, $alias_label, $alias_id) { - list($response) = $this->transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body); + list($response) = $this->getUserWithHttpInfo($app_id, $alias_label, $alias_id); return $response; } /** - * Operation transferSubscriptionWithHttpInfo + * Operation getUserWithHttpInfo * * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) { - $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + $request = $this->getUserRequest($app_id, $alias_label, $alias_id); try { $options = $this->createHttpClientOption(); @@ -10773,17 +8618,17 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra switch($statusCode) { case 200: - if ('\onesignal\client\model\UserIdentityResponse' === '\SplFileObject') { + if ('\onesignal\client\model\User' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UserIdentityResponse' !== 'string') { + if ('\onesignal\client\model\User' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\User', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10802,7 +8647,7 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra $response->getStatusCode(), $response->getHeaders() ]; - case 409: + case 404: if ('\onesignal\client\model\GenericError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10818,23 +8663,23 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\UserIdentityResponse'; + $returnType = '\onesignal\client\model\User'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10855,7 +8700,7 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UserIdentityResponse', + '\onesignal\client\model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10868,7 +8713,7 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra ); $e->setResponseObject($data); break; - case 409: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\onesignal\client\model\GenericError', @@ -10879,7 +8724,7 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10890,18 +8735,18 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra } /** - * Operation transferSubscriptionAsync + * Operation getUserAsync * * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferSubscriptionAsync($app_id, $subscription_id, $transfer_subscription_request_body) + public function getUserAsync($app_id, $alias_label, $alias_id) { - return $this->transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + return $this->getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) ->then( function ($response) { return $response[0]; @@ -10910,19 +8755,19 @@ function ($response) { } /** - * Operation transferSubscriptionAsyncWithHttpInfo + * Operation getUserAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + public function getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) { - $returnType = '\onesignal\client\model\UserIdentityResponse'; - $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + $returnType = '\onesignal\client\model\User'; + $request = $this->getUserRequest($app_id, $alias_label, $alias_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10961,37 +8806,37 @@ function ($exception) { } /** - * Create request for operation 'transferSubscription' + * Create request for operation 'getUser' * * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body) + public function getUserRequest($app_id, $alias_label, $alias_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling transferSubscription' + 'Missing the required parameter $app_id when calling getUser' ); } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + // verify the required parameter 'alias_label' is set + if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling transferSubscription' + 'Missing the required parameter $alias_label when calling getUser' ); } - // verify the required parameter 'transfer_subscription_request_body' is set - if ($transfer_subscription_request_body === null || (is_array($transfer_subscription_request_body) && count($transfer_subscription_request_body) === 0)) { + // verify the required parameter 'alias_id' is set + if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transfer_subscription_request_body when calling transferSubscription' + 'Missing the required parameter $alias_id when calling getUser' ); } - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/owner'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11009,10 +8854,18 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer ); } // path params - if ($subscription_id !== null) { + if ($alias_label !== null) { $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), + '{' . 'alias_label' . '}', + ObjectSerializer::toPathValue($alias_label), + $resourcePath + ); + } + // path params + if ($alias_id !== null) { + $resourcePath = str_replace( + '{' . 'alias_id' . '}', + ObjectSerializer::toPathValue($alias_id), $resourcePath ); } @@ -11025,18 +8878,12 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($transfer_subscription_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($transfer_subscription_request_body)); - } else { - $httpBody = $transfer_subscription_request_body; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -11060,8 +8907,8 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -11070,7 +8917,7 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -11080,7 +8927,7 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -11088,38 +8935,36 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } /** - * Operation updateApp - * - * Update an app + * Operation transferSubscription * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app app (required) + * @param string $app_id app_id (required) + * @param string $subscription_id subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body transfer_subscription_request_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function updateApp($app_id, $app) + public function transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body) { - list($response) = $this->updateAppWithHttpInfo($app_id, $app); + list($response) = $this->transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body); return $response; } /** - * Operation updateAppWithHttpInfo - * - * Update an app + * Operation transferSubscriptionWithHttpInfo * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function updateAppWithHttpInfo($app_id, $app) + public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) { - $request = $this->updateAppRequest($app_id, $app); + $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); try { $options = $this->createHttpClientOption(); @@ -11158,17 +9003,17 @@ public function updateAppWithHttpInfo($app_id, $app) switch($statusCode) { case 200: - if ('\onesignal\client\model\App' === '\SplFileObject') { + if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\App' !== 'string') { + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11182,29 +9027,59 @@ public function updateAppWithHttpInfo($app_id, $app) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\App'; + $returnType = '\onesignal\client\model\UserIdentityBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11225,7 +9100,7 @@ public function updateAppWithHttpInfo($app_id, $app) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\App', + '\onesignal\client\model\UserIdentityBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11238,10 +9113,26 @@ public function updateAppWithHttpInfo($app_id, $app) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11252,19 +9143,18 @@ public function updateAppWithHttpInfo($app_id, $app) } /** - * Operation updateAppAsync - * - * Update an app + * Operation transferSubscriptionAsync * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAppAsync($app_id, $app) + public function transferSubscriptionAsync($app_id, $subscription_id, $transfer_subscription_request_body) { - return $this->updateAppAsyncWithHttpInfo($app_id, $app) + return $this->transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) ->then( function ($response) { return $response[0]; @@ -11273,20 +9163,19 @@ function ($response) { } /** - * Operation updateAppAsyncWithHttpInfo - * - * Update an app + * Operation transferSubscriptionAsyncWithHttpInfo * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAppAsyncWithHttpInfo($app_id, $app) + public function transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) { - $returnType = '\onesignal\client\model\App'; - $request = $this->updateAppRequest($app_id, $app); + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11325,30 +9214,37 @@ function ($exception) { } /** - * Create request for operation 'updateApp' + * Create request for operation 'transferSubscription' * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateAppRequest($app_id, $app) + public function transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updateApp' + 'Missing the required parameter $app_id when calling transferSubscription' + ); + } + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_id when calling transferSubscription' ); } - // verify the required parameter 'app' is set - if ($app === null || (is_array($app) && count($app) === 0)) { + // verify the required parameter 'transfer_subscription_request_body' is set + if ($transfer_subscription_request_body === null || (is_array($transfer_subscription_request_body) && count($transfer_subscription_request_body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app when calling updateApp' + 'Missing the required parameter $transfer_subscription_request_body when calling transferSubscription' ); } - $resourcePath = '/apps/{app_id}'; + $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/owner'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11365,6 +9261,14 @@ public function updateAppRequest($app_id, $app) $resourcePath ); } + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } if ($multipart) { @@ -11379,11 +9283,11 @@ public function updateAppRequest($app_id, $app) } // for model (json/xml) - if (isset($app)) { + if (isset($transfer_subscription_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($transfer_subscription_request_body)); } else { - $httpBody = $app; + $httpBody = $transfer_subscription_request_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11409,8 +9313,8 @@ public function updateAppRequest($app_id, $app) } } - if (!empty($this->config->getUserKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getUserKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -11419,7 +9323,7 @@ public function updateAppRequest($app_id, $app) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -11429,7 +9333,7 @@ public function updateAppRequest($app_id, $app) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -11437,40 +9341,40 @@ public function updateAppRequest($app_id, $app) } /** - * Operation updateLiveActivity + * Operation unsubscribeEmailWithToken * - * Update a Live Activity via Push + * Unsubscribe with token * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request update_live_activity_request (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function updateLiveActivity($app_id, $activity_id, $update_live_activity_request) + public function unsubscribeEmailWithToken($app_id, $notification_id, $token) { - list($response) = $this->updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request); + list($response) = $this->unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token); return $response; } /** - * Operation updateLiveActivityWithHttpInfo + * Operation unsubscribeEmailWithTokenWithHttpInfo * - * Update a Live Activity via Push + * Unsubscribe with token * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token) { - $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); + $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); try { $options = $this->createHttpClientOption(); @@ -11508,18 +9412,18 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li } switch($statusCode) { - case 200: - if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' === '\SplFileObject') { + case 202: + if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' !== 'string') { + if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdateLiveActivitySuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11539,23 +9443,23 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11573,10 +9477,10 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UpdateLiveActivitySuccessResponse', + '\onesignal\client\model\GenericSuccessBoolResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11592,7 +9496,7 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11603,20 +9507,20 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li } /** - * Operation updateLiveActivityAsync + * Operation unsubscribeEmailWithTokenAsync * - * Update a Live Activity via Push + * Unsubscribe with token * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLiveActivityAsync($app_id, $activity_id, $update_live_activity_request) + public function unsubscribeEmailWithTokenAsync($app_id, $notification_id, $token) { - return $this->updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + return $this->unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) ->then( function ($response) { return $response[0]; @@ -11625,21 +9529,21 @@ function ($response) { } /** - * Operation updateLiveActivityAsyncWithHttpInfo + * Operation unsubscribeEmailWithTokenAsyncWithHttpInfo * - * Update a Live Activity via Push + * Unsubscribe with token * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + public function unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) { - $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; - $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11678,43 +9582,52 @@ function ($exception) { } /** - * Create request for operation 'updateLiveActivity' + * Create request for operation 'unsubscribeEmailWithToken' * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request) + public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updateLiveActivity' + 'Missing the required parameter $app_id when calling unsubscribeEmailWithToken' ); } - // verify the required parameter 'activity_id' is set - if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $activity_id when calling updateLiveActivity' + 'Missing the required parameter $notification_id when calling unsubscribeEmailWithToken' ); } - // verify the required parameter 'update_live_activity_request' is set - if ($update_live_activity_request === null || (is_array($update_live_activity_request) && count($update_live_activity_request) === 0)) { + // verify the required parameter 'token' is set + if ($token === null || (is_array($token) && count($token) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_live_activity_request when calling updateLiveActivity' + 'Missing the required parameter $token when calling unsubscribeEmailWithToken' ); } - $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/notifications'; + $resourcePath = '/apps/{app_id}/notifications/{notification_id}/unsubscribe'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $token, + 'token', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -11726,10 +9639,10 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac ); } // path params - if ($activity_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'activity_id' . '}', - ObjectSerializer::toPathValue($activity_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -11742,18 +9655,12 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) - if (isset($update_live_activity_request)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_live_activity_request)); - } else { - $httpBody = $update_live_activity_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -11777,8 +9684,8 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -11787,7 +9694,7 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -11805,38 +9712,38 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } /** - * Operation updatePlayer + * Operation updateApp * - * Edit device + * Update an app * - * @param string $player_id Player's OneSignal ID (required) - * @param \onesignal\client\model\Player $player player (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app app (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UpdatePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function updatePlayer($player_id, $player) + public function updateApp($app_id, $app) { - list($response) = $this->updatePlayerWithHttpInfo($player_id, $player); + list($response) = $this->updateAppWithHttpInfo($app_id, $app); return $response; } /** - * Operation updatePlayerWithHttpInfo + * Operation updateAppWithHttpInfo * - * Edit device + * Update an app * - * @param string $player_id Player's OneSignal ID (required) - * @param \onesignal\client\model\Player $player (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UpdatePlayerSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePlayerWithHttpInfo($player_id, $player) + public function updateAppWithHttpInfo($app_id, $app) { - $request = $this->updatePlayerRequest($player_id, $player); + $request = $this->updateAppRequest($app_id, $app); try { $options = $this->createHttpClientOption(); @@ -11875,17 +9782,17 @@ public function updatePlayerWithHttpInfo($player_id, $player) switch($statusCode) { case 200: - if ('\onesignal\client\model\UpdatePlayerSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\App' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UpdatePlayerSuccessResponse' !== 'string') { + if ('\onesignal\client\model\App' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdatePlayerSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11899,44 +9806,29 @@ public function updatePlayerWithHttpInfo($player_id, $player) } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\UpdatePlayerSuccessResponse'; + $returnType = '\onesignal\client\model\App'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11957,7 +9849,7 @@ public function updatePlayerWithHttpInfo($player_id, $player) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UpdatePlayerSuccessResponse', + '\onesignal\client\model\App', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11970,18 +9862,10 @@ public function updatePlayerWithHttpInfo($player_id, $player) ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11992,19 +9876,19 @@ public function updatePlayerWithHttpInfo($player_id, $player) } /** - * Operation updatePlayerAsync + * Operation updateAppAsync * - * Edit device + * Update an app * - * @param string $player_id Player's OneSignal ID (required) - * @param \onesignal\client\model\Player $player (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePlayerAsync($player_id, $player) + public function updateAppAsync($app_id, $app) { - return $this->updatePlayerAsyncWithHttpInfo($player_id, $player) + return $this->updateAppAsyncWithHttpInfo($app_id, $app) ->then( function ($response) { return $response[0]; @@ -12013,20 +9897,20 @@ function ($response) { } /** - * Operation updatePlayerAsyncWithHttpInfo + * Operation updateAppAsyncWithHttpInfo * - * Edit device + * Update an app * - * @param string $player_id Player's OneSignal ID (required) - * @param \onesignal\client\model\Player $player (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePlayerAsyncWithHttpInfo($player_id, $player) + public function updateAppAsyncWithHttpInfo($app_id, $app) { - $returnType = '\onesignal\client\model\UpdatePlayerSuccessResponse'; - $request = $this->updatePlayerRequest($player_id, $player); + $returnType = '\onesignal\client\model\App'; + $request = $this->updateAppRequest($app_id, $app); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12065,30 +9949,30 @@ function ($exception) { } /** - * Create request for operation 'updatePlayer' + * Create request for operation 'updateApp' * - * @param string $player_id Player's OneSignal ID (required) - * @param \onesignal\client\model\Player $player (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePlayerRequest($player_id, $player) + public function updateAppRequest($app_id, $app) { - // verify the required parameter 'player_id' is set - if ($player_id === null || (is_array($player_id) && count($player_id) === 0)) { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $player_id when calling updatePlayer' + 'Missing the required parameter $app_id when calling updateApp' ); } - // verify the required parameter 'player' is set - if ($player === null || (is_array($player) && count($player) === 0)) { + // verify the required parameter 'app' is set + if ($app === null || (is_array($app) && count($app) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $player when calling updatePlayer' + 'Missing the required parameter $app when calling updateApp' ); } - $resourcePath = '/players/{player_id}'; + $resourcePath = '/apps/{app_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12098,10 +9982,10 @@ public function updatePlayerRequest($player_id, $player) // path params - if ($player_id !== null) { + if ($app_id !== null) { $resourcePath = str_replace( - '{' . 'player_id' . '}', - ObjectSerializer::toPathValue($player_id), + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), $resourcePath ); } @@ -12119,11 +10003,11 @@ public function updatePlayerRequest($player_id, $player) } // for model (json/xml) - if (isset($player)) { + if (isset($app)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($player)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); } else { - $httpBody = $player; + $httpBody = $app; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12149,8 +10033,8 @@ public function updatePlayerRequest($player_id, $player) } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getUserAuthKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getUserAuthKeyToken(); } $defaultHeaders = []; @@ -12159,7 +10043,7 @@ public function updatePlayerRequest($player_id, $player) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -12177,40 +10061,40 @@ public function updatePlayerRequest($player_id, $player) } /** - * Operation updatePlayerTags + * Operation updateLiveActivity * - * Edit tags with external user id + * Update a Live Activity via Push * - * @param string $app_id The OneSignal App ID the user record is found under. (required) - * @param string $external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param \onesignal\client\model\UpdatePlayerTagsRequestBody $update_player_tags_request_body update_player_tags_request_body (optional) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request update_live_activity_request (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UpdatePlayerTagsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ - public function updatePlayerTags($app_id, $external_user_id, $update_player_tags_request_body = null) + public function updateLiveActivity($app_id, $activity_id, $update_live_activity_request) { - list($response) = $this->updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update_player_tags_request_body); + list($response) = $this->updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request); return $response; } /** - * Operation updatePlayerTagsWithHttpInfo + * Operation updateLiveActivityWithHttpInfo * - * Edit tags with external user id + * Update a Live Activity via Push * - * @param string $app_id The OneSignal App ID the user record is found under. (required) - * @param string $external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param \onesignal\client\model\UpdatePlayerTagsRequestBody $update_player_tags_request_body (optional) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UpdatePlayerTagsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update_player_tags_request_body = null) + public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request) { - $request = $this->updatePlayerTagsRequest($app_id, $external_user_id, $update_player_tags_request_body); + $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); try { $options = $this->createHttpClientOption(); @@ -12249,17 +10133,17 @@ public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update switch($statusCode) { case 200: - if ('\onesignal\client\model\UpdatePlayerTagsSuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UpdatePlayerTagsSuccessResponse' !== 'string') { + if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdatePlayerTagsSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdateLiveActivitySuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12273,44 +10157,29 @@ public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\UpdatePlayerTagsSuccessResponse'; + $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12331,7 +10200,7 @@ public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UpdatePlayerTagsSuccessResponse', + '\onesignal\client\model\UpdateLiveActivitySuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12344,18 +10213,10 @@ public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12366,20 +10227,20 @@ public function updatePlayerTagsWithHttpInfo($app_id, $external_user_id, $update } /** - * Operation updatePlayerTagsAsync + * Operation updateLiveActivityAsync * - * Edit tags with external user id + * Update a Live Activity via Push * - * @param string $app_id The OneSignal App ID the user record is found under. (required) - * @param string $external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param \onesignal\client\model\UpdatePlayerTagsRequestBody $update_player_tags_request_body (optional) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePlayerTagsAsync($app_id, $external_user_id, $update_player_tags_request_body = null) + public function updateLiveActivityAsync($app_id, $activity_id, $update_live_activity_request) { - return $this->updatePlayerTagsAsyncWithHttpInfo($app_id, $external_user_id, $update_player_tags_request_body) + return $this->updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) ->then( function ($response) { return $response[0]; @@ -12388,21 +10249,21 @@ function ($response) { } /** - * Operation updatePlayerTagsAsyncWithHttpInfo + * Operation updateLiveActivityAsyncWithHttpInfo * - * Edit tags with external user id + * Update a Live Activity via Push * - * @param string $app_id The OneSignal App ID the user record is found under. (required) - * @param string $external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param \onesignal\client\model\UpdatePlayerTagsRequestBody $update_player_tags_request_body (optional) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePlayerTagsAsyncWithHttpInfo($app_id, $external_user_id, $update_player_tags_request_body = null) + public function updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) { - $returnType = '\onesignal\client\model\UpdatePlayerTagsSuccessResponse'; - $request = $this->updatePlayerTagsRequest($app_id, $external_user_id, $update_player_tags_request_body); + $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; + $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12441,31 +10302,37 @@ function ($exception) { } /** - * Create request for operation 'updatePlayerTags' + * Create request for operation 'updateLiveActivity' * - * @param string $app_id The OneSignal App ID the user record is found under. (required) - * @param string $external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. (required) - * @param \onesignal\client\model\UpdatePlayerTagsRequestBody $update_player_tags_request_body (optional) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePlayerTagsRequest($app_id, $external_user_id, $update_player_tags_request_body = null) + public function updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updatePlayerTags' + 'Missing the required parameter $app_id when calling updateLiveActivity' + ); + } + // verify the required parameter 'activity_id' is set + if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $activity_id when calling updateLiveActivity' ); } - // verify the required parameter 'external_user_id' is set - if ($external_user_id === null || (is_array($external_user_id) && count($external_user_id) === 0)) { + // verify the required parameter 'update_live_activity_request' is set + if ($update_live_activity_request === null || (is_array($update_live_activity_request) && count($update_live_activity_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $external_user_id when calling updatePlayerTags' + 'Missing the required parameter $update_live_activity_request when calling updateLiveActivity' ); } - $resourcePath = '/apps/{app_id}/users/{external_user_id}'; + $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/notifications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12483,10 +10350,10 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play ); } // path params - if ($external_user_id !== null) { + if ($activity_id !== null) { $resourcePath = str_replace( - '{' . 'external_user_id' . '}', - ObjectSerializer::toPathValue($external_user_id), + '{' . 'activity_id' . '}', + ObjectSerializer::toPathValue($activity_id), $resourcePath ); } @@ -12504,11 +10371,11 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play } // for model (json/xml) - if (isset($update_player_tags_request_body)) { + if (isset($update_live_activity_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_player_tags_request_body)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_live_activity_request)); } else { - $httpBody = $update_player_tags_request_body; + $httpBody = $update_live_activity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12534,8 +10401,8 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -12544,7 +10411,7 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -12554,7 +10421,7 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -12566,15 +10433,15 @@ public function updatePlayerTagsRequest($app_id, $external_user_id, $update_play * * @param string $app_id app_id (required) * @param string $subscription_id subscription_id (required) - * @param \onesignal\client\model\UpdateSubscriptionRequestBody $update_subscription_request_body update_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body subscription_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateSubscription($app_id, $subscription_id, $update_subscription_request_body) + public function updateSubscription($app_id, $subscription_id, $subscription_body) { - $this->updateSubscriptionWithHttpInfo($app_id, $subscription_id, $update_subscription_request_body); + $this->updateSubscriptionWithHttpInfo($app_id, $subscription_id, $subscription_body); } /** @@ -12582,15 +10449,15 @@ public function updateSubscription($app_id, $subscription_id, $update_subscripti * * @param string $app_id (required) * @param string $subscription_id (required) - * @param \onesignal\client\model\UpdateSubscriptionRequestBody $update_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $update_subscription_request_body) + public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $subscription_body) { - $request = $this->updateSubscriptionRequest($app_id, $subscription_id, $update_subscription_request_body); + $request = $this->updateSubscriptionRequest($app_id, $subscription_id, $subscription_body); try { $options = $this->createHttpClientOption(); @@ -12639,6 +10506,14 @@ public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $updat ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12650,7 +10525,7 @@ public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $updat case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12665,14 +10540,14 @@ public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $updat * * @param string $app_id (required) * @param string $subscription_id (required) - * @param \onesignal\client\model\UpdateSubscriptionRequestBody $update_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateSubscriptionAsync($app_id, $subscription_id, $update_subscription_request_body) + public function updateSubscriptionAsync($app_id, $subscription_id, $subscription_body) { - return $this->updateSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $update_subscription_request_body) + return $this->updateSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $subscription_body) ->then( function ($response) { return $response[0]; @@ -12685,15 +10560,15 @@ function ($response) { * * @param string $app_id (required) * @param string $subscription_id (required) - * @param \onesignal\client\model\UpdateSubscriptionRequestBody $update_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $update_subscription_request_body) + public function updateSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $subscription_body) { $returnType = ''; - $request = $this->updateSubscriptionRequest($app_id, $subscription_id, $update_subscription_request_body); + $request = $this->updateSubscriptionRequest($app_id, $subscription_id, $subscription_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12723,12 +10598,12 @@ function ($exception) { * * @param string $app_id (required) * @param string $subscription_id (required) - * @param \onesignal\client\model\UpdateSubscriptionRequestBody $update_subscription_request_body (required) + * @param \onesignal\client\model\SubscriptionBody $subscription_body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateSubscriptionRequest($app_id, $subscription_id, $update_subscription_request_body) + public function updateSubscriptionRequest($app_id, $subscription_id, $subscription_body) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { @@ -12742,10 +10617,10 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $update_sub 'Missing the required parameter $subscription_id when calling updateSubscription' ); } - // verify the required parameter 'update_subscription_request_body' is set - if ($update_subscription_request_body === null || (is_array($update_subscription_request_body) && count($update_subscription_request_body) === 0)) { + // verify the required parameter 'subscription_body' is set + if ($subscription_body === null || (is_array($subscription_body) && count($subscription_body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_subscription_request_body when calling updateSubscription' + 'Missing the required parameter $subscription_body when calling updateSubscription' ); } @@ -12788,11 +10663,11 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $update_sub } // for model (json/xml) - if (isset($update_subscription_request_body)) { + if (isset($subscription_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request_body)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_body)); } else { - $httpBody = $update_subscription_request_body; + $httpBody = $subscription_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12818,8 +10693,8 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $update_sub } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -12828,7 +10703,7 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $update_sub } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, @@ -12855,7 +10730,7 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $update_sub * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\InlineResponse202|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError + * @return \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError */ public function updateUser($app_id, $alias_label, $alias_id, $update_user_request) { @@ -12873,7 +10748,7 @@ public function updateUser($app_id, $alias_label, $alias_id, $update_user_reques * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\InlineResponse202|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimiterError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update_user_request) { @@ -12916,17 +10791,17 @@ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update switch($statusCode) { case 202: - if ('\onesignal\client\model\InlineResponse202' === '\SplFileObject') { + if ('\onesignal\client\model\PropertiesBody' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\InlineResponse202' !== 'string') { + if ('\onesignal\client\model\PropertiesBody' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\InlineResponse202', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\PropertiesBody', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12961,23 +10836,23 @@ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update $response->getHeaders() ]; case 429: - if ('\onesignal\client\model\RateLimiterError' === '\SplFileObject') { + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimiterError' !== 'string') { + if ('\onesignal\client\model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimiterError', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\onesignal\client\model\InlineResponse202'; + $returnType = '\onesignal\client\model\PropertiesBody'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12998,7 +10873,7 @@ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\InlineResponse202', + '\onesignal\client\model\PropertiesBody', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13022,7 +10897,7 @@ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\RateLimiterError', + '\onesignal\client\model\RateLimitError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13066,7 +10941,7 @@ function ($response) { */ public function updateUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id, $update_user_request) { - $returnType = '\onesignal\client\model\InlineResponse202'; + $returnType = '\onesignal\client\model\PropertiesBody'; $request = $this->updateUserRequest($app_id, $alias_label, $alias_id, $update_user_request); return $this->client @@ -13220,8 +11095,8 @@ public function updateUserRequest($app_id, $alias_label, $alias_id, $update_user } } - if (!empty($this->config->getAppKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getAppKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -13230,7 +11105,7 @@ public function updateUserRequest($app_id, $alias_label, $alias_id, $update_user } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=2.2.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.0.0-beta1'; $headers = array_merge( $defaultHeaders, diff --git a/lib/model/App.php b/lib/model/App.php index c064990..b6e01c4 100644 --- a/lib/model/App.php +++ b/lib/model/App.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/BasicNotification.php b/lib/model/BasicNotification.php index 4385f1b..feb7790 100644 --- a/lib/model/BasicNotification.php +++ b/lib/model/BasicNotification.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -62,8 +62,7 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPITypes = [ 'included_segments' => 'string[]', 'excluded_segments' => 'string[]', - 'include_player_ids' => 'string[]', - 'include_external_user_ids' => 'string[]', + 'include_subscription_ids' => 'string[]', 'include_email_tokens' => 'string[]', 'include_phone_numbers' => 'string[]', 'include_ios_tokens' => 'string[]', @@ -72,7 +71,7 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'include_chrome_reg_ids' => 'string[]', 'include_chrome_web_reg_ids' => 'string[]', 'include_android_reg_ids' => 'string[]', - 'include_aliases' => '\onesignal\client\model\PlayerNotificationTargetIncludeAliases', + 'include_aliases' => 'array', 'target_channel' => 'string', 'id' => 'string', 'value' => 'int', @@ -88,13 +87,12 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'is_wp_wns' => 'bool', 'is_adm' => 'bool', 'is_chrome' => 'bool', - 'channel_for_external_user_ids' => 'string', 'app_id' => 'string', 'external_id' => 'string', 'idempotency_key' => 'string', - 'contents' => 'StringMap', - 'headings' => 'StringMap', - 'subtitle' => 'StringMap', + 'contents' => 'LanguageStringMap', + 'headings' => 'LanguageStringMap', + 'subtitle' => 'LanguageStringMap', 'data' => 'object', 'huawei_msg_type' => 'string', 'url' => 'string', @@ -111,7 +109,7 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'chrome_big_picture' => 'string', 'chrome_web_image' => 'string', 'buttons' => '\onesignal\client\model\Button[]', - 'web_buttons' => '\onesignal\client\model\Button[]', + 'web_buttons' => '\onesignal\client\model\WebButton[]', 'ios_category' => 'string', 'android_channel_id' => 'string', 'huawei_channel_id' => 'string', @@ -157,6 +155,8 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'thread_id' => 'string', 'summary_arg' => 'string', 'summary_arg_count' => 'int', + 'ios_relevance_score' => 'float', + 'ios_interruption_level' => 'string', 'email_subject' => 'string', 'email_body' => 'string', 'email_from_name' => 'string', @@ -165,7 +165,7 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'include_unsubscribed' => 'bool', 'sms_from' => 'string', 'sms_media_urls' => 'string[]', - 'filters' => '\onesignal\client\model\Filter[]', + 'filters' => '\onesignal\client\model\FilterExpression[]', 'custom_data' => 'object' ]; @@ -179,8 +179,7 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPIFormats = [ 'included_segments' => null, 'excluded_segments' => null, - 'include_player_ids' => null, - 'include_external_user_ids' => null, + 'include_subscription_ids' => null, 'include_email_tokens' => null, 'include_phone_numbers' => null, 'include_ios_tokens' => null, @@ -205,7 +204,6 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'is_wp_wns' => null, 'is_adm' => null, 'is_chrome' => null, - 'channel_for_external_user_ids' => null, 'app_id' => null, 'external_id' => null, 'idempotency_key' => null, @@ -274,6 +272,8 @@ class BasicNotification implements ModelInterface, ArrayAccess, \JsonSerializabl 'thread_id' => null, 'summary_arg' => null, 'summary_arg_count' => null, + 'ios_relevance_score' => null, + 'ios_interruption_level' => null, 'email_subject' => null, 'email_body' => null, 'email_from_name' => null, @@ -315,8 +315,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'included_segments' => 'included_segments', 'excluded_segments' => 'excluded_segments', - 'include_player_ids' => 'include_player_ids', - 'include_external_user_ids' => 'include_external_user_ids', + 'include_subscription_ids' => 'include_subscription_ids', 'include_email_tokens' => 'include_email_tokens', 'include_phone_numbers' => 'include_phone_numbers', 'include_ios_tokens' => 'include_ios_tokens', @@ -341,7 +340,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'isWP_WNS', 'is_adm' => 'isAdm', 'is_chrome' => 'isChrome', - 'channel_for_external_user_ids' => 'channel_for_external_user_ids', 'app_id' => 'app_id', 'external_id' => 'external_id', 'idempotency_key' => 'idempotency_key', @@ -410,6 +408,8 @@ public static function openAPIFormats() 'thread_id' => 'thread_id', 'summary_arg' => 'summary_arg', 'summary_arg_count' => 'summary_arg_count', + 'ios_relevance_score' => 'ios_relevance_score', + 'ios_interruption_level' => 'ios_interruption_level', 'email_subject' => 'email_subject', 'email_body' => 'email_body', 'email_from_name' => 'email_from_name', @@ -430,8 +430,7 @@ public static function openAPIFormats() protected static $setters = [ 'included_segments' => 'setIncludedSegments', 'excluded_segments' => 'setExcludedSegments', - 'include_player_ids' => 'setIncludePlayerIds', - 'include_external_user_ids' => 'setIncludeExternalUserIds', + 'include_subscription_ids' => 'setIncludeSubscriptionIds', 'include_email_tokens' => 'setIncludeEmailTokens', 'include_phone_numbers' => 'setIncludePhoneNumbers', 'include_ios_tokens' => 'setIncludeIosTokens', @@ -456,7 +455,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'setIsWpWns', 'is_adm' => 'setIsAdm', 'is_chrome' => 'setIsChrome', - 'channel_for_external_user_ids' => 'setChannelForExternalUserIds', 'app_id' => 'setAppId', 'external_id' => 'setExternalId', 'idempotency_key' => 'setIdempotencyKey', @@ -525,6 +523,8 @@ public static function openAPIFormats() 'thread_id' => 'setThreadId', 'summary_arg' => 'setSummaryArg', 'summary_arg_count' => 'setSummaryArgCount', + 'ios_relevance_score' => 'setIosRelevanceScore', + 'ios_interruption_level' => 'setIosInterruptionLevel', 'email_subject' => 'setEmailSubject', 'email_body' => 'setEmailBody', 'email_from_name' => 'setEmailFromName', @@ -545,8 +545,7 @@ public static function openAPIFormats() protected static $getters = [ 'included_segments' => 'getIncludedSegments', 'excluded_segments' => 'getExcludedSegments', - 'include_player_ids' => 'getIncludePlayerIds', - 'include_external_user_ids' => 'getIncludeExternalUserIds', + 'include_subscription_ids' => 'getIncludeSubscriptionIds', 'include_email_tokens' => 'getIncludeEmailTokens', 'include_phone_numbers' => 'getIncludePhoneNumbers', 'include_ios_tokens' => 'getIncludeIosTokens', @@ -571,7 +570,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'getIsWpWns', 'is_adm' => 'getIsAdm', 'is_chrome' => 'getIsChrome', - 'channel_for_external_user_ids' => 'getChannelForExternalUserIds', 'app_id' => 'getAppId', 'external_id' => 'getExternalId', 'idempotency_key' => 'getIdempotencyKey', @@ -640,6 +638,8 @@ public static function openAPIFormats() 'thread_id' => 'getThreadId', 'summary_arg' => 'getSummaryArg', 'summary_arg_count' => 'getSummaryArgCount', + 'ios_relevance_score' => 'getIosRelevanceScore', + 'ios_interruption_level' => 'getIosInterruptionLevel', 'email_subject' => 'getEmailSubject', 'email_body' => 'getEmailBody', 'email_from_name' => 'getEmailFromName', @@ -743,8 +743,7 @@ public function __construct(array $data = null) { $this->container['included_segments'] = $data['included_segments'] ?? null; $this->container['excluded_segments'] = $data['excluded_segments'] ?? null; - $this->container['include_player_ids'] = $data['include_player_ids'] ?? null; - $this->container['include_external_user_ids'] = $data['include_external_user_ids'] ?? null; + $this->container['include_subscription_ids'] = $data['include_subscription_ids'] ?? null; $this->container['include_email_tokens'] = $data['include_email_tokens'] ?? null; $this->container['include_phone_numbers'] = $data['include_phone_numbers'] ?? null; $this->container['include_ios_tokens'] = $data['include_ios_tokens'] ?? null; @@ -769,7 +768,6 @@ public function __construct(array $data = null) $this->container['is_wp_wns'] = $data['is_wp_wns'] ?? null; $this->container['is_adm'] = $data['is_adm'] ?? null; $this->container['is_chrome'] = $data['is_chrome'] ?? null; - $this->container['channel_for_external_user_ids'] = $data['channel_for_external_user_ids'] ?? null; $this->container['app_id'] = $data['app_id'] ?? null; $this->container['external_id'] = $data['external_id'] ?? null; $this->container['idempotency_key'] = $data['idempotency_key'] ?? null; @@ -838,6 +836,8 @@ public function __construct(array $data = null) $this->container['thread_id'] = $data['thread_id'] ?? null; $this->container['summary_arg'] = $data['summary_arg'] ?? null; $this->container['summary_arg_count'] = $data['summary_arg_count'] ?? null; + $this->container['ios_relevance_score'] = $data['ios_relevance_score'] ?? null; + $this->container['ios_interruption_level'] = $data['ios_interruption_level'] ?? null; $this->container['email_subject'] = $data['email_subject'] ?? null; $this->container['email_body'] = $data['email_body'] ?? null; $this->container['email_from_name'] = $data['email_from_name'] ?? null; @@ -944,53 +944,25 @@ public function setExcludedSegments($excluded_segments) } /** - * Gets include_player_ids + * Gets include_subscription_ids * * @return string[]|null - * @deprecated - */ - public function getIncludePlayerIds() - { - return $this->container['include_player_ids']; - } - - /** - * Sets include_player_ids - * - * @param string[]|null $include_player_ids 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 - * - * @return self - * @deprecated - */ - public function setIncludePlayerIds($include_player_ids) - { - $this->container['include_player_ids'] = $include_player_ids; - - return $this; - } - - /** - * Gets include_external_user_ids - * - * @return string[]|null - * @deprecated */ - public function getIncludeExternalUserIds() + public function getIncludeSubscriptionIds() { - return $this->container['include_external_user_ids']; + return $this->container['include_subscription_ids']; } /** - * Sets include_external_user_ids + * Sets include_subscription_ids * - * @param string[]|null $include_external_user_ids 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. + * @param string[]|null $include_subscription_ids Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call * * @return self - * @deprecated */ - public function setIncludeExternalUserIds($include_external_user_ids) + public function setIncludeSubscriptionIds($include_subscription_ids) { - $this->container['include_external_user_ids'] = $include_external_user_ids; + $this->container['include_subscription_ids'] = $include_subscription_ids; return $this; } @@ -1056,7 +1028,7 @@ public function getIncludeIosTokens() /** * Sets include_ios_tokens * - * @param string[]|null $include_ios_tokens 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 + * @param string[]|null $include_ios_tokens Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1080,7 +1052,7 @@ public function getIncludeWpWnsUris() /** * Sets include_wp_wns_uris * - * @param string[]|null $include_wp_wns_uris 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 + * @param string[]|null $include_wp_wns_uris Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1104,7 +1076,7 @@ public function getIncludeAmazonRegIds() /** * Sets include_amazon_reg_ids * - * @param string[]|null $include_amazon_reg_ids 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 + * @param string[]|null $include_amazon_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1128,7 +1100,7 @@ public function getIncludeChromeRegIds() /** * Sets include_chrome_reg_ids * - * @param string[]|null $include_chrome_reg_ids 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 + * @param string[]|null $include_chrome_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1152,7 +1124,7 @@ public function getIncludeChromeWebRegIds() /** * Sets include_chrome_web_reg_ids * - * @param string[]|null $include_chrome_web_reg_ids 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 + * @param string[]|null $include_chrome_web_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1176,7 +1148,7 @@ public function getIncludeAndroidRegIds() /** * Sets include_android_reg_ids * - * @param string[]|null $include_android_reg_ids 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 + * @param string[]|null $include_android_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1190,7 +1162,7 @@ public function setIncludeAndroidRegIds($include_android_reg_ids) /** * Gets include_aliases * - * @return \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null + * @return array|null */ public function getIncludeAliases() { @@ -1200,7 +1172,7 @@ public function getIncludeAliases() /** * Sets include_aliases * - * @param \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null $include_aliases include_aliases + * @param array|null $include_aliases Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. * * @return self */ @@ -1591,30 +1563,6 @@ public function setIsChrome($is_chrome) return $this; } - /** - * Gets channel_for_external_user_ids - * - * @return string|null - */ - public function getChannelForExternalUserIds() - { - return $this->container['channel_for_external_user_ids']; - } - - /** - * Sets channel_for_external_user_ids - * - * @param string|null $channel_for_external_user_ids 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. - * - * @return self - */ - public function setChannelForExternalUserIds($channel_for_external_user_ids) - { - $this->container['channel_for_external_user_ids'] = $channel_for_external_user_ids; - - return $this; - } - /** * Gets app_id * @@ -1692,7 +1640,7 @@ public function setIdempotencyKey($idempotency_key) /** * Gets contents * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getContents() { @@ -1702,7 +1650,7 @@ public function getContents() /** * Sets contents * - * @param StringMap|null $contents contents + * @param LanguageStringMap|null $contents contents * * @return self */ @@ -1716,7 +1664,7 @@ public function setContents($contents) /** * Gets headings * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getHeadings() { @@ -1726,7 +1674,7 @@ public function getHeadings() /** * Sets headings * - * @param StringMap|null $headings headings + * @param LanguageStringMap|null $headings headings * * @return self */ @@ -1740,7 +1688,7 @@ public function setHeadings($headings) /** * Gets subtitle * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getSubtitle() { @@ -1750,7 +1698,7 @@ public function getSubtitle() /** * Sets subtitle * - * @param StringMap|null $subtitle subtitle + * @param LanguageStringMap|null $subtitle subtitle * * @return self */ @@ -2148,7 +2096,7 @@ public function setButtons($buttons) /** * Gets web_buttons * - * @return \onesignal\client\model\Button[]|null + * @return \onesignal\client\model\WebButton[]|null */ public function getWebButtons() { @@ -2158,7 +2106,7 @@ public function getWebButtons() /** * Sets web_buttons * - * @param \onesignal\client\model\Button[]|null $web_buttons 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\"}] + * @param \onesignal\client\model\WebButton[]|null $web_buttons 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\"}] * * @return self */ @@ -3249,6 +3197,54 @@ public function setSummaryArgCount($summary_arg_count) return $this; } + /** + * Gets ios_relevance_score + * + * @return float|null + */ + public function getIosRelevanceScore() + { + return $this->container['ios_relevance_score']; + } + + /** + * Sets ios_relevance_score + * + * @param float|null $ios_relevance_score Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. + * + * @return self + */ + public function setIosRelevanceScore($ios_relevance_score) + { + $this->container['ios_relevance_score'] = $ios_relevance_score; + + return $this; + } + + /** + * Gets ios_interruption_level + * + * @return string|null + */ + public function getIosInterruptionLevel() + { + return $this->container['ios_interruption_level']; + } + + /** + * Sets ios_interruption_level + * + * @param string|null $ios_interruption_level Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. + * + * @return self + */ + public function setIosInterruptionLevel($ios_interruption_level) + { + $this->container['ios_interruption_level'] = $ios_interruption_level; + + return $this; + } + /** * Gets email_subject * @@ -3444,7 +3440,7 @@ public function setSmsMediaUrls($sms_media_urls) /** * Gets filters * - * @return \onesignal\client\model\Filter[]|null + * @return \onesignal\client\model\FilterExpression[]|null */ public function getFilters() { @@ -3454,7 +3450,7 @@ public function getFilters() /** * Sets filters * - * @param \onesignal\client\model\Filter[]|null $filters filters + * @param \onesignal\client\model\FilterExpression[]|null $filters filters * * @return self */ diff --git a/lib/model/BasicNotificationAllOf.php b/lib/model/BasicNotificationAllOf.php index 683ff7b..f407f68 100644 --- a/lib/model/BasicNotificationAllOf.php +++ b/lib/model/BasicNotificationAllOf.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -74,13 +74,12 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'is_wp_wns' => 'bool', 'is_adm' => 'bool', 'is_chrome' => 'bool', - 'channel_for_external_user_ids' => 'string', 'app_id' => 'string', 'external_id' => 'string', 'idempotency_key' => 'string', - 'contents' => 'StringMap', - 'headings' => 'StringMap', - 'subtitle' => 'StringMap', + 'contents' => 'LanguageStringMap', + 'headings' => 'LanguageStringMap', + 'subtitle' => 'LanguageStringMap', 'data' => 'object', 'huawei_msg_type' => 'string', 'url' => 'string', @@ -97,7 +96,7 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'chrome_big_picture' => 'string', 'chrome_web_image' => 'string', 'buttons' => '\onesignal\client\model\Button[]', - 'web_buttons' => '\onesignal\client\model\Button[]', + 'web_buttons' => '\onesignal\client\model\WebButton[]', 'ios_category' => 'string', 'android_channel_id' => 'string', 'huawei_channel_id' => 'string', @@ -143,6 +142,8 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'thread_id' => 'string', 'summary_arg' => 'string', 'summary_arg_count' => 'int', + 'ios_relevance_score' => 'float', + 'ios_interruption_level' => 'string', 'email_subject' => 'string', 'email_body' => 'string', 'email_from_name' => 'string', @@ -151,7 +152,7 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'include_unsubscribed' => 'bool', 'sms_from' => 'string', 'sms_media_urls' => 'string[]', - 'filters' => '\onesignal\client\model\Filter[]', + 'filters' => '\onesignal\client\model\FilterExpression[]', 'custom_data' => 'object' ]; @@ -177,7 +178,6 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'is_wp_wns' => null, 'is_adm' => null, 'is_chrome' => null, - 'channel_for_external_user_ids' => null, 'app_id' => null, 'external_id' => null, 'idempotency_key' => null, @@ -246,6 +246,8 @@ class BasicNotificationAllOf implements ModelInterface, ArrayAccess, \JsonSerial 'thread_id' => null, 'summary_arg' => null, 'summary_arg_count' => null, + 'ios_relevance_score' => null, + 'ios_interruption_level' => null, 'email_subject' => null, 'email_body' => null, 'email_from_name' => null, @@ -299,7 +301,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'isWP_WNS', 'is_adm' => 'isAdm', 'is_chrome' => 'isChrome', - 'channel_for_external_user_ids' => 'channel_for_external_user_ids', 'app_id' => 'app_id', 'external_id' => 'external_id', 'idempotency_key' => 'idempotency_key', @@ -368,6 +369,8 @@ public static function openAPIFormats() 'thread_id' => 'thread_id', 'summary_arg' => 'summary_arg', 'summary_arg_count' => 'summary_arg_count', + 'ios_relevance_score' => 'ios_relevance_score', + 'ios_interruption_level' => 'ios_interruption_level', 'email_subject' => 'email_subject', 'email_body' => 'email_body', 'email_from_name' => 'email_from_name', @@ -400,7 +403,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'setIsWpWns', 'is_adm' => 'setIsAdm', 'is_chrome' => 'setIsChrome', - 'channel_for_external_user_ids' => 'setChannelForExternalUserIds', 'app_id' => 'setAppId', 'external_id' => 'setExternalId', 'idempotency_key' => 'setIdempotencyKey', @@ -469,6 +471,8 @@ public static function openAPIFormats() 'thread_id' => 'setThreadId', 'summary_arg' => 'setSummaryArg', 'summary_arg_count' => 'setSummaryArgCount', + 'ios_relevance_score' => 'setIosRelevanceScore', + 'ios_interruption_level' => 'setIosInterruptionLevel', 'email_subject' => 'setEmailSubject', 'email_body' => 'setEmailBody', 'email_from_name' => 'setEmailFromName', @@ -501,7 +505,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'getIsWpWns', 'is_adm' => 'getIsAdm', 'is_chrome' => 'getIsChrome', - 'channel_for_external_user_ids' => 'getChannelForExternalUserIds', 'app_id' => 'getAppId', 'external_id' => 'getExternalId', 'idempotency_key' => 'getIdempotencyKey', @@ -570,6 +573,8 @@ public static function openAPIFormats() 'thread_id' => 'getThreadId', 'summary_arg' => 'getSummaryArg', 'summary_arg_count' => 'getSummaryArgCount', + 'ios_relevance_score' => 'getIosRelevanceScore', + 'ios_interruption_level' => 'getIosInterruptionLevel', 'email_subject' => 'getEmailSubject', 'email_body' => 'getEmailBody', 'email_from_name' => 'getEmailFromName', @@ -668,7 +673,6 @@ public function __construct(array $data = null) $this->container['is_wp_wns'] = $data['is_wp_wns'] ?? null; $this->container['is_adm'] = $data['is_adm'] ?? null; $this->container['is_chrome'] = $data['is_chrome'] ?? null; - $this->container['channel_for_external_user_ids'] = $data['channel_for_external_user_ids'] ?? null; $this->container['app_id'] = $data['app_id'] ?? null; $this->container['external_id'] = $data['external_id'] ?? null; $this->container['idempotency_key'] = $data['idempotency_key'] ?? null; @@ -737,6 +741,8 @@ public function __construct(array $data = null) $this->container['thread_id'] = $data['thread_id'] ?? null; $this->container['summary_arg'] = $data['summary_arg'] ?? null; $this->container['summary_arg_count'] = $data['summary_arg_count'] ?? null; + $this->container['ios_relevance_score'] = $data['ios_relevance_score'] ?? null; + $this->container['ios_interruption_level'] = $data['ios_interruption_level'] ?? null; $this->container['email_subject'] = $data['email_subject'] ?? null; $this->container['email_body'] = $data['email_body'] ?? null; $this->container['email_from_name'] = $data['email_from_name'] ?? null; @@ -1128,30 +1134,6 @@ public function setIsChrome($is_chrome) return $this; } - /** - * Gets channel_for_external_user_ids - * - * @return string|null - */ - public function getChannelForExternalUserIds() - { - return $this->container['channel_for_external_user_ids']; - } - - /** - * Sets channel_for_external_user_ids - * - * @param string|null $channel_for_external_user_ids 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. - * - * @return self - */ - public function setChannelForExternalUserIds($channel_for_external_user_ids) - { - $this->container['channel_for_external_user_ids'] = $channel_for_external_user_ids; - - return $this; - } - /** * Gets app_id * @@ -1229,7 +1211,7 @@ public function setIdempotencyKey($idempotency_key) /** * Gets contents * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getContents() { @@ -1239,7 +1221,7 @@ public function getContents() /** * Sets contents * - * @param StringMap|null $contents contents + * @param LanguageStringMap|null $contents contents * * @return self */ @@ -1253,7 +1235,7 @@ public function setContents($contents) /** * Gets headings * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getHeadings() { @@ -1263,7 +1245,7 @@ public function getHeadings() /** * Sets headings * - * @param StringMap|null $headings headings + * @param LanguageStringMap|null $headings headings * * @return self */ @@ -1277,7 +1259,7 @@ public function setHeadings($headings) /** * Gets subtitle * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getSubtitle() { @@ -1287,7 +1269,7 @@ public function getSubtitle() /** * Sets subtitle * - * @param StringMap|null $subtitle subtitle + * @param LanguageStringMap|null $subtitle subtitle * * @return self */ @@ -1685,7 +1667,7 @@ public function setButtons($buttons) /** * Gets web_buttons * - * @return \onesignal\client\model\Button[]|null + * @return \onesignal\client\model\WebButton[]|null */ public function getWebButtons() { @@ -1695,7 +1677,7 @@ public function getWebButtons() /** * Sets web_buttons * - * @param \onesignal\client\model\Button[]|null $web_buttons 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\"}] + * @param \onesignal\client\model\WebButton[]|null $web_buttons 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\"}] * * @return self */ @@ -2786,6 +2768,54 @@ public function setSummaryArgCount($summary_arg_count) return $this; } + /** + * Gets ios_relevance_score + * + * @return float|null + */ + public function getIosRelevanceScore() + { + return $this->container['ios_relevance_score']; + } + + /** + * Sets ios_relevance_score + * + * @param float|null $ios_relevance_score Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. + * + * @return self + */ + public function setIosRelevanceScore($ios_relevance_score) + { + $this->container['ios_relevance_score'] = $ios_relevance_score; + + return $this; + } + + /** + * Gets ios_interruption_level + * + * @return string|null + */ + public function getIosInterruptionLevel() + { + return $this->container['ios_interruption_level']; + } + + /** + * Sets ios_interruption_level + * + * @param string|null $ios_interruption_level Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. + * + * @return self + */ + public function setIosInterruptionLevel($ios_interruption_level) + { + $this->container['ios_interruption_level'] = $ios_interruption_level; + + return $this; + } + /** * Gets email_subject * @@ -2981,7 +3011,7 @@ public function setSmsMediaUrls($sms_media_urls) /** * Gets filters * - * @return \onesignal\client\model\Filter[]|null + * @return \onesignal\client\model\FilterExpression[]|null */ public function getFilters() { @@ -2991,7 +3021,7 @@ public function getFilters() /** * Sets filters * - * @param \onesignal\client\model\Filter[]|null $filters filters + * @param \onesignal\client\model\FilterExpression[]|null $filters filters * * @return self */ diff --git a/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php b/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php index bc8ed3d..beee443 100644 --- a/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php +++ b/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/BeginLiveActivityRequest.php b/lib/model/BeginLiveActivityRequest.php deleted file mode 100644 index e046524..0000000 --- a/lib/model/BeginLiveActivityRequest.php +++ /dev/null @@ -1,359 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class BeginLiveActivityRequest implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BeginLiveActivityRequest'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'push_token' => 'string', - 'subscription_id' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'push_token' => null, - 'subscription_id' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'push_token' => 'push_token', - 'subscription_id' => 'subscription_id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'push_token' => 'setPushToken', - 'subscription_id' => 'setSubscriptionId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'push_token' => 'getPushToken', - 'subscription_id' => 'getSubscriptionId' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['push_token'] = $data['push_token'] ?? null; - $this->container['subscription_id'] = $data['subscription_id'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['push_token'] === null) { - $invalidProperties[] = "'push_token' can't be null"; - } - if ($this->container['subscription_id'] === null) { - $invalidProperties[] = "'subscription_id' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets push_token - * - * @return string - */ - public function getPushToken() - { - return $this->container['push_token']; - } - - /** - * Sets push_token - * - * @param string $push_token push_token - * - * @return self - */ - public function setPushToken($push_token) - { - $this->container['push_token'] = $push_token; - - return $this; - } - - /** - * Gets subscription_id - * - * @return string - */ - public function getSubscriptionId() - { - return $this->container['subscription_id']; - } - - /** - * Sets subscription_id - * - * @param string $subscription_id subscription_id - * - * @return self - */ - public function setSubscriptionId($subscription_id) - { - $this->container['subscription_id'] = $subscription_id; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/Button.php b/lib/model/Button.php index 812d7b7..8e44abc 100644 --- a/lib/model/Button.php +++ b/lib/model/Button.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CancelNotificationSuccessResponse.php b/lib/model/CancelNotificationSuccessResponse.php deleted file mode 100644 index 752a91d..0000000 --- a/lib/model/CancelNotificationSuccessResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class CancelNotificationSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CancelNotificationSuccessResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/CreateNotificationSuccessResponse.php b/lib/model/CreateNotificationSuccessResponse.php index 9d000a4..747f129 100644 --- a/lib/model/CreateNotificationSuccessResponse.php +++ b/lib/model/CreateNotificationSuccessResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -61,9 +61,8 @@ class CreateNotificationSuccessResponse implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'id' => 'string', - 'recipients' => 'int', 'external_id' => 'string', - 'errors' => '\onesignal\client\model\Notification200Errors' + 'errors' => 'mixed' ]; /** @@ -75,7 +74,6 @@ class CreateNotificationSuccessResponse implements ModelInterface, ArrayAccess, */ protected static $openAPIFormats = [ 'id' => null, - 'recipients' => null, 'external_id' => null, 'errors' => null ]; @@ -108,7 +106,6 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'recipients' => 'recipients', 'external_id' => 'external_id', 'errors' => 'errors' ]; @@ -120,7 +117,6 @@ public static function openAPIFormats() */ protected static $setters = [ 'id' => 'setId', - 'recipients' => 'setRecipients', 'external_id' => 'setExternalId', 'errors' => 'setErrors' ]; @@ -132,7 +128,6 @@ public static function openAPIFormats() */ protected static $getters = [ 'id' => 'getId', - 'recipients' => 'getRecipients', 'external_id' => 'getExternalId', 'errors' => 'getErrors' ]; @@ -195,7 +190,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = $data['id'] ?? null; - $this->container['recipients'] = $data['recipients'] ?? null; $this->container['external_id'] = $data['external_id'] ?? null; $this->container['errors'] = $data['errors'] ?? null; } @@ -248,30 +242,6 @@ public function setId($id) return $this; } - /** - * Gets recipients - * - * @return int|null - */ - public function getRecipients() - { - return $this->container['recipients']; - } - - /** - * Sets recipients - * - * @param int|null $recipients Estimated number of subscribers targetted by notification. - * - * @return self - */ - public function setRecipients($recipients) - { - $this->container['recipients'] = $recipients; - - return $this; - } - /** * Gets external_id * @@ -299,7 +269,7 @@ public function setExternalId($external_id) /** * Gets errors * - * @return \onesignal\client\model\Notification200Errors|null + * @return mixed|null */ public function getErrors() { @@ -309,7 +279,7 @@ public function getErrors() /** * Sets errors * - * @param \onesignal\client\model\Notification200Errors|null $errors errors + * @param mixed|null $errors Errors include the identifiers that are invalid, or that there are no subscribers. * * @return self */ diff --git a/lib/model/CreateSegmentConflictResponse.php b/lib/model/CreateSegmentConflictResponse.php index 331a60c..e31f5d8 100644 --- a/lib/model/CreateSegmentConflictResponse.php +++ b/lib/model/CreateSegmentConflictResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateSegmentSuccessResponse.php b/lib/model/CreateSegmentSuccessResponse.php index 193f091..f001476 100644 --- a/lib/model/CreateSegmentSuccessResponse.php +++ b/lib/model/CreateSegmentSuccessResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateSubscriptionRequestBody.php b/lib/model/CreateSubscriptionRequestBody.php deleted file mode 100644 index 3e9035d..0000000 --- a/lib/model/CreateSubscriptionRequestBody.php +++ /dev/null @@ -1,353 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class CreateSubscriptionRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateSubscriptionRequestBody'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'subscription' => '\onesignal\client\model\SubscriptionObject', - 'retain_previous_owner' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'subscription' => null, - 'retain_previous_owner' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'subscription' => 'subscription', - 'retain_previous_owner' => 'retain_previous_owner' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'subscription' => 'setSubscription', - 'retain_previous_owner' => 'setRetainPreviousOwner' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'subscription' => 'getSubscription', - 'retain_previous_owner' => 'getRetainPreviousOwner' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['subscription'] = $data['subscription'] ?? null; - $this->container['retain_previous_owner'] = $data['retain_previous_owner'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets subscription - * - * @return \onesignal\client\model\SubscriptionObject|null - */ - public function getSubscription() - { - return $this->container['subscription']; - } - - /** - * Sets subscription - * - * @param \onesignal\client\model\SubscriptionObject|null $subscription subscription - * - * @return self - */ - public function setSubscription($subscription) - { - $this->container['subscription'] = $subscription; - - return $this; - } - - /** - * Gets retain_previous_owner - * - * @return bool|null - */ - public function getRetainPreviousOwner() - { - return $this->container['retain_previous_owner']; - } - - /** - * Sets retain_previous_owner - * - * @param bool|null $retain_previous_owner retain_previous_owner - * - * @return self - */ - public function setRetainPreviousOwner($retain_previous_owner) - { - $this->container['retain_previous_owner'] = $retain_previous_owner; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/CreateUserConflictResponse.php b/lib/model/CreateUserConflictResponse.php index 164d0d8..a77b08a 100644 --- a/lib/model/CreateUserConflictResponse.php +++ b/lib/model/CreateUserConflictResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateUserConflictResponseErrorsInner.php b/lib/model/CreateUserConflictResponseErrorsInner.php index 510bc77..6f24a61 100644 --- a/lib/model/CreateUserConflictResponseErrorsInner.php +++ b/lib/model/CreateUserConflictResponseErrorsInner.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateUserConflictResponseErrorsItemsMeta.php b/lib/model/CreateUserConflictResponseErrorsItemsMeta.php index 8832afe..c7a451a 100644 --- a/lib/model/CreateUserConflictResponseErrorsItemsMeta.php +++ b/lib/model/CreateUserConflictResponseErrorsItemsMeta.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/DeletePlayerNotFoundResponse.php b/lib/model/DeletePlayerNotFoundResponse.php deleted file mode 100644 index 6f84277..0000000 --- a/lib/model/DeletePlayerNotFoundResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class DeletePlayerNotFoundResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeletePlayerNotFoundResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/DeleteSegmentNotFoundResponse.php b/lib/model/DeleteSegmentNotFoundResponse.php deleted file mode 100644 index 769e735..0000000 --- a/lib/model/DeleteSegmentNotFoundResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class DeleteSegmentNotFoundResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteSegmentNotFoundResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/DeleteSegmentSuccessResponse.php b/lib/model/DeleteSegmentSuccessResponse.php deleted file mode 100644 index 896756e..0000000 --- a/lib/model/DeleteSegmentSuccessResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class DeleteSegmentSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteSegmentSuccessResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/DeliveryData.php b/lib/model/DeliveryData.php index 27a3237..c84ef0f 100644 --- a/lib/model/DeliveryData.php +++ b/lib/model/DeliveryData.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ExportEventsSuccessResponse.php b/lib/model/ExportEventsSuccessResponse.php index 004aeea..36a61ce 100644 --- a/lib/model/ExportEventsSuccessResponse.php +++ b/lib/model/ExportEventsSuccessResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ExportPlayersRequestBody.php b/lib/model/ExportSubscriptionsRequestBody.php similarity index 96% rename from lib/model/ExportPlayersRequestBody.php rename to lib/model/ExportSubscriptionsRequestBody.php index ce25d4b..bdb1f7a 100644 --- a/lib/model/ExportPlayersRequestBody.php +++ b/lib/model/ExportSubscriptionsRequestBody.php @@ -1,6 +1,6 @@ 'string', 'key' => 'string', 'value' => 'string', + 'hours_ago' => 'string', + 'radius' => 'float', + 'lat' => 'float', + 'long' => 'float', 'relation' => 'string' ]; @@ -77,6 +81,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable 'field' => null, 'key' => null, 'value' => null, + 'hours_ago' => null, + 'radius' => null, + 'lat' => null, + 'long' => null, 'relation' => null ]; @@ -110,6 +118,10 @@ public static function openAPIFormats() 'field' => 'field', 'key' => 'key', 'value' => 'value', + 'hours_ago' => 'hours_ago', + 'radius' => 'radius', + 'lat' => 'lat', + 'long' => 'long', 'relation' => 'relation' ]; @@ -122,6 +134,10 @@ public static function openAPIFormats() 'field' => 'setField', 'key' => 'setKey', 'value' => 'setValue', + 'hours_ago' => 'setHoursAgo', + 'radius' => 'setRadius', + 'lat' => 'setLat', + 'long' => 'setLong', 'relation' => 'setRelation' ]; @@ -134,6 +150,10 @@ public static function openAPIFormats() 'field' => 'getField', 'key' => 'getKey', 'value' => 'getValue', + 'hours_ago' => 'getHoursAgo', + 'radius' => 'getRadius', + 'lat' => 'getLat', + 'long' => 'getLong', 'relation' => 'getRelation' ]; @@ -224,6 +244,10 @@ public function __construct(array $data = null) $this->container['field'] = $data['field'] ?? null; $this->container['key'] = $data['key'] ?? null; $this->container['value'] = $data['value'] ?? null; + $this->container['hours_ago'] = $data['hours_ago'] ?? null; + $this->container['radius'] = $data['radius'] ?? null; + $this->container['lat'] = $data['lat'] ?? null; + $this->container['long'] = $data['long'] ?? null; $this->container['relation'] = $data['relation'] ?? null; } @@ -236,12 +260,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['field'] === null) { - $invalidProperties[] = "'field' can't be null"; - } - if ($this->container['relation'] === null) { - $invalidProperties[] = "'relation' can't be null"; - } $allowedValues = $this->getRelationAllowableValues(); if (!is_null($this->container['relation']) && !in_array($this->container['relation'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -269,7 +287,7 @@ public function valid() /** * Gets field * - * @return string + * @return string|null */ public function getField() { @@ -279,7 +297,7 @@ public function getField() /** * Sets field * - * @param string $field Name of the field to use as the first operand in the filter expression. + * @param string|null $field Required. Name of the field to use as the first operand in the filter expression. * * @return self */ @@ -338,10 +356,106 @@ public function setValue($value) return $this; } + /** + * Gets hours_ago + * + * @return string|null + */ + public function getHoursAgo() + { + return $this->container['hours_ago']; + } + + /** + * Sets hours_ago + * + * @param string|null $hours_ago If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. + * + * @return self + */ + public function setHoursAgo($hours_ago) + { + $this->container['hours_ago'] = $hours_ago; + + return $this; + } + + /** + * Gets radius + * + * @return float|null + */ + public function getRadius() + { + return $this->container['radius']; + } + + /** + * Sets radius + * + * @param float|null $radius If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. + * + * @return self + */ + public function setRadius($radius) + { + $this->container['radius'] = $radius; + + return $this; + } + + /** + * Gets lat + * + * @return float|null + */ + public function getLat() + { + return $this->container['lat']; + } + + /** + * Sets lat + * + * @param float|null $lat If `field` is `location`, this is *required* to specify the user's latitude. + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets long + * + * @return float|null + */ + public function getLong() + { + return $this->container['long']; + } + + /** + * Sets long + * + * @param float|null $long If `field` is `location`, this is *required* to specify the user's longitude. + * + * @return self + */ + public function setLong($long) + { + $this->container['long'] = $long; + + return $this; + } + /** * Gets relation * - * @return string + * @return string|null */ public function getRelation() { @@ -351,14 +465,14 @@ public function getRelation() /** * Sets relation * - * @param string $relation Operator of a filter expression. + * @param string|null $relation Required. Operator of a filter expression. * * @return self */ public function setRelation($relation) { $allowedValues = $this->getRelationAllowableValues(); - if (!in_array($relation, $allowedValues, true)) { + if (!is_null($relation) && !in_array($relation, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'relation', must be one of '%s'", diff --git a/lib/model/FilterExpressions.php b/lib/model/FilterExpression.php similarity index 78% rename from lib/model/FilterExpressions.php rename to lib/model/FilterExpression.php index bcbc550..251d658 100644 --- a/lib/model/FilterExpressions.php +++ b/lib/model/FilterExpression.php @@ -1,6 +1,6 @@ 'string', 'key' => 'string', 'value' => 'string', + 'hours_ago' => 'string', + 'radius' => 'float', + 'lat' => 'float', + 'long' => 'float', 'relation' => 'string', 'operator' => 'string' ]; @@ -78,6 +82,10 @@ class FilterExpressions implements ModelInterface, ArrayAccess, \JsonSerializabl 'field' => null, 'key' => null, 'value' => null, + 'hours_ago' => null, + 'radius' => null, + 'lat' => null, + 'long' => null, 'relation' => null, 'operator' => null ]; @@ -112,6 +120,10 @@ public static function openAPIFormats() 'field' => 'field', 'key' => 'key', 'value' => 'value', + 'hours_ago' => 'hours_ago', + 'radius' => 'radius', + 'lat' => 'lat', + 'long' => 'long', 'relation' => 'relation', 'operator' => 'operator' ]; @@ -125,6 +137,10 @@ public static function openAPIFormats() 'field' => 'setField', 'key' => 'setKey', 'value' => 'setValue', + 'hours_ago' => 'setHoursAgo', + 'radius' => 'setRadius', + 'lat' => 'setLat', + 'long' => 'setLong', 'relation' => 'setRelation', 'operator' => 'setOperator' ]; @@ -138,6 +154,10 @@ public static function openAPIFormats() 'field' => 'getField', 'key' => 'getKey', 'value' => 'getValue', + 'hours_ago' => 'getHoursAgo', + 'radius' => 'getRadius', + 'lat' => 'getLat', + 'long' => 'getLong', 'relation' => 'getRelation', 'operator' => 'getOperator' ]; @@ -244,6 +264,10 @@ public function __construct(array $data = null) $this->container['field'] = $data['field'] ?? null; $this->container['key'] = $data['key'] ?? null; $this->container['value'] = $data['value'] ?? null; + $this->container['hours_ago'] = $data['hours_ago'] ?? null; + $this->container['radius'] = $data['radius'] ?? null; + $this->container['lat'] = $data['lat'] ?? null; + $this->container['long'] = $data['long'] ?? null; $this->container['relation'] = $data['relation'] ?? null; $this->container['operator'] = $data['operator'] ?? null; } @@ -257,12 +281,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['field'] === null) { - $invalidProperties[] = "'field' can't be null"; - } - if ($this->container['relation'] === null) { - $invalidProperties[] = "'relation' can't be null"; - } $allowedValues = $this->getRelationAllowableValues(); if (!is_null($this->container['relation']) && !in_array($this->container['relation'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -299,7 +317,7 @@ public function valid() /** * Gets field * - * @return string + * @return string|null */ public function getField() { @@ -309,7 +327,7 @@ public function getField() /** * Sets field * - * @param string $field Name of the field to use as the first operand in the filter expression. + * @param string|null $field Required. Name of the field to use as the first operand in the filter expression. * * @return self */ @@ -368,10 +386,106 @@ public function setValue($value) return $this; } + /** + * Gets hours_ago + * + * @return string|null + */ + public function getHoursAgo() + { + return $this->container['hours_ago']; + } + + /** + * Sets hours_ago + * + * @param string|null $hours_ago If `field` is session-related, this is *required* to specify the number of hours before or after the user's session. + * + * @return self + */ + public function setHoursAgo($hours_ago) + { + $this->container['hours_ago'] = $hours_ago; + + return $this; + } + + /** + * Gets radius + * + * @return float|null + */ + public function getRadius() + { + return $this->container['radius']; + } + + /** + * Sets radius + * + * @param float|null $radius If `field` is `location`, this will specify the radius in meters from a provided location point. Use with `lat` and `long`. + * + * @return self + */ + public function setRadius($radius) + { + $this->container['radius'] = $radius; + + return $this; + } + + /** + * Gets lat + * + * @return float|null + */ + public function getLat() + { + return $this->container['lat']; + } + + /** + * Sets lat + * + * @param float|null $lat If `field` is `location`, this is *required* to specify the user's latitude. + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets long + * + * @return float|null + */ + public function getLong() + { + return $this->container['long']; + } + + /** + * Sets long + * + * @param float|null $long If `field` is `location`, this is *required* to specify the user's longitude. + * + * @return self + */ + public function setLong($long) + { + $this->container['long'] = $long; + + return $this; + } + /** * Gets relation * - * @return string + * @return string|null */ public function getRelation() { @@ -381,14 +495,14 @@ public function getRelation() /** * Sets relation * - * @param string $relation Operator of a filter expression. + * @param string|null $relation Required. Operator of a filter expression. * * @return self */ public function setRelation($relation) { $allowedValues = $this->getRelationAllowableValues(); - if (!in_array($relation, $allowedValues, true)) { + if (!is_null($relation) && !in_array($relation, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'relation', must be one of '%s'", diff --git a/lib/model/GenericError.php b/lib/model/GenericError.php index 3788d0e..a047b5a 100644 --- a/lib/model/GenericError.php +++ b/lib/model/GenericError.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -60,7 +60,9 @@ class GenericError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'errors' => '\onesignal\client\model\GenericErrorErrorsInner[]' + 'errors' => 'mixed', + 'success' => 'bool', + 'reference' => 'mixed' ]; /** @@ -71,7 +73,9 @@ class GenericError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'errors' => null + 'errors' => null, + 'success' => null, + 'reference' => null ]; /** @@ -101,7 +105,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'errors' => 'errors' + 'errors' => 'errors', + 'success' => 'success', + 'reference' => 'reference' ]; /** @@ -110,7 +116,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'errors' => 'setErrors' + 'errors' => 'setErrors', + 'success' => 'setSuccess', + 'reference' => 'setReference' ]; /** @@ -119,7 +127,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'errors' => 'getErrors' + 'errors' => 'getErrors', + 'success' => 'getSuccess', + 'reference' => 'getReference' ]; /** @@ -180,6 +190,8 @@ public function getModelName() public function __construct(array $data = null) { $this->container['errors'] = $data['errors'] ?? null; + $this->container['success'] = $data['success'] ?? null; + $this->container['reference'] = $data['reference'] ?? null; } /** @@ -209,7 +221,7 @@ public function valid() /** * Gets errors * - * @return \onesignal\client\model\GenericErrorErrorsInner[]|null + * @return mixed|null */ public function getErrors() { @@ -219,7 +231,7 @@ public function getErrors() /** * Sets errors * - * @param \onesignal\client\model\GenericErrorErrorsInner[]|null $errors errors + * @param mixed|null $errors errors * * @return self */ @@ -229,6 +241,54 @@ public function setErrors($errors) return $this; } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets reference + * + * @return mixed|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param mixed|null $reference reference + * + * @return self + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/model/GenericErrorErrorsInner.php b/lib/model/GenericErrorErrorsInner.php deleted file mode 100644 index 914015f..0000000 --- a/lib/model/GenericErrorErrorsInner.php +++ /dev/null @@ -1,353 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class GenericErrorErrorsInner implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GenericError_errors_inner'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'code' => 'string', - 'title' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'code' => null, - 'title' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'code' => 'code', - 'title' => 'title' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'code' => 'setCode', - 'title' => 'setTitle' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'code' => 'getCode', - 'title' => 'getTitle' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['code'] = $data['code'] ?? null; - $this->container['title'] = $data['title'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets code - * - * @return string|null - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string|null $code code - * - * @return self - */ - public function setCode($code) - { - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets title - * - * @return string|null - */ - public function getTitle() - { - return $this->container['title']; - } - - /** - * Sets title - * - * @param string|null $title title - * - * @return self - */ - public function setTitle($title) - { - $this->container['title'] = $title; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/DeletePlayerSuccessResponse.php b/lib/model/GenericSuccessBoolResponse.php similarity index 95% rename from lib/model/DeletePlayerSuccessResponse.php rename to lib/model/GenericSuccessBoolResponse.php index bc867c3..06975aa 100644 --- a/lib/model/DeletePlayerSuccessResponse.php +++ b/lib/model/GenericSuccessBoolResponse.php @@ -1,6 +1,6 @@ 'int', 'offset' => 'int', 'limit' => 'int', - 'players' => '\onesignal\client\model\Player[]' + 'segments' => '\onesignal\client\model\SegmentData[]' ]; /** @@ -77,7 +77,7 @@ class PlayerSlice implements ModelInterface, ArrayAccess, \JsonSerializable 'total_count' => null, 'offset' => null, 'limit' => null, - 'players' => null + 'segments' => null ]; /** @@ -110,7 +110,7 @@ public static function openAPIFormats() 'total_count' => 'total_count', 'offset' => 'offset', 'limit' => 'limit', - 'players' => 'players' + 'segments' => 'segments' ]; /** @@ -122,7 +122,7 @@ public static function openAPIFormats() 'total_count' => 'setTotalCount', 'offset' => 'setOffset', 'limit' => 'setLimit', - 'players' => 'setPlayers' + 'segments' => 'setSegments' ]; /** @@ -134,7 +134,7 @@ public static function openAPIFormats() 'total_count' => 'getTotalCount', 'offset' => 'getOffset', 'limit' => 'getLimit', - 'players' => 'getPlayers' + 'segments' => 'getSegments' ]; /** @@ -197,7 +197,7 @@ public function __construct(array $data = null) $this->container['total_count'] = $data['total_count'] ?? null; $this->container['offset'] = $data['offset'] ?? null; $this->container['limit'] = $data['limit'] ?? null; - $this->container['players'] = $data['players'] ?? null; + $this->container['segments'] = $data['segments'] ?? null; } /** @@ -237,7 +237,7 @@ public function getTotalCount() /** * Sets total_count * - * @param int|null $total_count total_count + * @param int|null $total_count The number of Segments in the response. * * @return self */ @@ -261,7 +261,7 @@ public function getOffset() /** * Sets offset * - * @param int|null $offset offset + * @param int|null $offset Set with the offset query parameter. Default 0. * * @return self */ @@ -285,7 +285,7 @@ public function getLimit() /** * Sets limit * - * @param int|null $limit limit + * @param int|null $limit Maximum number of Segments returned. Default 300. * * @return self */ @@ -297,25 +297,25 @@ public function setLimit($limit) } /** - * Gets players + * Gets segments * - * @return \onesignal\client\model\Player[]|null + * @return \onesignal\client\model\SegmentData[]|null */ - public function getPlayers() + public function getSegments() { - return $this->container['players']; + return $this->container['segments']; } /** - * Sets players + * Sets segments * - * @param \onesignal\client\model\Player[]|null $players players + * @param \onesignal\client\model\SegmentData[]|null $segments An array containing the Segment information. * * @return self */ - public function setPlayers($players) + public function setSegments($segments) { - $this->container['players'] = $players; + $this->container['segments'] = $segments; return $this; } diff --git a/lib/model/InlineResponse2003.php b/lib/model/InlineResponse2003.php deleted file mode 100644 index 3495a2c..0000000 --- a/lib/model/InlineResponse2003.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class InlineResponse2003 implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'inline_response_200_3'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'in_app_messages' => 'object[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'in_app_messages' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'in_app_messages' => 'in_app_messages' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'in_app_messages' => 'setInAppMessages' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'in_app_messages' => 'getInAppMessages' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['in_app_messages'] = $data['in_app_messages'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets in_app_messages - * - * @return object[]|null - */ - public function getInAppMessages() - { - return $this->container['in_app_messages']; - } - - /** - * Sets in_app_messages - * - * @param object[]|null $in_app_messages in_app_messages - * - * @return self - */ - public function setInAppMessages($in_app_messages) - { - $this->container['in_app_messages'] = $in_app_messages; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/InvalidIdentifierError.php b/lib/model/InvalidIdentifierError.php deleted file mode 100644 index e9ef67e..0000000 --- a/lib/model/InvalidIdentifierError.php +++ /dev/null @@ -1,353 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class InvalidIdentifierError implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'InvalidIdentifierError'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'invalid_external_user_ids' => 'string[]', - 'invalid_player_ids' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'invalid_external_user_ids' => null, - 'invalid_player_ids' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'invalid_external_user_ids' => 'invalid_external_user_ids', - 'invalid_player_ids' => 'invalid_player_ids' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'invalid_external_user_ids' => 'setInvalidExternalUserIds', - 'invalid_player_ids' => 'setInvalidPlayerIds' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'invalid_external_user_ids' => 'getInvalidExternalUserIds', - 'invalid_player_ids' => 'getInvalidPlayerIds' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['invalid_external_user_ids'] = $data['invalid_external_user_ids'] ?? null; - $this->container['invalid_player_ids'] = $data['invalid_player_ids'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets invalid_external_user_ids - * - * @return string[]|null - */ - public function getInvalidExternalUserIds() - { - return $this->container['invalid_external_user_ids']; - } - - /** - * Sets invalid_external_user_ids - * - * @param string[]|null $invalid_external_user_ids Returned if using include_external_user_ids - * - * @return self - */ - public function setInvalidExternalUserIds($invalid_external_user_ids) - { - $this->container['invalid_external_user_ids'] = $invalid_external_user_ids; - - return $this; - } - - /** - * Gets invalid_player_ids - * - * @return string[]|null - */ - public function getInvalidPlayerIds() - { - return $this->container['invalid_player_ids']; - } - - /** - * Sets invalid_player_ids - * - * @param string[]|null $invalid_player_ids Returned if using include_player_ids and some were valid and others were not. - * - * @return self - */ - public function setInvalidPlayerIds($invalid_player_ids) - { - $this->container['invalid_player_ids'] = $invalid_player_ids; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/StringMap.php b/lib/model/LanguageStringMap.php similarity index 99% rename from lib/model/StringMap.php rename to lib/model/LanguageStringMap.php index fd7af4b..0cc51ae 100644 --- a/lib/model/StringMap.php +++ b/lib/model/LanguageStringMap.php @@ -1,6 +1,6 @@ 'string[]', 'excluded_segments' => 'string[]', - 'include_player_ids' => 'string[]', - 'include_external_user_ids' => 'string[]', + 'include_subscription_ids' => 'string[]', 'include_email_tokens' => 'string[]', 'include_phone_numbers' => 'string[]', 'include_ios_tokens' => 'string[]', @@ -72,7 +71,7 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'include_chrome_reg_ids' => 'string[]', 'include_chrome_web_reg_ids' => 'string[]', 'include_android_reg_ids' => 'string[]', - 'include_aliases' => '\onesignal\client\model\PlayerNotificationTargetIncludeAliases', + 'include_aliases' => 'array', 'target_channel' => 'string', 'id' => 'string', 'value' => 'int', @@ -88,13 +87,12 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'is_wp_wns' => 'bool', 'is_adm' => 'bool', 'is_chrome' => 'bool', - 'channel_for_external_user_ids' => 'string', 'app_id' => 'string', 'external_id' => 'string', 'idempotency_key' => 'string', - 'contents' => 'StringMap', - 'headings' => 'StringMap', - 'subtitle' => 'StringMap', + 'contents' => 'LanguageStringMap', + 'headings' => 'LanguageStringMap', + 'subtitle' => 'LanguageStringMap', 'data' => 'object', 'huawei_msg_type' => 'string', 'url' => 'string', @@ -111,7 +109,7 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'chrome_big_picture' => 'string', 'chrome_web_image' => 'string', 'buttons' => '\onesignal\client\model\Button[]', - 'web_buttons' => '\onesignal\client\model\Button[]', + 'web_buttons' => '\onesignal\client\model\WebButton[]', 'ios_category' => 'string', 'android_channel_id' => 'string', 'huawei_channel_id' => 'string', @@ -157,6 +155,8 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'thread_id' => 'string', 'summary_arg' => 'string', 'summary_arg_count' => 'int', + 'ios_relevance_score' => 'float', + 'ios_interruption_level' => 'string', 'email_subject' => 'string', 'email_body' => 'string', 'email_from_name' => 'string', @@ -165,7 +165,7 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'include_unsubscribed' => 'bool', 'sms_from' => 'string', 'sms_media_urls' => 'string[]', - 'filters' => '\onesignal\client\model\Filter[]', + 'filters' => '\onesignal\client\model\FilterExpression[]', 'custom_data' => 'object', 'send_after' => '\DateTime' ]; @@ -180,8 +180,7 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'included_segments' => null, 'excluded_segments' => null, - 'include_player_ids' => null, - 'include_external_user_ids' => null, + 'include_subscription_ids' => null, 'include_email_tokens' => null, 'include_phone_numbers' => null, 'include_ios_tokens' => null, @@ -206,7 +205,6 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'is_wp_wns' => null, 'is_adm' => null, 'is_chrome' => null, - 'channel_for_external_user_ids' => null, 'app_id' => null, 'external_id' => null, 'idempotency_key' => null, @@ -275,6 +273,8 @@ class Notification implements ModelInterface, ArrayAccess, \JsonSerializable 'thread_id' => null, 'summary_arg' => null, 'summary_arg_count' => null, + 'ios_relevance_score' => null, + 'ios_interruption_level' => null, 'email_subject' => null, 'email_body' => null, 'email_from_name' => null, @@ -317,8 +317,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'included_segments' => 'included_segments', 'excluded_segments' => 'excluded_segments', - 'include_player_ids' => 'include_player_ids', - 'include_external_user_ids' => 'include_external_user_ids', + 'include_subscription_ids' => 'include_subscription_ids', 'include_email_tokens' => 'include_email_tokens', 'include_phone_numbers' => 'include_phone_numbers', 'include_ios_tokens' => 'include_ios_tokens', @@ -343,7 +342,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'isWP_WNS', 'is_adm' => 'isAdm', 'is_chrome' => 'isChrome', - 'channel_for_external_user_ids' => 'channel_for_external_user_ids', 'app_id' => 'app_id', 'external_id' => 'external_id', 'idempotency_key' => 'idempotency_key', @@ -412,6 +410,8 @@ public static function openAPIFormats() 'thread_id' => 'thread_id', 'summary_arg' => 'summary_arg', 'summary_arg_count' => 'summary_arg_count', + 'ios_relevance_score' => 'ios_relevance_score', + 'ios_interruption_level' => 'ios_interruption_level', 'email_subject' => 'email_subject', 'email_body' => 'email_body', 'email_from_name' => 'email_from_name', @@ -433,8 +433,7 @@ public static function openAPIFormats() protected static $setters = [ 'included_segments' => 'setIncludedSegments', 'excluded_segments' => 'setExcludedSegments', - 'include_player_ids' => 'setIncludePlayerIds', - 'include_external_user_ids' => 'setIncludeExternalUserIds', + 'include_subscription_ids' => 'setIncludeSubscriptionIds', 'include_email_tokens' => 'setIncludeEmailTokens', 'include_phone_numbers' => 'setIncludePhoneNumbers', 'include_ios_tokens' => 'setIncludeIosTokens', @@ -459,7 +458,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'setIsWpWns', 'is_adm' => 'setIsAdm', 'is_chrome' => 'setIsChrome', - 'channel_for_external_user_ids' => 'setChannelForExternalUserIds', 'app_id' => 'setAppId', 'external_id' => 'setExternalId', 'idempotency_key' => 'setIdempotencyKey', @@ -528,6 +526,8 @@ public static function openAPIFormats() 'thread_id' => 'setThreadId', 'summary_arg' => 'setSummaryArg', 'summary_arg_count' => 'setSummaryArgCount', + 'ios_relevance_score' => 'setIosRelevanceScore', + 'ios_interruption_level' => 'setIosInterruptionLevel', 'email_subject' => 'setEmailSubject', 'email_body' => 'setEmailBody', 'email_from_name' => 'setEmailFromName', @@ -549,8 +549,7 @@ public static function openAPIFormats() protected static $getters = [ 'included_segments' => 'getIncludedSegments', 'excluded_segments' => 'getExcludedSegments', - 'include_player_ids' => 'getIncludePlayerIds', - 'include_external_user_ids' => 'getIncludeExternalUserIds', + 'include_subscription_ids' => 'getIncludeSubscriptionIds', 'include_email_tokens' => 'getIncludeEmailTokens', 'include_phone_numbers' => 'getIncludePhoneNumbers', 'include_ios_tokens' => 'getIncludeIosTokens', @@ -575,7 +574,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'getIsWpWns', 'is_adm' => 'getIsAdm', 'is_chrome' => 'getIsChrome', - 'channel_for_external_user_ids' => 'getChannelForExternalUserIds', 'app_id' => 'getAppId', 'external_id' => 'getExternalId', 'idempotency_key' => 'getIdempotencyKey', @@ -644,6 +642,8 @@ public static function openAPIFormats() 'thread_id' => 'getThreadId', 'summary_arg' => 'getSummaryArg', 'summary_arg_count' => 'getSummaryArgCount', + 'ios_relevance_score' => 'getIosRelevanceScore', + 'ios_interruption_level' => 'getIosInterruptionLevel', 'email_subject' => 'getEmailSubject', 'email_body' => 'getEmailBody', 'email_from_name' => 'getEmailFromName', @@ -748,8 +748,7 @@ public function __construct(array $data = null) { $this->container['included_segments'] = $data['included_segments'] ?? null; $this->container['excluded_segments'] = $data['excluded_segments'] ?? null; - $this->container['include_player_ids'] = $data['include_player_ids'] ?? null; - $this->container['include_external_user_ids'] = $data['include_external_user_ids'] ?? null; + $this->container['include_subscription_ids'] = $data['include_subscription_ids'] ?? null; $this->container['include_email_tokens'] = $data['include_email_tokens'] ?? null; $this->container['include_phone_numbers'] = $data['include_phone_numbers'] ?? null; $this->container['include_ios_tokens'] = $data['include_ios_tokens'] ?? null; @@ -774,7 +773,6 @@ public function __construct(array $data = null) $this->container['is_wp_wns'] = $data['is_wp_wns'] ?? null; $this->container['is_adm'] = $data['is_adm'] ?? null; $this->container['is_chrome'] = $data['is_chrome'] ?? null; - $this->container['channel_for_external_user_ids'] = $data['channel_for_external_user_ids'] ?? null; $this->container['app_id'] = $data['app_id'] ?? null; $this->container['external_id'] = $data['external_id'] ?? null; $this->container['idempotency_key'] = $data['idempotency_key'] ?? null; @@ -843,6 +841,8 @@ public function __construct(array $data = null) $this->container['thread_id'] = $data['thread_id'] ?? null; $this->container['summary_arg'] = $data['summary_arg'] ?? null; $this->container['summary_arg_count'] = $data['summary_arg_count'] ?? null; + $this->container['ios_relevance_score'] = $data['ios_relevance_score'] ?? null; + $this->container['ios_interruption_level'] = $data['ios_interruption_level'] ?? null; $this->container['email_subject'] = $data['email_subject'] ?? null; $this->container['email_body'] = $data['email_body'] ?? null; $this->container['email_from_name'] = $data['email_from_name'] ?? null; @@ -950,53 +950,25 @@ public function setExcludedSegments($excluded_segments) } /** - * Gets include_player_ids + * Gets include_subscription_ids * * @return string[]|null - * @deprecated - */ - public function getIncludePlayerIds() - { - return $this->container['include_player_ids']; - } - - /** - * Sets include_player_ids - * - * @param string[]|null $include_player_ids 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 - * - * @return self - * @deprecated - */ - public function setIncludePlayerIds($include_player_ids) - { - $this->container['include_player_ids'] = $include_player_ids; - - return $this; - } - - /** - * Gets include_external_user_ids - * - * @return string[]|null - * @deprecated */ - public function getIncludeExternalUserIds() + public function getIncludeSubscriptionIds() { - return $this->container['include_external_user_ids']; + return $this->container['include_subscription_ids']; } /** - * Sets include_external_user_ids + * Sets include_subscription_ids * - * @param string[]|null $include_external_user_ids 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. + * @param string[]|null $include_subscription_ids Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call * * @return self - * @deprecated */ - public function setIncludeExternalUserIds($include_external_user_ids) + public function setIncludeSubscriptionIds($include_subscription_ids) { - $this->container['include_external_user_ids'] = $include_external_user_ids; + $this->container['include_subscription_ids'] = $include_subscription_ids; return $this; } @@ -1062,7 +1034,7 @@ public function getIncludeIosTokens() /** * Sets include_ios_tokens * - * @param string[]|null $include_ios_tokens 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 + * @param string[]|null $include_ios_tokens Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1086,7 +1058,7 @@ public function getIncludeWpWnsUris() /** * Sets include_wp_wns_uris * - * @param string[]|null $include_wp_wns_uris 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 + * @param string[]|null $include_wp_wns_uris Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1110,7 +1082,7 @@ public function getIncludeAmazonRegIds() /** * Sets include_amazon_reg_ids * - * @param string[]|null $include_amazon_reg_ids 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 + * @param string[]|null $include_amazon_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1134,7 +1106,7 @@ public function getIncludeChromeRegIds() /** * Sets include_chrome_reg_ids * - * @param string[]|null $include_chrome_reg_ids 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 + * @param string[]|null $include_chrome_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1158,7 +1130,7 @@ public function getIncludeChromeWebRegIds() /** * Sets include_chrome_web_reg_ids * - * @param string[]|null $include_chrome_web_reg_ids 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 + * @param string[]|null $include_chrome_web_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1182,7 +1154,7 @@ public function getIncludeAndroidRegIds() /** * Sets include_android_reg_ids * - * @param string[]|null $include_android_reg_ids 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 + * @param string[]|null $include_android_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1196,7 +1168,7 @@ public function setIncludeAndroidRegIds($include_android_reg_ids) /** * Gets include_aliases * - * @return \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null + * @return array|null */ public function getIncludeAliases() { @@ -1206,7 +1178,7 @@ public function getIncludeAliases() /** * Sets include_aliases * - * @param \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null $include_aliases include_aliases + * @param array|null $include_aliases Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. * * @return self */ @@ -1597,30 +1569,6 @@ public function setIsChrome($is_chrome) return $this; } - /** - * Gets channel_for_external_user_ids - * - * @return string|null - */ - public function getChannelForExternalUserIds() - { - return $this->container['channel_for_external_user_ids']; - } - - /** - * Sets channel_for_external_user_ids - * - * @param string|null $channel_for_external_user_ids 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. - * - * @return self - */ - public function setChannelForExternalUserIds($channel_for_external_user_ids) - { - $this->container['channel_for_external_user_ids'] = $channel_for_external_user_ids; - - return $this; - } - /** * Gets app_id * @@ -1698,7 +1646,7 @@ public function setIdempotencyKey($idempotency_key) /** * Gets contents * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getContents() { @@ -1708,7 +1656,7 @@ public function getContents() /** * Sets contents * - * @param StringMap|null $contents contents + * @param LanguageStringMap|null $contents contents * * @return self */ @@ -1722,7 +1670,7 @@ public function setContents($contents) /** * Gets headings * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getHeadings() { @@ -1732,7 +1680,7 @@ public function getHeadings() /** * Sets headings * - * @param StringMap|null $headings headings + * @param LanguageStringMap|null $headings headings * * @return self */ @@ -1746,7 +1694,7 @@ public function setHeadings($headings) /** * Gets subtitle * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getSubtitle() { @@ -1756,7 +1704,7 @@ public function getSubtitle() /** * Sets subtitle * - * @param StringMap|null $subtitle subtitle + * @param LanguageStringMap|null $subtitle subtitle * * @return self */ @@ -2154,7 +2102,7 @@ public function setButtons($buttons) /** * Gets web_buttons * - * @return \onesignal\client\model\Button[]|null + * @return \onesignal\client\model\WebButton[]|null */ public function getWebButtons() { @@ -2164,7 +2112,7 @@ public function getWebButtons() /** * Sets web_buttons * - * @param \onesignal\client\model\Button[]|null $web_buttons 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\"}] + * @param \onesignal\client\model\WebButton[]|null $web_buttons 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\"}] * * @return self */ @@ -3255,6 +3203,54 @@ public function setSummaryArgCount($summary_arg_count) return $this; } + /** + * Gets ios_relevance_score + * + * @return float|null + */ + public function getIosRelevanceScore() + { + return $this->container['ios_relevance_score']; + } + + /** + * Sets ios_relevance_score + * + * @param float|null $ios_relevance_score Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. + * + * @return self + */ + public function setIosRelevanceScore($ios_relevance_score) + { + $this->container['ios_relevance_score'] = $ios_relevance_score; + + return $this; + } + + /** + * Gets ios_interruption_level + * + * @return string|null + */ + public function getIosInterruptionLevel() + { + return $this->container['ios_interruption_level']; + } + + /** + * Sets ios_interruption_level + * + * @param string|null $ios_interruption_level Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. + * + * @return self + */ + public function setIosInterruptionLevel($ios_interruption_level) + { + $this->container['ios_interruption_level'] = $ios_interruption_level; + + return $this; + } + /** * Gets email_subject * @@ -3450,7 +3446,7 @@ public function setSmsMediaUrls($sms_media_urls) /** * Gets filters * - * @return \onesignal\client\model\Filter[]|null + * @return \onesignal\client\model\FilterExpression[]|null */ public function getFilters() { @@ -3460,7 +3456,7 @@ public function getFilters() /** * Sets filters * - * @param \onesignal\client\model\Filter[]|null $filters filters + * @param \onesignal\client\model\FilterExpression[]|null $filters filters * * @return self */ diff --git a/lib/model/Notification200Errors.php b/lib/model/Notification200Errors.php deleted file mode 100644 index 75af679..0000000 --- a/lib/model/Notification200Errors.php +++ /dev/null @@ -1,353 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class Notification200Errors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Notification200Errors'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'invalid_external_user_ids' => 'string[]', - 'invalid_player_ids' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'invalid_external_user_ids' => null, - 'invalid_player_ids' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'invalid_external_user_ids' => 'invalid_external_user_ids', - 'invalid_player_ids' => 'invalid_player_ids' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'invalid_external_user_ids' => 'setInvalidExternalUserIds', - 'invalid_player_ids' => 'setInvalidPlayerIds' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'invalid_external_user_ids' => 'getInvalidExternalUserIds', - 'invalid_player_ids' => 'getInvalidPlayerIds' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['invalid_external_user_ids'] = $data['invalid_external_user_ids'] ?? null; - $this->container['invalid_player_ids'] = $data['invalid_player_ids'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets invalid_external_user_ids - * - * @return string[]|null - */ - public function getInvalidExternalUserIds() - { - return $this->container['invalid_external_user_ids']; - } - - /** - * Sets invalid_external_user_ids - * - * @param string[]|null $invalid_external_user_ids Returned if using include_external_user_ids - * - * @return self - */ - public function setInvalidExternalUserIds($invalid_external_user_ids) - { - $this->container['invalid_external_user_ids'] = $invalid_external_user_ids; - - return $this; - } - - /** - * Gets invalid_player_ids - * - * @return string[]|null - */ - public function getInvalidPlayerIds() - { - return $this->container['invalid_player_ids']; - } - - /** - * Sets invalid_player_ids - * - * @param string[]|null $invalid_player_ids Returned if using include_player_ids and some were valid and others were not. - * - * @return self - */ - public function setInvalidPlayerIds($invalid_player_ids) - { - $this->container['invalid_player_ids'] = $invalid_player_ids; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/NotificationAllOf.php b/lib/model/NotificationAllOf.php index 32f713b..4fbd53a 100644 --- a/lib/model/NotificationAllOf.php +++ b/lib/model/NotificationAllOf.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationHistorySuccessResponse.php b/lib/model/NotificationHistorySuccessResponse.php index d08438b..d3a521b 100644 --- a/lib/model/NotificationHistorySuccessResponse.php +++ b/lib/model/NotificationHistorySuccessResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationSlice.php b/lib/model/NotificationSlice.php index 48ff757..8d50177 100644 --- a/lib/model/NotificationSlice.php +++ b/lib/model/NotificationSlice.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationTarget.php b/lib/model/NotificationTarget.php index 4f85054..0c9a691 100644 --- a/lib/model/NotificationTarget.php +++ b/lib/model/NotificationTarget.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -62,8 +62,7 @@ class NotificationTarget implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'included_segments' => 'string[]', 'excluded_segments' => 'string[]', - 'include_player_ids' => 'string[]', - 'include_external_user_ids' => 'string[]', + 'include_subscription_ids' => 'string[]', 'include_email_tokens' => 'string[]', 'include_phone_numbers' => 'string[]', 'include_ios_tokens' => 'string[]', @@ -72,7 +71,7 @@ class NotificationTarget implements ModelInterface, ArrayAccess, \JsonSerializab 'include_chrome_reg_ids' => 'string[]', 'include_chrome_web_reg_ids' => 'string[]', 'include_android_reg_ids' => 'string[]', - 'include_aliases' => '\onesignal\client\model\PlayerNotificationTargetIncludeAliases', + 'include_aliases' => 'array', 'target_channel' => 'string' ]; @@ -86,8 +85,7 @@ class NotificationTarget implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'included_segments' => null, 'excluded_segments' => null, - 'include_player_ids' => null, - 'include_external_user_ids' => null, + 'include_subscription_ids' => null, 'include_email_tokens' => null, 'include_phone_numbers' => null, 'include_ios_tokens' => null, @@ -129,8 +127,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'included_segments' => 'included_segments', 'excluded_segments' => 'excluded_segments', - 'include_player_ids' => 'include_player_ids', - 'include_external_user_ids' => 'include_external_user_ids', + 'include_subscription_ids' => 'include_subscription_ids', 'include_email_tokens' => 'include_email_tokens', 'include_phone_numbers' => 'include_phone_numbers', 'include_ios_tokens' => 'include_ios_tokens', @@ -151,8 +148,7 @@ public static function openAPIFormats() protected static $setters = [ 'included_segments' => 'setIncludedSegments', 'excluded_segments' => 'setExcludedSegments', - 'include_player_ids' => 'setIncludePlayerIds', - 'include_external_user_ids' => 'setIncludeExternalUserIds', + 'include_subscription_ids' => 'setIncludeSubscriptionIds', 'include_email_tokens' => 'setIncludeEmailTokens', 'include_phone_numbers' => 'setIncludePhoneNumbers', 'include_ios_tokens' => 'setIncludeIosTokens', @@ -173,8 +169,7 @@ public static function openAPIFormats() protected static $getters = [ 'included_segments' => 'getIncludedSegments', 'excluded_segments' => 'getExcludedSegments', - 'include_player_ids' => 'getIncludePlayerIds', - 'include_external_user_ids' => 'getIncludeExternalUserIds', + 'include_subscription_ids' => 'getIncludeSubscriptionIds', 'include_email_tokens' => 'getIncludeEmailTokens', 'include_phone_numbers' => 'getIncludePhoneNumbers', 'include_ios_tokens' => 'getIncludeIosTokens', @@ -263,8 +258,7 @@ public function __construct(array $data = null) { $this->container['included_segments'] = $data['included_segments'] ?? null; $this->container['excluded_segments'] = $data['excluded_segments'] ?? null; - $this->container['include_player_ids'] = $data['include_player_ids'] ?? null; - $this->container['include_external_user_ids'] = $data['include_external_user_ids'] ?? null; + $this->container['include_subscription_ids'] = $data['include_subscription_ids'] ?? null; $this->container['include_email_tokens'] = $data['include_email_tokens'] ?? null; $this->container['include_phone_numbers'] = $data['include_phone_numbers'] ?? null; $this->container['include_ios_tokens'] = $data['include_ios_tokens'] ?? null; @@ -359,53 +353,25 @@ public function setExcludedSegments($excluded_segments) } /** - * Gets include_player_ids + * Gets include_subscription_ids * * @return string[]|null - * @deprecated */ - public function getIncludePlayerIds() + public function getIncludeSubscriptionIds() { - return $this->container['include_player_ids']; + return $this->container['include_subscription_ids']; } /** - * Sets include_player_ids + * Sets include_subscription_ids * - * @param string[]|null $include_player_ids 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 + * @param string[]|null $include_subscription_ids Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call * * @return self - * @deprecated */ - public function setIncludePlayerIds($include_player_ids) + public function setIncludeSubscriptionIds($include_subscription_ids) { - $this->container['include_player_ids'] = $include_player_ids; - - return $this; - } - - /** - * Gets include_external_user_ids - * - * @return string[]|null - * @deprecated - */ - public function getIncludeExternalUserIds() - { - return $this->container['include_external_user_ids']; - } - - /** - * Sets include_external_user_ids - * - * @param string[]|null $include_external_user_ids 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. - * - * @return self - * @deprecated - */ - public function setIncludeExternalUserIds($include_external_user_ids) - { - $this->container['include_external_user_ids'] = $include_external_user_ids; + $this->container['include_subscription_ids'] = $include_subscription_ids; return $this; } @@ -471,7 +437,7 @@ public function getIncludeIosTokens() /** * Sets include_ios_tokens * - * @param string[]|null $include_ios_tokens 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 + * @param string[]|null $include_ios_tokens Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -495,7 +461,7 @@ public function getIncludeWpWnsUris() /** * Sets include_wp_wns_uris * - * @param string[]|null $include_wp_wns_uris 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 + * @param string[]|null $include_wp_wns_uris Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -519,7 +485,7 @@ public function getIncludeAmazonRegIds() /** * Sets include_amazon_reg_ids * - * @param string[]|null $include_amazon_reg_ids 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 + * @param string[]|null $include_amazon_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -543,7 +509,7 @@ public function getIncludeChromeRegIds() /** * Sets include_chrome_reg_ids * - * @param string[]|null $include_chrome_reg_ids 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 + * @param string[]|null $include_chrome_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -567,7 +533,7 @@ public function getIncludeChromeWebRegIds() /** * Sets include_chrome_web_reg_ids * - * @param string[]|null $include_chrome_web_reg_ids 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 + * @param string[]|null $include_chrome_web_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -591,7 +557,7 @@ public function getIncludeAndroidRegIds() /** * Sets include_android_reg_ids * - * @param string[]|null $include_android_reg_ids 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 + * @param string[]|null $include_android_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -605,7 +571,7 @@ public function setIncludeAndroidRegIds($include_android_reg_ids) /** * Gets include_aliases * - * @return \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null + * @return array|null */ public function getIncludeAliases() { @@ -615,7 +581,7 @@ public function getIncludeAliases() /** * Sets include_aliases * - * @param \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null $include_aliases include_aliases + * @param array|null $include_aliases Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. * * @return self */ diff --git a/lib/model/NotificationWithMeta.php b/lib/model/NotificationWithMeta.php index c39ff1b..9d2f49a 100644 --- a/lib/model/NotificationWithMeta.php +++ b/lib/model/NotificationWithMeta.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -62,8 +62,7 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'included_segments' => 'string[]', 'excluded_segments' => 'string[]', - 'include_player_ids' => 'string[]', - 'include_external_user_ids' => 'string[]', + 'include_subscription_ids' => 'string[]', 'include_email_tokens' => 'string[]', 'include_phone_numbers' => 'string[]', 'include_ios_tokens' => 'string[]', @@ -72,7 +71,7 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'include_chrome_reg_ids' => 'string[]', 'include_chrome_web_reg_ids' => 'string[]', 'include_android_reg_ids' => 'string[]', - 'include_aliases' => '\onesignal\client\model\PlayerNotificationTargetIncludeAliases', + 'include_aliases' => 'array', 'target_channel' => 'string', 'id' => 'string', 'value' => 'int', @@ -88,13 +87,12 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'is_wp_wns' => 'bool', 'is_adm' => 'bool', 'is_chrome' => 'bool', - 'channel_for_external_user_ids' => 'string', 'app_id' => 'string', 'external_id' => 'string', 'idempotency_key' => 'string', - 'contents' => 'StringMap', - 'headings' => 'StringMap', - 'subtitle' => 'StringMap', + 'contents' => 'LanguageStringMap', + 'headings' => 'LanguageStringMap', + 'subtitle' => 'LanguageStringMap', 'data' => 'object', 'huawei_msg_type' => 'string', 'url' => 'string', @@ -111,7 +109,7 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'chrome_big_picture' => 'string', 'chrome_web_image' => 'string', 'buttons' => '\onesignal\client\model\Button[]', - 'web_buttons' => '\onesignal\client\model\Button[]', + 'web_buttons' => '\onesignal\client\model\WebButton[]', 'ios_category' => 'string', 'android_channel_id' => 'string', 'huawei_channel_id' => 'string', @@ -157,6 +155,8 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'thread_id' => 'string', 'summary_arg' => 'string', 'summary_arg_count' => 'int', + 'ios_relevance_score' => 'float', + 'ios_interruption_level' => 'string', 'email_subject' => 'string', 'email_body' => 'string', 'email_from_name' => 'string', @@ -165,7 +165,7 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'include_unsubscribed' => 'bool', 'sms_from' => 'string', 'sms_media_urls' => 'string[]', - 'filters' => '\onesignal\client\model\Filter[]', + 'filters' => '\onesignal\client\model\FilterExpression[]', 'custom_data' => 'object', 'successful' => 'int', 'failed' => 'int', @@ -190,8 +190,7 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPIFormats = [ 'included_segments' => null, 'excluded_segments' => null, - 'include_player_ids' => null, - 'include_external_user_ids' => null, + 'include_subscription_ids' => null, 'include_email_tokens' => null, 'include_phone_numbers' => null, 'include_ios_tokens' => null, @@ -216,7 +215,6 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'is_wp_wns' => null, 'is_adm' => null, 'is_chrome' => null, - 'channel_for_external_user_ids' => null, 'app_id' => null, 'external_id' => null, 'idempotency_key' => null, @@ -285,6 +283,8 @@ class NotificationWithMeta implements ModelInterface, ArrayAccess, \JsonSerializ 'thread_id' => null, 'summary_arg' => null, 'summary_arg_count' => null, + 'ios_relevance_score' => null, + 'ios_interruption_level' => null, 'email_subject' => null, 'email_body' => null, 'email_from_name' => null, @@ -337,8 +337,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'included_segments' => 'included_segments', 'excluded_segments' => 'excluded_segments', - 'include_player_ids' => 'include_player_ids', - 'include_external_user_ids' => 'include_external_user_ids', + 'include_subscription_ids' => 'include_subscription_ids', 'include_email_tokens' => 'include_email_tokens', 'include_phone_numbers' => 'include_phone_numbers', 'include_ios_tokens' => 'include_ios_tokens', @@ -363,7 +362,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'isWP_WNS', 'is_adm' => 'isAdm', 'is_chrome' => 'isChrome', - 'channel_for_external_user_ids' => 'channel_for_external_user_ids', 'app_id' => 'app_id', 'external_id' => 'external_id', 'idempotency_key' => 'idempotency_key', @@ -432,6 +430,8 @@ public static function openAPIFormats() 'thread_id' => 'thread_id', 'summary_arg' => 'summary_arg', 'summary_arg_count' => 'summary_arg_count', + 'ios_relevance_score' => 'ios_relevance_score', + 'ios_interruption_level' => 'ios_interruption_level', 'email_subject' => 'email_subject', 'email_body' => 'email_body', 'email_from_name' => 'email_from_name', @@ -463,8 +463,7 @@ public static function openAPIFormats() protected static $setters = [ 'included_segments' => 'setIncludedSegments', 'excluded_segments' => 'setExcludedSegments', - 'include_player_ids' => 'setIncludePlayerIds', - 'include_external_user_ids' => 'setIncludeExternalUserIds', + 'include_subscription_ids' => 'setIncludeSubscriptionIds', 'include_email_tokens' => 'setIncludeEmailTokens', 'include_phone_numbers' => 'setIncludePhoneNumbers', 'include_ios_tokens' => 'setIncludeIosTokens', @@ -489,7 +488,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'setIsWpWns', 'is_adm' => 'setIsAdm', 'is_chrome' => 'setIsChrome', - 'channel_for_external_user_ids' => 'setChannelForExternalUserIds', 'app_id' => 'setAppId', 'external_id' => 'setExternalId', 'idempotency_key' => 'setIdempotencyKey', @@ -558,6 +556,8 @@ public static function openAPIFormats() 'thread_id' => 'setThreadId', 'summary_arg' => 'setSummaryArg', 'summary_arg_count' => 'setSummaryArgCount', + 'ios_relevance_score' => 'setIosRelevanceScore', + 'ios_interruption_level' => 'setIosInterruptionLevel', 'email_subject' => 'setEmailSubject', 'email_body' => 'setEmailBody', 'email_from_name' => 'setEmailFromName', @@ -589,8 +589,7 @@ public static function openAPIFormats() protected static $getters = [ 'included_segments' => 'getIncludedSegments', 'excluded_segments' => 'getExcludedSegments', - 'include_player_ids' => 'getIncludePlayerIds', - 'include_external_user_ids' => 'getIncludeExternalUserIds', + 'include_subscription_ids' => 'getIncludeSubscriptionIds', 'include_email_tokens' => 'getIncludeEmailTokens', 'include_phone_numbers' => 'getIncludePhoneNumbers', 'include_ios_tokens' => 'getIncludeIosTokens', @@ -615,7 +614,6 @@ public static function openAPIFormats() 'is_wp_wns' => 'getIsWpWns', 'is_adm' => 'getIsAdm', 'is_chrome' => 'getIsChrome', - 'channel_for_external_user_ids' => 'getChannelForExternalUserIds', 'app_id' => 'getAppId', 'external_id' => 'getExternalId', 'idempotency_key' => 'getIdempotencyKey', @@ -684,6 +682,8 @@ public static function openAPIFormats() 'thread_id' => 'getThreadId', 'summary_arg' => 'getSummaryArg', 'summary_arg_count' => 'getSummaryArgCount', + 'ios_relevance_score' => 'getIosRelevanceScore', + 'ios_interruption_level' => 'getIosInterruptionLevel', 'email_subject' => 'getEmailSubject', 'email_body' => 'getEmailBody', 'email_from_name' => 'getEmailFromName', @@ -798,8 +798,7 @@ public function __construct(array $data = null) { $this->container['included_segments'] = $data['included_segments'] ?? null; $this->container['excluded_segments'] = $data['excluded_segments'] ?? null; - $this->container['include_player_ids'] = $data['include_player_ids'] ?? null; - $this->container['include_external_user_ids'] = $data['include_external_user_ids'] ?? null; + $this->container['include_subscription_ids'] = $data['include_subscription_ids'] ?? null; $this->container['include_email_tokens'] = $data['include_email_tokens'] ?? null; $this->container['include_phone_numbers'] = $data['include_phone_numbers'] ?? null; $this->container['include_ios_tokens'] = $data['include_ios_tokens'] ?? null; @@ -824,7 +823,6 @@ public function __construct(array $data = null) $this->container['is_wp_wns'] = $data['is_wp_wns'] ?? null; $this->container['is_adm'] = $data['is_adm'] ?? null; $this->container['is_chrome'] = $data['is_chrome'] ?? null; - $this->container['channel_for_external_user_ids'] = $data['channel_for_external_user_ids'] ?? null; $this->container['app_id'] = $data['app_id'] ?? null; $this->container['external_id'] = $data['external_id'] ?? null; $this->container['idempotency_key'] = $data['idempotency_key'] ?? null; @@ -893,6 +891,8 @@ public function __construct(array $data = null) $this->container['thread_id'] = $data['thread_id'] ?? null; $this->container['summary_arg'] = $data['summary_arg'] ?? null; $this->container['summary_arg_count'] = $data['summary_arg_count'] ?? null; + $this->container['ios_relevance_score'] = $data['ios_relevance_score'] ?? null; + $this->container['ios_interruption_level'] = $data['ios_interruption_level'] ?? null; $this->container['email_subject'] = $data['email_subject'] ?? null; $this->container['email_body'] = $data['email_body'] ?? null; $this->container['email_from_name'] = $data['email_from_name'] ?? null; @@ -1010,53 +1010,25 @@ public function setExcludedSegments($excluded_segments) } /** - * Gets include_player_ids + * Gets include_subscription_ids * * @return string[]|null - * @deprecated - */ - public function getIncludePlayerIds() - { - return $this->container['include_player_ids']; - } - - /** - * Sets include_player_ids - * - * @param string[]|null $include_player_ids 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 - * - * @return self - * @deprecated - */ - public function setIncludePlayerIds($include_player_ids) - { - $this->container['include_player_ids'] = $include_player_ids; - - return $this; - } - - /** - * Gets include_external_user_ids - * - * @return string[]|null - * @deprecated */ - public function getIncludeExternalUserIds() + public function getIncludeSubscriptionIds() { - return $this->container['include_external_user_ids']; + return $this->container['include_subscription_ids']; } /** - * Sets include_external_user_ids + * Sets include_subscription_ids * - * @param string[]|null $include_external_user_ids 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. + * @param string[]|null $include_subscription_ids Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call * * @return self - * @deprecated */ - public function setIncludeExternalUserIds($include_external_user_ids) + public function setIncludeSubscriptionIds($include_subscription_ids) { - $this->container['include_external_user_ids'] = $include_external_user_ids; + $this->container['include_subscription_ids'] = $include_subscription_ids; return $this; } @@ -1122,7 +1094,7 @@ public function getIncludeIosTokens() /** * Sets include_ios_tokens * - * @param string[]|null $include_ios_tokens 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 + * @param string[]|null $include_ios_tokens Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1146,7 +1118,7 @@ public function getIncludeWpWnsUris() /** * Sets include_wp_wns_uris * - * @param string[]|null $include_wp_wns_uris 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 + * @param string[]|null $include_wp_wns_uris Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1170,7 +1142,7 @@ public function getIncludeAmazonRegIds() /** * Sets include_amazon_reg_ids * - * @param string[]|null $include_amazon_reg_ids 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 + * @param string[]|null $include_amazon_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1194,7 +1166,7 @@ public function getIncludeChromeRegIds() /** * Sets include_chrome_reg_ids * - * @param string[]|null $include_chrome_reg_ids 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 + * @param string[]|null $include_chrome_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1218,7 +1190,7 @@ public function getIncludeChromeWebRegIds() /** * Sets include_chrome_web_reg_ids * - * @param string[]|null $include_chrome_web_reg_ids 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 + * @param string[]|null $include_chrome_web_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1242,7 +1214,7 @@ public function getIncludeAndroidRegIds() /** * Sets include_android_reg_ids * - * @param string[]|null $include_android_reg_ids 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 + * @param string[]|null $include_android_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -1256,7 +1228,7 @@ public function setIncludeAndroidRegIds($include_android_reg_ids) /** * Gets include_aliases * - * @return \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null + * @return array|null */ public function getIncludeAliases() { @@ -1266,7 +1238,7 @@ public function getIncludeAliases() /** * Sets include_aliases * - * @param \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null $include_aliases include_aliases + * @param array|null $include_aliases Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. * * @return self */ @@ -1657,30 +1629,6 @@ public function setIsChrome($is_chrome) return $this; } - /** - * Gets channel_for_external_user_ids - * - * @return string|null - */ - public function getChannelForExternalUserIds() - { - return $this->container['channel_for_external_user_ids']; - } - - /** - * Sets channel_for_external_user_ids - * - * @param string|null $channel_for_external_user_ids 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. - * - * @return self - */ - public function setChannelForExternalUserIds($channel_for_external_user_ids) - { - $this->container['channel_for_external_user_ids'] = $channel_for_external_user_ids; - - return $this; - } - /** * Gets app_id * @@ -1758,7 +1706,7 @@ public function setIdempotencyKey($idempotency_key) /** * Gets contents * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getContents() { @@ -1768,7 +1716,7 @@ public function getContents() /** * Sets contents * - * @param StringMap|null $contents contents + * @param LanguageStringMap|null $contents contents * * @return self */ @@ -1782,7 +1730,7 @@ public function setContents($contents) /** * Gets headings * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getHeadings() { @@ -1792,7 +1740,7 @@ public function getHeadings() /** * Sets headings * - * @param StringMap|null $headings headings + * @param LanguageStringMap|null $headings headings * * @return self */ @@ -1806,7 +1754,7 @@ public function setHeadings($headings) /** * Gets subtitle * - * @return StringMap|null + * @return LanguageStringMap|null */ public function getSubtitle() { @@ -1816,7 +1764,7 @@ public function getSubtitle() /** * Sets subtitle * - * @param StringMap|null $subtitle subtitle + * @param LanguageStringMap|null $subtitle subtitle * * @return self */ @@ -2214,7 +2162,7 @@ public function setButtons($buttons) /** * Gets web_buttons * - * @return \onesignal\client\model\Button[]|null + * @return \onesignal\client\model\WebButton[]|null */ public function getWebButtons() { @@ -2224,7 +2172,7 @@ public function getWebButtons() /** * Sets web_buttons * - * @param \onesignal\client\model\Button[]|null $web_buttons 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\"}] + * @param \onesignal\client\model\WebButton[]|null $web_buttons 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\"}] * * @return self */ @@ -3315,6 +3263,54 @@ public function setSummaryArgCount($summary_arg_count) return $this; } + /** + * Gets ios_relevance_score + * + * @return float|null + */ + public function getIosRelevanceScore() + { + return $this->container['ios_relevance_score']; + } + + /** + * Sets ios_relevance_score + * + * @param float|null $ios_relevance_score Channel: Push Notifications Platform: iOS 15+ A score to be set per notification to indicate how it should be displayed when grouped. Use a float between 0-1. + * + * @return self + */ + public function setIosRelevanceScore($ios_relevance_score) + { + $this->container['ios_relevance_score'] = $ios_relevance_score; + + return $this; + } + + /** + * Gets ios_interruption_level + * + * @return string|null + */ + public function getIosInterruptionLevel() + { + return $this->container['ios_interruption_level']; + } + + /** + * Sets ios_interruption_level + * + * @param string|null $ios_interruption_level Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active. + * + * @return self + */ + public function setIosInterruptionLevel($ios_interruption_level) + { + $this->container['ios_interruption_level'] = $ios_interruption_level; + + return $this; + } + /** * Gets email_subject * @@ -3510,7 +3506,7 @@ public function setSmsMediaUrls($sms_media_urls) /** * Gets filters * - * @return \onesignal\client\model\Filter[]|null + * @return \onesignal\client\model\FilterExpression[]|null */ public function getFilters() { @@ -3520,7 +3516,7 @@ public function getFilters() /** * Sets filters * - * @param \onesignal\client\model\Filter[]|null $filters filters + * @param \onesignal\client\model\FilterExpression[]|null $filters filters * * @return self */ diff --git a/lib/model/NotificationWithMetaAllOf.php b/lib/model/NotificationWithMetaAllOf.php index 4c5ef1b..d14cc7e 100644 --- a/lib/model/NotificationWithMetaAllOf.php +++ b/lib/model/NotificationWithMetaAllOf.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Operator.php b/lib/model/Operator.php index 0785da2..692ec2d 100644 --- a/lib/model/Operator.php +++ b/lib/model/Operator.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/OutcomeData.php b/lib/model/OutcomeData.php index a35d7c2..ebcf7ce 100644 --- a/lib/model/OutcomeData.php +++ b/lib/model/OutcomeData.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/OutcomesData.php b/lib/model/OutcomesData.php index 3784687..9576e49 100644 --- a/lib/model/OutcomesData.php +++ b/lib/model/OutcomesData.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryData.php b/lib/model/PlatformDeliveryData.php index 237f2fa..e4af105 100644 --- a/lib/model/PlatformDeliveryData.php +++ b/lib/model/PlatformDeliveryData.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryDataEmailAllOf.php b/lib/model/PlatformDeliveryDataEmailAllOf.php index d2a2749..ed1fac1 100644 --- a/lib/model/PlatformDeliveryDataEmailAllOf.php +++ b/lib/model/PlatformDeliveryDataEmailAllOf.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryDataSmsAllOf.php b/lib/model/PlatformDeliveryDataSmsAllOf.php index 128826c..55c791a 100644 --- a/lib/model/PlatformDeliveryDataSmsAllOf.php +++ b/lib/model/PlatformDeliveryDataSmsAllOf.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Player.php b/lib/model/Player.php deleted file mode 100644 index 634d274..0000000 --- a/lib/model/Player.php +++ /dev/null @@ -1,1106 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class Player implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Player'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'invalid_identifier' => 'bool', - 'app_id' => 'string', - 'device_type' => 'int', - 'external_user_id' => 'string', - 'external_user_id_auth_hash' => 'string', - 'email_auth_hash' => 'string', - 'identifier' => 'string', - 'language' => 'string', - 'timezone' => 'int', - 'game_version' => 'string', - 'device_model' => 'string', - 'device_os' => 'string', - 'ad_id' => 'string', - 'sdk' => 'string', - 'session_count' => 'int', - 'tags' => 'object', - 'amount_spent' => 'float', - 'created_at' => 'int', - 'playtime' => 'int', - 'badge_count' => 'int', - 'last_active' => 'int', - 'notification_types' => 'int', - 'test_type' => 'int', - 'long' => 'float', - 'lat' => 'float', - 'country' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'invalid_identifier' => null, - 'app_id' => null, - 'device_type' => null, - 'external_user_id' => null, - 'external_user_id_auth_hash' => null, - 'email_auth_hash' => null, - 'identifier' => null, - 'language' => null, - 'timezone' => null, - 'game_version' => null, - 'device_model' => null, - 'device_os' => null, - 'ad_id' => null, - 'sdk' => null, - 'session_count' => null, - 'tags' => null, - 'amount_spent' => null, - 'created_at' => 'int64', - 'playtime' => 'int64', - 'badge_count' => null, - 'last_active' => null, - 'notification_types' => null, - 'test_type' => null, - 'long' => null, - 'lat' => null, - 'country' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'invalid_identifier' => 'invalid_identifier', - 'app_id' => 'app_id', - 'device_type' => 'device_type', - 'external_user_id' => 'external_user_id', - 'external_user_id_auth_hash' => 'external_user_id_auth_hash', - 'email_auth_hash' => 'email_auth_hash', - 'identifier' => 'identifier', - 'language' => 'language', - 'timezone' => 'timezone', - 'game_version' => 'game_version', - 'device_model' => 'device_model', - 'device_os' => 'device_os', - 'ad_id' => 'ad_id', - 'sdk' => 'sdk', - 'session_count' => 'session_count', - 'tags' => 'tags', - 'amount_spent' => 'amount_spent', - 'created_at' => 'created_at', - 'playtime' => 'playtime', - 'badge_count' => 'badge_count', - 'last_active' => 'last_active', - 'notification_types' => 'notification_types', - 'test_type' => 'test_type', - 'long' => 'long', - 'lat' => 'lat', - 'country' => 'country' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'invalid_identifier' => 'setInvalidIdentifier', - 'app_id' => 'setAppId', - 'device_type' => 'setDeviceType', - 'external_user_id' => 'setExternalUserId', - 'external_user_id_auth_hash' => 'setExternalUserIdAuthHash', - 'email_auth_hash' => 'setEmailAuthHash', - 'identifier' => 'setIdentifier', - 'language' => 'setLanguage', - 'timezone' => 'setTimezone', - 'game_version' => 'setGameVersion', - 'device_model' => 'setDeviceModel', - 'device_os' => 'setDeviceOs', - 'ad_id' => 'setAdId', - 'sdk' => 'setSdk', - 'session_count' => 'setSessionCount', - 'tags' => 'setTags', - 'amount_spent' => 'setAmountSpent', - 'created_at' => 'setCreatedAt', - 'playtime' => 'setPlaytime', - 'badge_count' => 'setBadgeCount', - 'last_active' => 'setLastActive', - 'notification_types' => 'setNotificationTypes', - 'test_type' => 'setTestType', - 'long' => 'setLong', - 'lat' => 'setLat', - 'country' => 'setCountry' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'invalid_identifier' => 'getInvalidIdentifier', - 'app_id' => 'getAppId', - 'device_type' => 'getDeviceType', - 'external_user_id' => 'getExternalUserId', - 'external_user_id_auth_hash' => 'getExternalUserIdAuthHash', - 'email_auth_hash' => 'getEmailAuthHash', - 'identifier' => 'getIdentifier', - 'language' => 'getLanguage', - 'timezone' => 'getTimezone', - 'game_version' => 'getGameVersion', - 'device_model' => 'getDeviceModel', - 'device_os' => 'getDeviceOs', - 'ad_id' => 'getAdId', - 'sdk' => 'getSdk', - 'session_count' => 'getSessionCount', - 'tags' => 'getTags', - 'amount_spent' => 'getAmountSpent', - 'created_at' => 'getCreatedAt', - 'playtime' => 'getPlaytime', - 'badge_count' => 'getBadgeCount', - 'last_active' => 'getLastActive', - 'notification_types' => 'getNotificationTypes', - 'test_type' => 'getTestType', - 'long' => 'getLong', - 'lat' => 'getLat', - 'country' => 'getCountry' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = $data['id'] ?? null; - $this->container['invalid_identifier'] = $data['invalid_identifier'] ?? null; - $this->container['app_id'] = $data['app_id'] ?? null; - $this->container['device_type'] = $data['device_type'] ?? null; - $this->container['external_user_id'] = $data['external_user_id'] ?? null; - $this->container['external_user_id_auth_hash'] = $data['external_user_id_auth_hash'] ?? null; - $this->container['email_auth_hash'] = $data['email_auth_hash'] ?? null; - $this->container['identifier'] = $data['identifier'] ?? null; - $this->container['language'] = $data['language'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; - $this->container['game_version'] = $data['game_version'] ?? null; - $this->container['device_model'] = $data['device_model'] ?? null; - $this->container['device_os'] = $data['device_os'] ?? null; - $this->container['ad_id'] = $data['ad_id'] ?? null; - $this->container['sdk'] = $data['sdk'] ?? null; - $this->container['session_count'] = $data['session_count'] ?? null; - $this->container['tags'] = $data['tags'] ?? null; - $this->container['amount_spent'] = $data['amount_spent'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['playtime'] = $data['playtime'] ?? null; - $this->container['badge_count'] = $data['badge_count'] ?? null; - $this->container['last_active'] = $data['last_active'] ?? null; - $this->container['notification_types'] = $data['notification_types'] ?? null; - $this->container['test_type'] = $data['test_type'] ?? null; - $this->container['long'] = $data['long'] ?? null; - $this->container['lat'] = $data['lat'] ?? null; - $this->container['country'] = $data['country'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['device_type'] === null) { - $invalidProperties[] = "'device_type' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return string|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string|null $id The device's OneSignal ID - * - * @return self - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets invalid_identifier - * - * @return bool|null - */ - public function getInvalidIdentifier() - { - return $this->container['invalid_identifier']; - } - - /** - * Sets invalid_identifier - * - * @param bool|null $invalid_identifier If true, this is the equivalent of a user being Unsubscribed - * - * @return self - */ - public function setInvalidIdentifier($invalid_identifier) - { - $this->container['invalid_identifier'] = $invalid_identifier; - - return $this; - } - - /** - * Gets app_id - * - * @return string|null - */ - public function getAppId() - { - return $this->container['app_id']; - } - - /** - * Sets app_id - * - * @param string|null $app_id app_id - * - * @return self - */ - public function setAppId($app_id) - { - $this->container['app_id'] = $app_id; - - return $this; - } - - /** - * Gets device_type - * - * @return int - */ - public function getDeviceType() - { - return $this->container['device_type']; - } - - /** - * Sets device_type - * - * @param int $device_type 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 - * - * @return self - */ - public function setDeviceType($device_type) - { - $this->container['device_type'] = $device_type; - - return $this; - } - - /** - * Gets external_user_id - * - * @return string|null - */ - public function getExternalUserId() - { - return $this->container['external_user_id']; - } - - /** - * Sets external_user_id - * - * @param string|null $external_user_id a custom user ID - * - * @return self - */ - public function setExternalUserId($external_user_id) - { - $this->container['external_user_id'] = $external_user_id; - - return $this; - } - - /** - * Gets external_user_id_auth_hash - * - * @return string|null - */ - public function getExternalUserIdAuthHash() - { - return $this->container['external_user_id_auth_hash']; - } - - /** - * Sets external_user_id_auth_hash - * - * @param string|null $external_user_id_auth_hash Only required if you have enabled Identity Verification and device_type is NOT 11 email. - * - * @return self - */ - public function setExternalUserIdAuthHash($external_user_id_auth_hash) - { - $this->container['external_user_id_auth_hash'] = $external_user_id_auth_hash; - - return $this; - } - - /** - * Gets email_auth_hash - * - * @return string|null - */ - public function getEmailAuthHash() - { - return $this->container['email_auth_hash']; - } - - /** - * Sets email_auth_hash - * - * @param string|null $email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). - * - * @return self - */ - public function setEmailAuthHash($email_auth_hash) - { - $this->container['email_auth_hash'] = $email_auth_hash; - - return $this; - } - - /** - * Gets identifier - * - * @return string|null - */ - public function getIdentifier() - { - return $this->container['identifier']; - } - - /** - * Sets identifier - * - * @param string|null $identifier 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. - * - * @return self - */ - public function setIdentifier($identifier) - { - $this->container['identifier'] = $identifier; - - return $this; - } - - /** - * Gets language - * - * @return string|null - */ - public function getLanguage() - { - return $this->container['language']; - } - - /** - * Sets language - * - * @param string|null $language Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: en - * - * @return self - */ - public function setLanguage($language) - { - $this->container['language'] = $language; - - return $this; - } - - /** - * Gets timezone - * - * @return int|null - */ - public function getTimezone() - { - return $this->container['timezone']; - } - - /** - * Sets timezone - * - * @param int|null $timezone Number of seconds away from UTC. Example: -28800 - * - * @return self - */ - public function setTimezone($timezone) - { - $this->container['timezone'] = $timezone; - - return $this; - } - - /** - * Gets game_version - * - * @return string|null - */ - public function getGameVersion() - { - return $this->container['game_version']; - } - - /** - * Sets game_version - * - * @param string|null $game_version Version of your app. Example: 1.1 - * - * @return self - */ - public function setGameVersion($game_version) - { - $this->container['game_version'] = $game_version; - - return $this; - } - - /** - * Gets device_model - * - * @return string|null - */ - public function getDeviceModel() - { - return $this->container['device_model']; - } - - /** - * Sets device_model - * - * @param string|null $device_model Device make and model. Example: iPhone5,1 - * - * @return self - */ - public function setDeviceModel($device_model) - { - $this->container['device_model'] = $device_model; - - return $this; - } - - /** - * Gets device_os - * - * @return string|null - */ - public function getDeviceOs() - { - return $this->container['device_os']; - } - - /** - * Sets device_os - * - * @param string|null $device_os Device operating system version. Example: 7.0.4 - * - * @return self - */ - public function setDeviceOs($device_os) - { - $this->container['device_os'] = $device_os; - - return $this; - } - - /** - * Gets ad_id - * - * @return string|null - */ - public function getAdId() - { - return $this->container['ad_id']; - } - - /** - * Sets ad_id - * - * @param string|null $ad_id The ad id for the device's platform: Android = Advertising Id iOS = identifierForVendor WP8.0 = DeviceUniqueId WP8.1 = AdvertisingId - * - * @return self - */ - public function setAdId($ad_id) - { - $this->container['ad_id'] = $ad_id; - - return $this; - } - - /** - * Gets sdk - * - * @return string|null - */ - public function getSdk() - { - return $this->container['sdk']; - } - - /** - * Sets sdk - * - * @param string|null $sdk Name and version of the sdk/plugin that's calling this API method (if any) - * - * @return self - */ - public function setSdk($sdk) - { - $this->container['sdk'] = $sdk; - - return $this; - } - - /** - * Gets session_count - * - * @return int|null - */ - public function getSessionCount() - { - return $this->container['session_count']; - } - - /** - * Sets session_count - * - * @param int|null $session_count Number of times the user has played the game, defaults to 1 - * - * @return self - */ - public function setSessionCount($session_count) - { - $this->container['session_count'] = $session_count; - - return $this; - } - - /** - * Gets tags - * - * @return object|null - */ - public function getTags() - { - return $this->container['tags']; - } - - /** - * Sets tags - * - * @param object|null $tags 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 - * - * @return self - */ - public function setTags($tags) - { - $this->container['tags'] = $tags; - - return $this; - } - - /** - * Gets amount_spent - * - * @return float|null - */ - public function getAmountSpent() - { - return $this->container['amount_spent']; - } - - /** - * Sets amount_spent - * - * @param float|null $amount_spent Amount the user has spent in USD, up to two decimal places - * - * @return self - */ - public function setAmountSpent($amount_spent) - { - $this->container['amount_spent'] = $amount_spent; - - return $this; - } - - /** - * Gets created_at - * - * @return int|null - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param int|null $created_at Unixtime when the player joined the game - * - * @return self - */ - public function setCreatedAt($created_at) - { - $this->container['created_at'] = $created_at; - - return $this; - } - - /** - * Gets playtime - * - * @return int|null - */ - public function getPlaytime() - { - return $this->container['playtime']; - } - - /** - * Sets playtime - * - * @param int|null $playtime Seconds player was running your app. - * - * @return self - */ - public function setPlaytime($playtime) - { - $this->container['playtime'] = $playtime; - - return $this; - } - - /** - * Gets badge_count - * - * @return int|null - */ - public function getBadgeCount() - { - return $this->container['badge_count']; - } - - /** - * Sets badge_count - * - * @param int|null $badge_count 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. - * - * @return self - */ - public function setBadgeCount($badge_count) - { - $this->container['badge_count'] = $badge_count; - - return $this; - } - - /** - * Gets last_active - * - * @return int|null - */ - public function getLastActive() - { - return $this->container['last_active']; - } - - /** - * Sets last_active - * - * @param int|null $last_active Unixtime when the player was last active - * - * @return self - */ - public function setLastActive($last_active) - { - $this->container['last_active'] = $last_active; - - return $this; - } - - /** - * Gets notification_types - * - * @return int|null - */ - public function getNotificationTypes() - { - return $this->container['notification_types']; - } - - /** - * Sets notification_types - * - * @param int|null $notification_types 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. - * - * @return self - */ - public function setNotificationTypes($notification_types) - { - $this->container['notification_types'] = $notification_types; - - return $this; - } - - /** - * Gets test_type - * - * @return int|null - */ - public function getTestType() - { - return $this->container['test_type']; - } - - /** - * Sets test_type - * - * @param int|null $test_type 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. - * - * @return self - */ - public function setTestType($test_type) - { - $this->container['test_type'] = $test_type; - - return $this; - } - - /** - * Gets long - * - * @return float|null - */ - public function getLong() - { - return $this->container['long']; - } - - /** - * Sets long - * - * @param float|null $long Longitude of the device, used for geotagging to segment on. - * - * @return self - */ - public function setLong($long) - { - $this->container['long'] = $long; - - return $this; - } - - /** - * Gets lat - * - * @return float|null - */ - public function getLat() - { - return $this->container['lat']; - } - - /** - * Sets lat - * - * @param float|null $lat Latitude of the device, used for geotagging to segment on. - * - * @return self - */ - public function setLat($lat) - { - $this->container['lat'] = $lat; - - return $this; - } - - /** - * Gets country - * - * @return string|null - */ - public function getCountry() - { - return $this->container['country']; - } - - /** - * Sets country - * - * @param string|null $country Country code in the ISO 3166-1 Alpha 2 format - * - * @return self - */ - public function setCountry($country) - { - $this->container['country'] = $country; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/PlayerNotificationTargetIncludeAliases.php b/lib/model/PlayerNotificationTargetIncludeAliases.php deleted file mode 100644 index 7db72a3..0000000 --- a/lib/model/PlayerNotificationTargetIncludeAliases.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class PlayerNotificationTargetIncludeAliases implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'PlayerNotificationTarget_include_aliases'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'alias_label' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'alias_label' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'alias_label' => 'alias_label' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'alias_label' => 'setAliasLabel' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'alias_label' => 'getAliasLabel' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['alias_label'] = $data['alias_label'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets alias_label - * - * @return string[]|null - */ - public function getAliasLabel() - { - return $this->container['alias_label']; - } - - /** - * Sets alias_label - * - * @param string[]|null $alias_label alias_label - * - * @return self - */ - public function setAliasLabel($alias_label) - { - $this->container['alias_label'] = $alias_label; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/InlineResponse202.php b/lib/model/PropertiesBody.php similarity index 96% rename from lib/model/InlineResponse202.php rename to lib/model/PropertiesBody.php index 7e3e2aa..1aee8fb 100644 --- a/lib/model/InlineResponse202.php +++ b/lib/model/PropertiesBody.php @@ -1,6 +1,6 @@ 'float', - 'session_count' => 'float', + 'session_time' => 'int', + 'session_count' => 'int', 'purchases' => '\onesignal\client\model\Purchase[]' ]; @@ -221,7 +221,7 @@ public function valid() /** * Gets session_time * - * @return float|null + * @return int|null */ public function getSessionTime() { @@ -231,7 +231,7 @@ public function getSessionTime() /** * Sets session_time * - * @param float|null $session_time session_time + * @param int|null $session_time session_time * * @return self */ @@ -245,7 +245,7 @@ public function setSessionTime($session_time) /** * Gets session_count * - * @return float|null + * @return int|null */ public function getSessionCount() { @@ -255,7 +255,7 @@ public function getSessionCount() /** * Sets session_count * - * @param float|null $session_count session_count + * @param int|null $session_count session_count * * @return self */ diff --git a/lib/model/PropertiesObject.php b/lib/model/PropertiesObject.php index b303fb1..9377c0f 100644 --- a/lib/model/PropertiesObject.php +++ b/lib/model/PropertiesObject.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -66,8 +66,8 @@ class PropertiesObject implements ModelInterface, ArrayAccess, \JsonSerializable 'lat' => 'float', 'long' => 'float', 'country' => 'string', - 'first_active' => 'float', - 'last_active' => 'float', + 'first_active' => 'int', + 'last_active' => 'int', 'amount_spent' => 'float', 'purchases' => '\onesignal\client\model\Purchase[]', 'ip' => 'string' @@ -413,7 +413,7 @@ public function setCountry($country) /** * Gets first_active * - * @return float|null + * @return int|null */ public function getFirstActive() { @@ -423,7 +423,7 @@ public function getFirstActive() /** * Sets first_active * - * @param float|null $first_active first_active + * @param int|null $first_active first_active * * @return self */ @@ -437,7 +437,7 @@ public function setFirstActive($first_active) /** * Gets last_active * - * @return float|null + * @return int|null */ public function getLastActive() { @@ -447,7 +447,7 @@ public function getLastActive() /** * Sets last_active * - * @param float|null $last_active last_active + * @param int|null $last_active last_active * * @return self */ diff --git a/lib/model/Purchase.php b/lib/model/Purchase.php index 0ef91b0..d0ffcba 100644 --- a/lib/model/Purchase.php +++ b/lib/model/Purchase.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -63,7 +63,7 @@ class Purchase implements ModelInterface, ArrayAccess, \JsonSerializable 'sku' => 'string', 'amount' => 'string', 'iso' => 'string', - 'count' => 'float' + 'count' => 'int' ]; /** @@ -308,7 +308,7 @@ public function setIso($iso) /** * Gets count * - * @return float|null + * @return int|null */ public function getCount() { @@ -318,7 +318,7 @@ public function getCount() /** * Sets count * - * @param float|null $count count + * @param int|null $count count * * @return self */ diff --git a/lib/model/RateLimiterError.php b/lib/model/RateLimitError.php similarity index 86% rename from lib/model/RateLimiterError.php rename to lib/model/RateLimitError.php index ab1067d..aed99af 100644 --- a/lib/model/RateLimiterError.php +++ b/lib/model/RateLimitError.php @@ -1,6 +1,6 @@ '\onesignal\client\model\GenericErrorErrorsInner[]' + 'errors' => 'string[]', + 'limit' => 'string' ]; /** @@ -71,7 +72,8 @@ class RateLimiterError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'errors' => null + 'errors' => null, + 'limit' => null ]; /** @@ -101,7 +103,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'errors' => 'errors' + 'errors' => 'errors', + 'limit' => 'limit' ]; /** @@ -110,7 +113,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'errors' => 'setErrors' + 'errors' => 'setErrors', + 'limit' => 'setLimit' ]; /** @@ -119,7 +123,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'errors' => 'getErrors' + 'errors' => 'getErrors', + 'limit' => 'getLimit' ]; /** @@ -180,6 +185,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['errors'] = $data['errors'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; } /** @@ -209,7 +215,7 @@ public function valid() /** * Gets errors * - * @return \onesignal\client\model\GenericErrorErrorsInner[]|null + * @return string[]|null */ public function getErrors() { @@ -219,7 +225,7 @@ public function getErrors() /** * Sets errors * - * @param \onesignal\client\model\GenericErrorErrorsInner[]|null $errors errors + * @param string[]|null $errors errors * * @return self */ @@ -229,6 +235,30 @@ public function setErrors($errors) return $this; } + + /** + * Gets limit + * + * @return string|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param string|null $limit limit + * + * @return self + */ + public function setLimit($limit) + { + $this->container['limit'] = $limit; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/model/Segment.php b/lib/model/Segment.php index a1f0dc4..7c6c5c7 100644 --- a/lib/model/Segment.php +++ b/lib/model/Segment.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -62,7 +62,7 @@ class Segment implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'id' => 'string', 'name' => 'string', - 'filters' => '\onesignal\client\model\FilterExpressions[]' + 'filters' => '\onesignal\client\model\FilterExpression[]' ]; /** @@ -275,7 +275,7 @@ public function setName($name) /** * Gets filters * - * @return \onesignal\client\model\FilterExpressions[] + * @return \onesignal\client\model\FilterExpression[] */ public function getFilters() { @@ -285,7 +285,7 @@ public function getFilters() /** * Sets filters * - * @param \onesignal\client\model\FilterExpressions[] $filters Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. + * @param \onesignal\client\model\FilterExpression[] $filters Filter or operators the segment will have. For a list of available filters with details, please see Send to Users Based on Filters. * * @return self */ diff --git a/lib/model/SegmentData.php b/lib/model/SegmentData.php new file mode 100644 index 0000000..f56d4ad --- /dev/null +++ b/lib/model/SegmentData.php @@ -0,0 +1,503 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SegmentData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'created_at' => 'string', + 'updated_at' => 'string', + 'app_id' => 'string', + 'read_only' => 'bool', + 'is_active' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'created_at' => null, + 'updated_at' => null, + 'app_id' => null, + 'read_only' => null, + 'is_active' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'created_at' => 'created_at', + 'updated_at' => 'updated_at', + 'app_id' => 'app_id', + 'read_only' => 'read_only', + 'is_active' => 'is_active' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt', + 'app_id' => 'setAppId', + 'read_only' => 'setReadOnly', + 'is_active' => 'setIsActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt', + 'app_id' => 'getAppId', + 'read_only' => 'getReadOnly', + 'is_active' => 'getIsActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->container['app_id'] = $data['app_id'] ?? null; + $this->container['read_only'] = $data['read_only'] ?? null; + $this->container['is_active'] = $data['is_active'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The segment ID + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The segment name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets created_at + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string|null $created_at Date segment created + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return string|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param string|null $updated_at Date segment last updated + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id The app id + * + * @return self + */ + public function setAppId($app_id) + { + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets read_only + * + * @return bool|null + */ + public function getReadOnly() + { + return $this->container['read_only']; + } + + /** + * Sets read_only + * + * @param bool|null $read_only Is the segment read only? + * + * @return self + */ + public function setReadOnly($read_only) + { + $this->container['read_only'] = $read_only; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active Is the segment active? + * + * @return self + */ + public function setIsActive($is_active) + { + $this->container['is_active'] = $is_active; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/SegmentNotificationTarget.php b/lib/model/SegmentNotificationTarget.php index da5cb89..54b0e9f 100644 --- a/lib/model/SegmentNotificationTarget.php +++ b/lib/model/SegmentNotificationTarget.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/SubscriptionObject.php b/lib/model/Subscription.php similarity index 95% rename from lib/model/SubscriptionObject.php rename to lib/model/Subscription.php index 4d7042c..8759cca 100644 --- a/lib/model/SubscriptionObject.php +++ b/lib/model/Subscription.php @@ -1,6 +1,6 @@ 'string', 'token' => 'string', 'enabled' => 'bool', - 'notification_types' => 'float', - 'session_time' => 'float', - 'session_count' => 'float', + 'notification_types' => 'int', + 'session_time' => 'int', + 'session_count' => 'int', 'sdk' => 'string', 'device_model' => 'string', 'device_os' => 'string', 'rooted' => 'bool', - 'test_type' => 'float', + 'test_type' => 'int', 'app_version' => 'string', - 'net_type' => 'float', + 'net_type' => 'int', 'carrier' => 'string', 'web_auth' => 'string', 'web_p256' => 'string' @@ -457,7 +457,7 @@ public function setEnabled($enabled) /** * Gets notification_types * - * @return float|null + * @return int|null */ public function getNotificationTypes() { @@ -467,7 +467,7 @@ public function getNotificationTypes() /** * Sets notification_types * - * @param float|null $notification_types notification_types + * @param int|null $notification_types notification_types * * @return self */ @@ -481,7 +481,7 @@ public function setNotificationTypes($notification_types) /** * Gets session_time * - * @return float|null + * @return int|null */ public function getSessionTime() { @@ -491,7 +491,7 @@ public function getSessionTime() /** * Sets session_time * - * @param float|null $session_time session_time + * @param int|null $session_time session_time * * @return self */ @@ -505,7 +505,7 @@ public function setSessionTime($session_time) /** * Gets session_count * - * @return float|null + * @return int|null */ public function getSessionCount() { @@ -515,7 +515,7 @@ public function getSessionCount() /** * Sets session_count * - * @param float|null $session_count session_count + * @param int|null $session_count session_count * * @return self */ @@ -625,7 +625,7 @@ public function setRooted($rooted) /** * Gets test_type * - * @return float|null + * @return int|null */ public function getTestType() { @@ -635,7 +635,7 @@ public function getTestType() /** * Sets test_type * - * @param float|null $test_type test_type + * @param int|null $test_type test_type * * @return self */ @@ -673,7 +673,7 @@ public function setAppVersion($app_version) /** * Gets net_type * - * @return float|null + * @return int|null */ public function getNetType() { @@ -683,7 +683,7 @@ public function getNetType() /** * Sets net_type * - * @param float|null $net_type net_type + * @param int|null $net_type net_type * * @return self */ diff --git a/lib/model/InlineResponse201.php b/lib/model/SubscriptionBody.php similarity index 93% rename from lib/model/InlineResponse201.php rename to lib/model/SubscriptionBody.php index f1bfe8d..ecf938b 100644 --- a/lib/model/InlineResponse201.php +++ b/lib/model/SubscriptionBody.php @@ -1,6 +1,6 @@ '\onesignal\client\model\SubscriptionObject' + 'subscription' => '\onesignal\client\model\Subscription' ]; /** @@ -209,7 +209,7 @@ public function valid() /** * Gets subscription * - * @return \onesignal\client\model\SubscriptionObject|null + * @return \onesignal\client\model\Subscription|null */ public function getSubscription() { @@ -219,7 +219,7 @@ public function getSubscription() /** * Sets subscription * - * @param \onesignal\client\model\SubscriptionObject|null $subscription subscription + * @param \onesignal\client\model\Subscription|null $subscription subscription * * @return self */ diff --git a/lib/model/PlayerNotificationTarget.php b/lib/model/SubscriptionNotificationTarget.php similarity index 78% rename from lib/model/PlayerNotificationTarget.php rename to lib/model/SubscriptionNotificationTarget.php index 112b7bf..103eaa6 100644 --- a/lib/model/PlayerNotificationTarget.php +++ b/lib/model/SubscriptionNotificationTarget.php @@ -1,6 +1,6 @@ 'string[]', - 'include_external_user_ids' => 'string[]', + 'include_subscription_ids' => 'string[]', 'include_email_tokens' => 'string[]', 'include_phone_numbers' => 'string[]', 'include_ios_tokens' => 'string[]', @@ -70,7 +69,7 @@ class PlayerNotificationTarget implements ModelInterface, ArrayAccess, \JsonSeri 'include_chrome_reg_ids' => 'string[]', 'include_chrome_web_reg_ids' => 'string[]', 'include_android_reg_ids' => 'string[]', - 'include_aliases' => '\onesignal\client\model\PlayerNotificationTargetIncludeAliases', + 'include_aliases' => 'array', 'target_channel' => 'string' ]; @@ -82,8 +81,7 @@ class PlayerNotificationTarget implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'include_player_ids' => null, - 'include_external_user_ids' => null, + 'include_subscription_ids' => null, 'include_email_tokens' => null, 'include_phone_numbers' => null, 'include_ios_tokens' => null, @@ -123,8 +121,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'include_player_ids' => 'include_player_ids', - 'include_external_user_ids' => 'include_external_user_ids', + 'include_subscription_ids' => 'include_subscription_ids', 'include_email_tokens' => 'include_email_tokens', 'include_phone_numbers' => 'include_phone_numbers', 'include_ios_tokens' => 'include_ios_tokens', @@ -143,8 +140,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'include_player_ids' => 'setIncludePlayerIds', - 'include_external_user_ids' => 'setIncludeExternalUserIds', + 'include_subscription_ids' => 'setIncludeSubscriptionIds', 'include_email_tokens' => 'setIncludeEmailTokens', 'include_phone_numbers' => 'setIncludePhoneNumbers', 'include_ios_tokens' => 'setIncludeIosTokens', @@ -163,8 +159,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'include_player_ids' => 'getIncludePlayerIds', - 'include_external_user_ids' => 'getIncludeExternalUserIds', + 'include_subscription_ids' => 'getIncludeSubscriptionIds', 'include_email_tokens' => 'getIncludeEmailTokens', 'include_phone_numbers' => 'getIncludePhoneNumbers', 'include_ios_tokens' => 'getIncludeIosTokens', @@ -251,8 +246,7 @@ public function getTargetChannelAllowableValues() */ public function __construct(array $data = null) { - $this->container['include_player_ids'] = $data['include_player_ids'] ?? null; - $this->container['include_external_user_ids'] = $data['include_external_user_ids'] ?? null; + $this->container['include_subscription_ids'] = $data['include_subscription_ids'] ?? null; $this->container['include_email_tokens'] = $data['include_email_tokens'] ?? null; $this->container['include_phone_numbers'] = $data['include_phone_numbers'] ?? null; $this->container['include_ios_tokens'] = $data['include_ios_tokens'] ?? null; @@ -299,53 +293,25 @@ public function valid() /** - * Gets include_player_ids + * Gets include_subscription_ids * * @return string[]|null - * @deprecated */ - public function getIncludePlayerIds() + public function getIncludeSubscriptionIds() { - return $this->container['include_player_ids']; + return $this->container['include_subscription_ids']; } /** - * Sets include_player_ids + * Sets include_subscription_ids * - * @param string[]|null $include_player_ids 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 + * @param string[]|null $include_subscription_ids Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call * * @return self - * @deprecated */ - public function setIncludePlayerIds($include_player_ids) + public function setIncludeSubscriptionIds($include_subscription_ids) { - $this->container['include_player_ids'] = $include_player_ids; - - return $this; - } - - /** - * Gets include_external_user_ids - * - * @return string[]|null - * @deprecated - */ - public function getIncludeExternalUserIds() - { - return $this->container['include_external_user_ids']; - } - - /** - * Sets include_external_user_ids - * - * @param string[]|null $include_external_user_ids 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. - * - * @return self - * @deprecated - */ - public function setIncludeExternalUserIds($include_external_user_ids) - { - $this->container['include_external_user_ids'] = $include_external_user_ids; + $this->container['include_subscription_ids'] = $include_subscription_ids; return $this; } @@ -411,7 +377,7 @@ public function getIncludeIosTokens() /** * Sets include_ios_tokens * - * @param string[]|null $include_ios_tokens 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 + * @param string[]|null $include_ios_tokens Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -435,7 +401,7 @@ public function getIncludeWpWnsUris() /** * Sets include_wp_wns_uris * - * @param string[]|null $include_wp_wns_uris 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 + * @param string[]|null $include_wp_wns_uris Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -459,7 +425,7 @@ public function getIncludeAmazonRegIds() /** * Sets include_amazon_reg_ids * - * @param string[]|null $include_amazon_reg_ids 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 + * @param string[]|null $include_amazon_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -483,7 +449,7 @@ public function getIncludeChromeRegIds() /** * Sets include_chrome_reg_ids * - * @param string[]|null $include_chrome_reg_ids 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 + * @param string[]|null $include_chrome_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -507,7 +473,7 @@ public function getIncludeChromeWebRegIds() /** * Sets include_chrome_web_reg_ids * - * @param string[]|null $include_chrome_web_reg_ids 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 + * @param string[]|null $include_chrome_web_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -531,7 +497,7 @@ public function getIncludeAndroidRegIds() /** * Sets include_android_reg_ids * - * @param string[]|null $include_android_reg_ids 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 + * @param string[]|null $include_android_reg_ids Not Recommended: Please consider using include_subscription_ids or include_aliases 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 * * @return self */ @@ -545,7 +511,7 @@ public function setIncludeAndroidRegIds($include_android_reg_ids) /** * Gets include_aliases * - * @return \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null + * @return array|null */ public function getIncludeAliases() { @@ -555,7 +521,7 @@ public function getIncludeAliases() /** * Sets include_aliases * - * @param \onesignal\client\model\PlayerNotificationTargetIncludeAliases|null $include_aliases include_aliases + * @param array|null $include_aliases Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. * * @return self */ diff --git a/lib/model/TransferSubscriptionRequestBody.php b/lib/model/TransferSubscriptionRequestBody.php index 765e706..6729002 100644 --- a/lib/model/TransferSubscriptionRequestBody.php +++ b/lib/model/TransferSubscriptionRequestBody.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -60,7 +60,7 @@ class TransferSubscriptionRequestBody implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'identity' => 'array' + 'identity' => 'array' ]; /** @@ -191,6 +191,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['identity']) && (count($this->container['identity']) > 1)) { + $invalidProperties[] = "invalid value for 'identity', number of items must be less than or equal to 1."; + } + + if (!is_null($this->container['identity']) && (count($this->container['identity']) < 1)) { + $invalidProperties[] = "invalid value for 'identity', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -209,7 +217,7 @@ public function valid() /** * Gets identity * - * @return array|null + * @return array|null */ public function getIdentity() { @@ -219,12 +227,19 @@ public function getIdentity() /** * Sets identity * - * @param array|null $identity identity + * @param array|null $identity identity * * @return self */ public function setIdentity($identity) { + + if (!is_null($identity) && (count($identity) > 1)) { + throw new \InvalidArgumentException('invalid value for $identity when calling TransferSubscriptionRequestBody., number of items must be less than or equal to 1.'); + } + if (!is_null($identity) && (count($identity) < 1)) { + throw new \InvalidArgumentException('invalid length for $identity when calling TransferSubscriptionRequestBody., number of items must be greater than or equal to 1.'); + } $this->container['identity'] = $identity; return $this; diff --git a/lib/model/UpdateLiveActivityRequest.php b/lib/model/UpdateLiveActivityRequest.php index 60b78bb..0053742 100644 --- a/lib/model/UpdateLiveActivityRequest.php +++ b/lib/model/UpdateLiveActivityRequest.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -63,7 +63,12 @@ class UpdateLiveActivityRequest implements ModelInterface, ArrayAccess, \JsonSer 'name' => 'string', 'event' => 'string', 'event_updates' => 'object', - 'dismiss_at' => 'float' + 'contents' => '\onesignal\client\model\LanguageStringMap', + 'headings' => '\onesignal\client\model\LanguageStringMap', + 'sound' => 'string', + 'stale_date' => 'int', + 'dismissal_date' => 'int', + 'priority' => 'int' ]; /** @@ -77,7 +82,12 @@ class UpdateLiveActivityRequest implements ModelInterface, ArrayAccess, \JsonSer 'name' => null, 'event' => null, 'event_updates' => null, - 'dismiss_at' => null + 'contents' => null, + 'headings' => null, + 'sound' => null, + 'stale_date' => null, + 'dismissal_date' => null, + 'priority' => null ]; /** @@ -110,7 +120,12 @@ public static function openAPIFormats() 'name' => 'name', 'event' => 'event', 'event_updates' => 'event_updates', - 'dismiss_at' => 'dismiss_at' + 'contents' => 'contents', + 'headings' => 'headings', + 'sound' => 'sound', + 'stale_date' => 'stale_date', + 'dismissal_date' => 'dismissal_date', + 'priority' => 'priority' ]; /** @@ -122,7 +137,12 @@ public static function openAPIFormats() 'name' => 'setName', 'event' => 'setEvent', 'event_updates' => 'setEventUpdates', - 'dismiss_at' => 'setDismissAt' + 'contents' => 'setContents', + 'headings' => 'setHeadings', + 'sound' => 'setSound', + 'stale_date' => 'setStaleDate', + 'dismissal_date' => 'setDismissalDate', + 'priority' => 'setPriority' ]; /** @@ -134,7 +154,12 @@ public static function openAPIFormats() 'name' => 'getName', 'event' => 'getEvent', 'event_updates' => 'getEventUpdates', - 'dismiss_at' => 'getDismissAt' + 'contents' => 'getContents', + 'headings' => 'getHeadings', + 'sound' => 'getSound', + 'stale_date' => 'getStaleDate', + 'dismissal_date' => 'getDismissalDate', + 'priority' => 'getPriority' ]; /** @@ -178,28 +203,9 @@ public function getModelName() return self::$openAPIModelName; } - public const NAME_HEADINGS = 'headings'; - public const NAME_CONTENTS = 'contents'; - public const NAME_IOS_SOUND = 'ios_sound'; - public const NAME_PRIORITY_LEVEL = 'priority_level'; public const EVENT_UPDATE = 'update'; public const EVENT_END = 'end'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getNameAllowableValues() - { - return [ - self::NAME_HEADINGS, - self::NAME_CONTENTS, - self::NAME_IOS_SOUND, - self::NAME_PRIORITY_LEVEL, - ]; - } - /** * Gets allowable values of the enum * @@ -231,7 +237,12 @@ public function __construct(array $data = null) $this->container['name'] = $data['name'] ?? null; $this->container['event'] = $data['event'] ?? null; $this->container['event_updates'] = $data['event_updates'] ?? null; - $this->container['dismiss_at'] = $data['dismiss_at'] ?? null; + $this->container['contents'] = $data['contents'] ?? null; + $this->container['headings'] = $data['headings'] ?? null; + $this->container['sound'] = $data['sound'] ?? null; + $this->container['stale_date'] = $data['stale_date'] ?? null; + $this->container['dismissal_date'] = $data['dismissal_date'] ?? null; + $this->container['priority'] = $data['priority'] ?? null; } /** @@ -246,15 +257,6 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - $allowedValues = $this->getNameAllowableValues(); - if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'name', must be one of '%s'", - $this->container['name'], - implode("', '", $allowedValues) - ); - } - if ($this->container['event'] === null) { $invalidProperties[] = "'event' can't be null"; } @@ -298,22 +300,12 @@ public function getName() /** * Sets name * - * @param string $name Type of live activity + * @param string $name An internal name to assist with your campaign organization. This does not get displayed in the message itself. * * @return self */ public function setName($name) { - $allowedValues = $this->getNameAllowableValues(); - if (!in_array($name, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'name', must be one of '%s'", - $name, - implode("', '", $allowedValues) - ) - ); - } $this->container['name'] = $name; return $this; @@ -366,7 +358,7 @@ public function getEventUpdates() /** * Sets event_updates * - * @param object $event_updates event_updates + * @param object $event_updates This must match the ContentState interface you have defined within your Live Activity in your app. * * @return self */ @@ -378,25 +370,145 @@ public function setEventUpdates($event_updates) } /** - * Gets dismiss_at + * Gets contents + * + * @return \onesignal\client\model\LanguageStringMap|null + */ + public function getContents() + { + return $this->container['contents']; + } + + /** + * Sets contents + * + * @param \onesignal\client\model\LanguageStringMap|null $contents contents + * + * @return self + */ + public function setContents($contents) + { + $this->container['contents'] = $contents; + + return $this; + } + + /** + * Gets headings + * + * @return \onesignal\client\model\LanguageStringMap|null + */ + public function getHeadings() + { + return $this->container['headings']; + } + + /** + * Sets headings + * + * @param \onesignal\client\model\LanguageStringMap|null $headings headings + * + * @return self + */ + public function setHeadings($headings) + { + $this->container['headings'] = $headings; + + return $this; + } + + /** + * Gets sound + * + * @return string|null + */ + public function getSound() + { + return $this->container['sound']; + } + + /** + * Sets sound + * + * @param string|null $sound Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. + * + * @return self + */ + public function setSound($sound) + { + $this->container['sound'] = $sound; + + return $this; + } + + /** + * Gets stale_date + * + * @return int|null + */ + public function getStaleDate() + { + return $this->container['stale_date']; + } + + /** + * Sets stale_date + * + * @param int|null $stale_date Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. + * + * @return self + */ + public function setStaleDate($stale_date) + { + $this->container['stale_date'] = $stale_date; + + return $this; + } + + /** + * Gets dismissal_date + * + * @return int|null + */ + public function getDismissalDate() + { + return $this->container['dismissal_date']; + } + + /** + * Sets dismissal_date + * + * @param int|null $dismissal_date Accepts Unix timestamp in seconds; only allowed if event is \"end\" + * + * @return self + */ + public function setDismissalDate($dismissal_date) + { + $this->container['dismissal_date'] = $dismissal_date; + + return $this; + } + + /** + * Gets priority * - * @return float|null + * @return int|null */ - public function getDismissAt() + public function getPriority() { - return $this->container['dismiss_at']; + return $this->container['priority']; } /** - * Sets dismiss_at + * Sets priority * - * @param float|null $dismiss_at Timestamp; only allowed if event is \"end\" + * @param int|null $priority Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. * * @return self */ - public function setDismissAt($dismiss_at) + public function setPriority($priority) { - $this->container['dismiss_at'] = $dismiss_at; + $this->container['priority'] = $priority; return $this; } diff --git a/lib/model/UpdateLiveActivitySuccessResponse.php b/lib/model/UpdateLiveActivitySuccessResponse.php index 727b3e1..0b34c33 100644 --- a/lib/model/UpdateLiveActivitySuccessResponse.php +++ b/lib/model/UpdateLiveActivitySuccessResponse.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -60,8 +60,7 @@ class UpdateLiveActivitySuccessResponse implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'notification_id' => 'string', - 'errors' => '\onesignal\client\model\Notification200Errors' + 'id' => 'string' ]; /** @@ -72,8 +71,7 @@ class UpdateLiveActivitySuccessResponse implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'notification_id' => null, - 'errors' => null + 'id' => null ]; /** @@ -103,8 +101,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'notification_id' => 'notification_id', - 'errors' => 'errors' + 'id' => 'id' ]; /** @@ -113,8 +110,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'notification_id' => 'setNotificationId', - 'errors' => 'setErrors' + 'id' => 'setId' ]; /** @@ -123,8 +119,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'notification_id' => 'getNotificationId', - 'errors' => 'getErrors' + 'id' => 'getId' ]; /** @@ -184,8 +179,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['notification_id'] = $data['notification_id'] ?? null; - $this->container['errors'] = $data['errors'] ?? null; + $this->container['id'] = $data['id'] ?? null; } /** @@ -213,49 +207,25 @@ public function valid() /** - * Gets notification_id + * Gets id * * @return string|null */ - public function getNotificationId() + public function getId() { - return $this->container['notification_id']; + return $this->container['id']; } /** - * Sets notification_id + * Sets id * - * @param string|null $notification_id notification_id + * @param string|null $id id * * @return self */ - public function setNotificationId($notification_id) + public function setId($id) { - $this->container['notification_id'] = $notification_id; - - return $this; - } - - /** - * Gets errors - * - * @return \onesignal\client\model\Notification200Errors|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \onesignal\client\model\Notification200Errors|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - $this->container['errors'] = $errors; + $this->container['id'] = $id; return $this; } diff --git a/lib/model/UpdatePlayerSuccessResponse.php b/lib/model/UpdatePlayerSuccessResponse.php deleted file mode 100644 index 4524fc6..0000000 --- a/lib/model/UpdatePlayerSuccessResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UpdatePlayerSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UpdatePlayerSuccessResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UpdatePlayerTagsRequestBody.php b/lib/model/UpdatePlayerTagsRequestBody.php deleted file mode 100644 index a557515..0000000 --- a/lib/model/UpdatePlayerTagsRequestBody.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UpdatePlayerTagsRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'update_player_tags_request_body'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'tags' => 'object' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'tags' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'tags' => 'tags' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'tags' => 'setTags' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'tags' => 'getTags' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['tags'] = $data['tags'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets tags - * - * @return object|null - */ - public function getTags() - { - return $this->container['tags']; - } - - /** - * Sets tags - * - * @param object|null $tags 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 - * - * @return self - */ - public function setTags($tags) - { - $this->container['tags'] = $tags; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UpdatePlayerTagsSuccessResponse.php b/lib/model/UpdatePlayerTagsSuccessResponse.php deleted file mode 100644 index ae552f8..0000000 --- a/lib/model/UpdatePlayerTagsSuccessResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UpdatePlayerTagsSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UpdatePlayerTagsSuccessResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'success' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'success' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'success' => 'success' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'success' => 'setSuccess' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'success' => 'getSuccess' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['success'] = $data['success'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets success - * - * @return bool|null - */ - public function getSuccess() - { - return $this->container['success']; - } - - /** - * Sets success - * - * @param bool|null $success success - * - * @return self - */ - public function setSuccess($success) - { - $this->container['success'] = $success; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UpdateSubscriptionRequestBody.php b/lib/model/UpdateSubscriptionRequestBody.php deleted file mode 100644 index bf54190..0000000 --- a/lib/model/UpdateSubscriptionRequestBody.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UpdateSubscriptionRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UpdateSubscriptionRequestBody'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'subscription' => '\onesignal\client\model\SubscriptionObject' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'subscription' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'subscription' => 'subscription' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'subscription' => 'setSubscription' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'subscription' => 'getSubscription' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['subscription'] = $data['subscription'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets subscription - * - * @return \onesignal\client\model\SubscriptionObject|null - */ - public function getSubscription() - { - return $this->container['subscription']; - } - - /** - * Sets subscription - * - * @param \onesignal\client\model\SubscriptionObject|null $subscription subscription - * - * @return self - */ - public function setSubscription($subscription) - { - $this->container['subscription'] = $subscription; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UpdateUserRequest.php b/lib/model/UpdateUserRequest.php index c5cb908..cc65364 100644 --- a/lib/model/UpdateUserRequest.php +++ b/lib/model/UpdateUserRequest.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/User.php b/lib/model/User.php index 5687854..9cc0eb7 100644 --- a/lib/model/User.php +++ b/lib/model/User.php @@ -15,7 +15,7 @@ * * 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.4.0 + * The version of the OpenAPI document: 5.0.1 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -61,9 +61,8 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'properties' => '\onesignal\client\model\PropertiesObject', - 'identity' => 'array', - 'subscriptions' => '\onesignal\client\model\SubscriptionObject[]', - 'subscription_options' => '\onesignal\client\model\UserSubscriptionOptions' + 'identity' => 'array', + 'subscriptions' => '\onesignal\client\model\Subscription[]' ]; /** @@ -76,8 +75,7 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'properties' => null, 'identity' => null, - 'subscriptions' => null, - 'subscription_options' => null + 'subscriptions' => null ]; /** @@ -109,8 +107,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'properties' => 'properties', 'identity' => 'identity', - 'subscriptions' => 'subscriptions', - 'subscription_options' => 'subscription_options' + 'subscriptions' => 'subscriptions' ]; /** @@ -121,8 +118,7 @@ public static function openAPIFormats() protected static $setters = [ 'properties' => 'setProperties', 'identity' => 'setIdentity', - 'subscriptions' => 'setSubscriptions', - 'subscription_options' => 'setSubscriptionOptions' + 'subscriptions' => 'setSubscriptions' ]; /** @@ -133,8 +129,7 @@ public static function openAPIFormats() protected static $getters = [ 'properties' => 'getProperties', 'identity' => 'getIdentity', - 'subscriptions' => 'getSubscriptions', - 'subscription_options' => 'getSubscriptionOptions' + 'subscriptions' => 'getSubscriptions' ]; /** @@ -197,7 +192,6 @@ public function __construct(array $data = null) $this->container['properties'] = $data['properties'] ?? null; $this->container['identity'] = $data['identity'] ?? null; $this->container['subscriptions'] = $data['subscriptions'] ?? null; - $this->container['subscription_options'] = $data['subscription_options'] ?? null; } /** @@ -251,7 +245,7 @@ public function setProperties($properties) /** * Gets identity * - * @return array|null + * @return array|null */ public function getIdentity() { @@ -261,7 +255,7 @@ public function getIdentity() /** * Sets identity * - * @param array|null $identity identity + * @param array|null $identity identity * * @return self */ @@ -275,7 +269,7 @@ public function setIdentity($identity) /** * Gets subscriptions * - * @return \onesignal\client\model\SubscriptionObject[]|null + * @return \onesignal\client\model\Subscription[]|null */ public function getSubscriptions() { @@ -285,7 +279,7 @@ public function getSubscriptions() /** * Sets subscriptions * - * @param \onesignal\client\model\SubscriptionObject[]|null $subscriptions subscriptions + * @param \onesignal\client\model\Subscription[]|null $subscriptions subscriptions * * @return self */ @@ -295,30 +289,6 @@ public function setSubscriptions($subscriptions) return $this; } - - /** - * Gets subscription_options - * - * @return \onesignal\client\model\UserSubscriptionOptions|null - */ - public function getSubscriptionOptions() - { - return $this->container['subscription_options']; - } - - /** - * Sets subscription_options - * - * @param \onesignal\client\model\UserSubscriptionOptions|null $subscription_options subscription_options - * - * @return self - */ - public function setSubscriptionOptions($subscription_options) - { - $this->container['subscription_options'] = $subscription_options; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/model/InlineResponse200.php b/lib/model/UserIdentityBody.php similarity index 94% rename from lib/model/InlineResponse200.php rename to lib/model/UserIdentityBody.php index d30a8e3..0df6a47 100644 --- a/lib/model/InlineResponse200.php +++ b/lib/model/UserIdentityBody.php @@ -1,6 +1,6 @@ 'array' + 'identity' => 'array' ]; /** @@ -209,7 +209,7 @@ public function valid() /** * Gets identity * - * @return array|null + * @return array|null */ public function getIdentity() { @@ -219,7 +219,7 @@ public function getIdentity() /** * Sets identity * - * @param array|null $identity identity + * @param array|null $identity identity * * @return self */ diff --git a/lib/model/UserIdentityRequestBody.php b/lib/model/UserIdentityRequestBody.php deleted file mode 100644 index f033dc2..0000000 --- a/lib/model/UserIdentityRequestBody.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UserIdentityRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UserIdentityRequestBody'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'identity' => 'array' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'identity' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'identity' => 'identity' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'identity' => 'setIdentity' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'identity' => 'getIdentity' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['identity'] = $data['identity'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets identity - * - * @return array|null - */ - public function getIdentity() - { - return $this->container['identity']; - } - - /** - * Sets identity - * - * @param array|null $identity identity - * - * @return self - */ - public function setIdentity($identity) - { - $this->container['identity'] = $identity; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UserIdentityResponse.php b/lib/model/UserIdentityResponse.php deleted file mode 100644 index a90da87..0000000 --- a/lib/model/UserIdentityResponse.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UserIdentityResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'UserIdentityResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'identity' => 'array' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'identity' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'identity' => 'identity' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'identity' => 'setIdentity' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'identity' => 'getIdentity' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['identity'] = $data['identity'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets identity - * - * @return array|null - */ - public function getIdentity() - { - return $this->container['identity']; - } - - /** - * Sets identity - * - * @param array|null $identity identity - * - * @return self - */ - public function setIdentity($identity) - { - $this->container['identity'] = $identity; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/UserSubscriptionOptions.php b/lib/model/UserSubscriptionOptions.php deleted file mode 100644 index 98724e6..0000000 --- a/lib/model/UserSubscriptionOptions.php +++ /dev/null @@ -1,323 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class UserSubscriptionOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'User_subscription_options'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'retain_previous_owner' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'retain_previous_owner' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'retain_previous_owner' => 'retain_previous_owner' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'retain_previous_owner' => 'setRetainPreviousOwner' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'retain_previous_owner' => 'getRetainPreviousOwner' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['retain_previous_owner'] = $data['retain_previous_owner'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets retain_previous_owner - * - * @return bool|null - */ - public function getRetainPreviousOwner() - { - return $this->container['retain_previous_owner']; - } - - /** - * Sets retain_previous_owner - * - * @param bool|null $retain_previous_owner retain_previous_owner - * - * @return self - */ - public function setRetainPreviousOwner($retain_previous_owner) - { - $this->container['retain_previous_owner'] = $retain_previous_owner; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/model/CreatePlayerSuccessResponse.php b/lib/model/WebButton.php similarity index 76% rename from lib/model/CreatePlayerSuccessResponse.php rename to lib/model/WebButton.php index f08e665..8e56d93 100644 --- a/lib/model/CreatePlayerSuccessResponse.php +++ b/lib/model/WebButton.php @@ -1,6 +1,6 @@ 'bool', - 'id' => 'string' + 'id' => 'string', + 'text' => 'string', + 'icon' => 'string', + 'url' => 'string' ]; /** @@ -72,8 +74,10 @@ class CreatePlayerSuccessResponse implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'success' => null, - 'id' => null + 'id' => null, + 'text' => null, + 'icon' => null, + 'url' => null ]; /** @@ -103,8 +107,10 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'success' => 'success', - 'id' => 'id' + 'id' => 'id', + 'text' => 'text', + 'icon' => 'icon', + 'url' => 'url' ]; /** @@ -113,8 +119,10 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'success' => 'setSuccess', - 'id' => 'setId' + 'id' => 'setId', + 'text' => 'setText', + 'icon' => 'setIcon', + 'url' => 'setUrl' ]; /** @@ -123,8 +131,10 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'success' => 'getSuccess', - 'id' => 'getId' + 'id' => 'getId', + 'text' => 'getText', + 'icon' => 'getIcon', + 'url' => 'getUrl' ]; /** @@ -184,8 +194,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['success'] = $data['success'] ?? null; $this->container['id'] = $data['id'] ?? null; + $this->container['text'] = $data['text'] ?? null; + $this->container['icon'] = $data['icon'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -197,6 +209,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } return $invalidProperties; } @@ -213,49 +228,97 @@ public function valid() /** - * Gets success + * Gets id * - * @return bool|null + * @return string */ - public function getSuccess() + public function getId() { - return $this->container['success']; + return $this->container['id']; } /** - * Sets success + * Sets id * - * @param bool|null $success success + * @param string $id id * * @return self */ - public function setSuccess($success) + public function setId($id) { - $this->container['success'] = $success; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets text * * @return string|null */ - public function getId() + public function getText() { - return $this->container['id']; + return $this->container['text']; } /** - * Sets id + * Sets text * - * @param string|null $id id + * @param string|null $text text * * @return self */ - public function setId($id) + public function setText($text) { - $this->container['id'] = $id; + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets icon + * + * @return string|null + */ + public function getIcon() + { + return $this->container['icon']; + } + + /** + * Sets icon + * + * @param string|null $icon icon + * + * @return self + */ + public function setIcon($icon) + { + $this->container['icon'] = $icon; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; return $this; }