diff --git a/.github/workflows/Zapier.yml b/.github/workflows/Zapier.yml index 3665dd5..074f7c1 100644 --- a/.github/workflows/Zapier.yml +++ b/.github/workflows/Zapier.yml @@ -7,7 +7,7 @@ on: # Triggers the workflow on push or pull request events but only for the "main" branch issues: types: [closed] - + permissions: issues: read @@ -31,4 +31,4 @@ jobs: --header 'Accept: application/json' \ --data-raw '{ "task_name" : "$ISSUE_TITLE" - }' + }' \ No newline at end of file diff --git a/README.md b/README.md index 0fc9889..f68301d 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ A powerful way to send personalized messages at scale and build effective custom ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.0.2 -- Package version: 1.0.5 +- API version: 1.2.1 +- Package version: 2.0.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit [https://onesignal.com](https://onesignal.com) @@ -87,22 +87,36 @@ Class | Method | HTTP request | Description *DefaultApi* | [**CreateNotification**](docs/DefaultApi.md#createnotification) | **Post** /notifications | Create notification *DefaultApi* | [**CreatePlayer**](docs/DefaultApi.md#createplayer) | **Post** /players | Add a device *DefaultApi* | [**CreateSegments**](docs/DefaultApi.md#createsegments) | **Post** /apps/{app_id}/segments | Create Segments +*DefaultApi* | [**CreateSubscription**](docs/DefaultApi.md#createsubscription) | **Post** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +*DefaultApi* | [**CreateUser**](docs/DefaultApi.md#createuser) | **Post** /apps/{app_id}/users | +*DefaultApi* | [**DeleteAlias**](docs/DefaultApi.md#deletealias) | **Delete** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | *DefaultApi* | [**DeletePlayer**](docs/DefaultApi.md#deleteplayer) | **Delete** /players/{player_id} | Delete a user record *DefaultApi* | [**DeleteSegments**](docs/DefaultApi.md#deletesegments) | **Delete** /apps/{app_id}/segments/{segment_id} | Delete Segments +*DefaultApi* | [**DeleteSubscription**](docs/DefaultApi.md#deletesubscription) | **Delete** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**DeleteUser**](docs/DefaultApi.md#deleteuser) | **Delete** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *DefaultApi* | [**EndLiveActivity**](docs/DefaultApi.md#endliveactivity) | **Delete** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *DefaultApi* | [**ExportPlayers**](docs/DefaultApi.md#exportplayers) | **Post** /players/csv_export?app_id={app_id} | CSV export +*DefaultApi* | [**FetchAliases**](docs/DefaultApi.md#fetchaliases) | **Get** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**FetchUser**](docs/DefaultApi.md#fetchuser) | **Get** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*DefaultApi* | [**FetchUserIdentity**](docs/DefaultApi.md#fetchuseridentity) | **Get** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | *DefaultApi* | [**GetApp**](docs/DefaultApi.md#getapp) | **Get** /apps/{app_id} | View an app *DefaultApi* | [**GetApps**](docs/DefaultApi.md#getapps) | **Get** /apps | View apps +*DefaultApi* | [**GetEligibleIams**](docs/DefaultApi.md#geteligibleiams) | **Get** /apps/{app_id}/subscriptions/{subscription_id}/iams | *DefaultApi* | [**GetNotification**](docs/DefaultApi.md#getnotification) | **Get** /notifications/{notification_id} | View notification *DefaultApi* | [**GetNotificationHistory**](docs/DefaultApi.md#getnotificationhistory) | **Post** /notifications/{notification_id}/history | Notification History *DefaultApi* | [**GetNotifications**](docs/DefaultApi.md#getnotifications) | **Get** /notifications | View notifications *DefaultApi* | [**GetOutcomes**](docs/DefaultApi.md#getoutcomes) | **Get** /apps/{app_id}/outcomes | View Outcomes *DefaultApi* | [**GetPlayer**](docs/DefaultApi.md#getplayer) | **Get** /players/{player_id} | View device *DefaultApi* | [**GetPlayers**](docs/DefaultApi.md#getplayers) | **Get** /players | View devices +*DefaultApi* | [**IdentifyUserByAlias**](docs/DefaultApi.md#identifyuserbyalias) | **Patch** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*DefaultApi* | [**IdentifyUserBySubscriptionId**](docs/DefaultApi.md#identifyuserbysubscriptionid) | **Patch** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**TransferSubscription**](docs/DefaultApi.md#transfersubscription) | **Patch** /apps/{app_id}/subscriptions/{subscription_id}/owner | *DefaultApi* | [**UpdateApp**](docs/DefaultApi.md#updateapp) | **Put** /apps/{app_id} | Update an app *DefaultApi* | [**UpdateLiveActivity**](docs/DefaultApi.md#updateliveactivity) | **Post** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push *DefaultApi* | [**UpdatePlayer**](docs/DefaultApi.md#updateplayer) | **Put** /players/{player_id} | Edit device *DefaultApi* | [**UpdatePlayerTags**](docs/DefaultApi.md#updateplayertags) | **Put** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id +*DefaultApi* | [**UpdateSubscription**](docs/DefaultApi.md#updatesubscription) | **Patch** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**UpdateUser**](docs/DefaultApi.md#updateuser) | **Patch** /apps/{app_id}/users/by/{alias_label}/{alias_id} | ## Documentation For Models @@ -119,6 +133,10 @@ Class | Method | HTTP request | Description - [CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md) - [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) + - [CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md) + - [CreateUserConflictResponse](docs/CreateUserConflictResponse.md) + - [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) + - [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) - [DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md) - [DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md) - [DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md) @@ -129,6 +147,12 @@ Class | Method | HTTP request | Description - [Filter](docs/Filter.md) - [FilterExpressions](docs/FilterExpressions.md) - [GetNotificationRequestBody](docs/GetNotificationRequestBody.md) + - [IdentifyUserConflictResponse](docs/IdentifyUserConflictResponse.md) + - [IdentifyUserConflictResponseErrorsInner](docs/IdentifyUserConflictResponseErrorsInner.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2003](docs/InlineResponse2003.md) + - [InlineResponse201](docs/InlineResponse201.md) + - [InlineResponse202](docs/InlineResponse202.md) - [InvalidIdentifierError](docs/InvalidIdentifierError.md) - [Notification](docs/Notification.md) - [Notification200Errors](docs/Notification200Errors.md) @@ -146,16 +170,27 @@ Class | Method | HTTP request | Description - [PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md) - [Player](docs/Player.md) - [PlayerNotificationTarget](docs/PlayerNotificationTarget.md) + - [PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md) - [PlayerSlice](docs/PlayerSlice.md) + - [PropertiesDeltas](docs/PropertiesDeltas.md) + - [PropertiesObject](docs/PropertiesObject.md) - [Purchase](docs/Purchase.md) - [Segment](docs/Segment.md) - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md) - [StringMap](docs/StringMap.md) + - [SubscriptionObject](docs/SubscriptionObject.md) + - [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) - [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) - [UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md) - [UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) - [UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md) + - [UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md) + - [UpdateUserRequest](docs/UpdateUserRequest.md) + - [User](docs/User.md) + - [UserIdentityRequestBody](docs/UserIdentityRequestBody.md) + - [UserIdentityResponse](docs/UserIdentityResponse.md) + - [UserSubscriptionOptions](docs/UserSubscriptionOptions.md) ## Documentation For Authorization diff --git a/api/openapi.yaml b/api/openapi.yaml index 1a8bff4..63b4179 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 1.0.2 + version: 1.2.1 servers: - url: https://onesignal.com/api/v1 paths: @@ -179,6 +179,74 @@ paths: security: - app_key: [] summary: View notification + /notifications/{notification_id}/history: + post: + description: "-> View the devices sent a message - OneSignal Paid Plan Required\ + \ This method will return all devices that were sent the given notification_id\ + \ of an Email or Push Notification if used within 7 days of the date sent.\ + \ After 7 days of the sending date, the message history data will be unavailable.\ + \ After a successful response is received, the destination url may be polled\ + \ until the file becomes available. Most exports are done in ~1-3 minutes,\ + \ so setting a poll interval of 10 seconds should be adequate. For use cases\ + \ that are not meant to be consumed by a script, an email will be sent to\ + \ the supplied email address. 🚧 Requirements A OneSignal Paid Plan.\ + \ Turn on Send History via OneSignal API in Settings -> Analytics. Cannot\ + \ get data before this was turned on. Must be called within 7 days after sending\ + \ the message. Messages targeting under 1000 recipients will not have \"sent\"\ + \ events recorded, but will show \"clicked\" events. Requires your OneSignal\ + \ App's REST API Key, available in Keys & IDs." + operationId: get_notification_history + parameters: + - description: The "id" of the message found in the Notification object + explode: false + in: path + name: notification_id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/get_notification_request_body' + content: + application/json: + schema: + properties: + events: + description: "-> \"sent\" - All the devices by player_id that were\ + \ sent the specified notification_id. Notifications targeting\ + \ under 1000 recipients will not have \"sent\" events recorded,\ + \ but will show \"clicked\" events. \"clicked\" - All the devices\ + \ by `player_id` that clicked the specified notification_id." + enum: + - sent + - clicked + type: string + email: + description: The email address you would like the report sent. + type: string + app_id: + type: string + required: + - id + title: get_notification_request_body + type: object + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationHistorySuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad Request + security: + - app_key: [] + summary: Notification History /apps: get: description: View the details of all of your current OneSignal apps @@ -288,147 +356,6 @@ paths: security: - user_key: [] summary: Update an app - /notifications/{notification_id}/history: - post: - description: "-> View the devices sent a message - OneSignal Paid Plan Required\ - \ This method will return all devices that were sent the given notification_id\ - \ of an Email or Push Notification if used within 7 days of the date sent.\ - \ After 7 days of the sending date, the message history data will be unavailable.\ - \ After a successful response is received, the destination url may be polled\ - \ until the file becomes available. Most exports are done in ~1-3 minutes,\ - \ so setting a poll interval of 10 seconds should be adequate. For use cases\ - \ that are not meant to be consumed by a script, an email will be sent to\ - \ the supplied email address. 🚧 Requirements A OneSignal Paid Plan.\ - \ Turn on Send History via OneSignal API in Settings -> Analytics. Cannot\ - \ get data before this was turned on. Must be called within 7 days after sending\ - \ the message. Messages targeting under 1000 recipients will not have \"sent\"\ - \ events recorded, but will show \"clicked\" events. Requires your OneSignal\ - \ App's REST API Key, available in Keys & IDs." - operationId: get_notification_history - parameters: - - description: The "id" of the message found in the Notification object - explode: false - in: path - name: notification_id - required: true - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/get_notification_request_body' - content: - application/json: - schema: - properties: - events: - description: "-> \"sent\" - All the devices by player_id that were\ - \ sent the specified notification_id. Notifications targeting\ - \ under 1000 recipients will not have \"sent\" events recorded,\ - \ but will show \"clicked\" events. \"clicked\" - All the devices\ - \ by `player_id` that clicked the specified notification_id." - enum: - - sent - - clicked - type: string - email: - description: The email address you would like the report sent. - type: string - app_id: - type: string - required: - - id - title: get_notification_request_body - type: object - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationHistorySuccessResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request - security: - - app_key: [] - summary: Notification History - /apps/{app_id}/users/{external_user_id}: - put: - description: "Update an existing device's tags in one of your OneSignal apps\ - \ using the External User ID.\nWarning - Android SDK Data Synchronization\n\ - Tags added through the Android SDK tagging methods may not update if using\ - \ the API to change or update the same tag.\nFor example, if you use SDK method\ - \ sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with\ - \ this API endpoint. You will not be able to set the value back to \"value1\"\ - \ through the SDK, you will need to change it to something different through\ - \ the SDK to be reset.\nRecommendations if using this Endpoint on Android\ - \ Mobile Apps:\n1 - Do not use the same tag keys for SDK and API updates\n\ - 2 - If you want to use the same key for both SDK and API updates, call the\ - \ SDK getTags method first to update the device's tags.\nThis is only applicable\ - \ on the Android Mobile App SDKs.\n📘\nDeleting Tags\nTo delete a tag,\ - \ include its key and set its value to blank. Omitting a key/value will not\ - \ delete it.\nFor example, if I wanted to delete two existing tags rank and\ - \ category while simultaneously adding a new tag class, the tags JSON would\ - \ look like the following:\n\"tags\": {\n \"rank\": \"\",\n \"category\"\ - : \"\",\n \"class\": \"my_new_value\"\n}\n" - operationId: update_player_tags - parameters: - - description: The OneSignal App ID the user record is found under. - explode: false - in: path - name: app_id - required: true - schema: - type: string - style: simple - - description: The External User ID mapped to teh device record in OneSignal. Must - be actively set on the device to be updated. - explode: false - in: path - name: external_user_id - required: true - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/update_player_tags_request_body' - content: - application/json: - schema: - properties: - tags: - description: "Custom tags for the device record. Only support string\ - \ key value pairs. Does not support arrays or other nested objects.\ - \ Example `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n\ - - 100 tags per call\n- Android SDK users: tags cannot be removed\ - \ or changed via API if set through SDK sendTag methods.\nRecommended\ - \ to only tag devices with 1 kilobyte of ata\nPlease consider\ - \ using your own Database to save more than 1 kilobyte of data.\ - \ See: Internal Database & CRM\n" - type: object - title: update_player_tags_request_body - type: object - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePlayerTagsSuccessResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request - security: - - app_key: [] - summary: Edit tags with external user id /apps/{app_id}/segments: post: description: "Create segments visible and usable in the dashboard and API -\ @@ -595,40 +522,625 @@ paths: required: false schema: type: string - style: form + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OutcomesData' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad Request + security: + - app_key: [] + summary: View Outcomes + /apps/{app_id}/live_activities/{activity_id}/notifications: + post: + description: Updates a specified live activity. + operationId: update_live_activity + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: Live Activity record ID + explode: false + in: path + name: activity_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateLiveActivityRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateLiveActivitySuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad Request + security: + - app_key: [] + summary: Update a Live Activity via Push + /apps/{app_id}/live_activities/{activity_id}/token: + post: + description: Starts a Live Activity + operationId: begin_live_activity + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: Live Activity record ID + explode: false + in: path + name: activity_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BeginLiveActivityRequest' + required: true + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad Request + security: + - app_key: [] + summary: Start Live Activity + /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}: + delete: + description: Stops a Live Activity + operationId: end_live_activity + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: Live Activity record ID + explode: false + in: path + name: activity_id + required: true + schema: + type: string + style: simple + - description: Subscription ID + explode: false + in: path + name: subscription_id + required: true + schema: + type: string + style: simple + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad Request + security: + - app_key: [] + summary: Stop Live Activity + /apps/{app_id}/users: + post: + description: "Creates a User, optionally Subscriptions owned by the User as\ + \ well as Aliases.\nAliases provided in the payload will be used to look up\ + \ an existing User." + operationId: create_user + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: CREATED + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: ACCEPTED + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUserConflictResponse' + description: Multiple User Identity Conflict + security: + - app_key: [] + /apps/{app_id}/users/{external_user_id}: + put: + description: "Update an existing device's tags in one of your OneSignal apps\ + \ using the External User ID.\nWarning - Android SDK Data Synchronization\n\ + Tags added through the Android SDK tagging methods may not update if using\ + \ the API to change or update the same tag.\nFor example, if you use SDK method\ + \ sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with\ + \ this API endpoint. You will not be able to set the value back to \"value1\"\ + \ through the SDK, you will need to change it to something different through\ + \ the SDK to be reset.\nRecommendations if using this Endpoint on Android\ + \ Mobile Apps:\n1 - Do not use the same tag keys for SDK and API updates\n\ + 2 - If you want to use the same key for both SDK and API updates, call the\ + \ SDK getTags method first to update the device's tags.\nThis is only applicable\ + \ on the Android Mobile App SDKs.\n📘\nDeleting Tags\nTo delete a tag,\ + \ include its key and set its value to blank. Omitting a key/value will not\ + \ delete it.\nFor example, if I wanted to delete two existing tags rank and\ + \ category while simultaneously adding a new tag class, the tags JSON would\ + \ look like the following:\n\"tags\": {\n \"rank\": \"\",\n \"category\"\ + : \"\",\n \"class\": \"my_new_value\"\n}\n" + operationId: update_player_tags + parameters: + - description: The OneSignal App ID the user record is found under. + explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - description: The External User ID mapped to teh device record in OneSignal. Must + be actively set on the device to be updated. + explode: false + in: path + name: external_user_id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/update_player_tags_request_body' + content: + application/json: + schema: + properties: + tags: + description: "Custom tags for the device record. Only support string\ + \ key value pairs. Does not support arrays or other nested objects.\ + \ Example `{\"foo\":\"bar\",\"this\":\"that\"}`.\nLimitations:\n\ + - 100 tags per call\n- Android SDK users: tags cannot be removed\ + \ or changed via API if set through SDK sendTag methods.\nRecommended\ + \ to only tag devices with 1 kilobyte of ata\nPlease consider\ + \ using your own Database to save more than 1 kilobyte of data.\ + \ See: Internal Database & CRM\n" + type: object + title: update_player_tags_request_body + type: object + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePlayerTagsSuccessResponse' + description: OK + security: + - app_key: [] + summary: Edit tags with external user id + /apps/{app_id}/users/by/{alias_label}/{alias_id}: + delete: + description: "Removes the User identified by (:alias_label, :alias_id), and\ + \ all Subscriptions and Aliases" + operationId: delete_user + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + responses: + "200": + description: OK + get: + description: "Returns the User’s properties, Aliases, and Subscriptions." + operationId: fetch_user + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: OK + security: + - app_key: [] + patch: + description: Updates an existing User’s properties. + operationId: update_user + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserRequest' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_202' + description: ACCEPTED + security: + - app_key: [] + /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity: + get: + description: "Lists all Aliases for the User identified by (:alias_label, :alias_id)." + operationId: fetch_user_identity + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: OK + security: + - app_key: [] + patch: + description: "Upserts one or more Aliases to an existing User identified by\ + \ (:alias_label, :alias_id)." + operationId: identify_user_by_alias + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserIdentityRequestBody' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: OK + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/IdentifyUserConflictResponse' + description: Conflict + security: + - app_key: [] + /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}: + delete: + description: Deletes an alias by alias label + operationId: delete_alias + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label_to_delete + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: OK + security: + - app_key: [] + /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions: + post: + description: Creates a new Subscription under the User provided. Useful to add + email addresses and SMS numbers to the User. + operationId: create_subscription + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_label + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSubscriptionRequestBody' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_201' + description: CREATED + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_201' + description: ACCEPTED + security: + - app_key: [] + /apps/{app_id}/subscriptions/{subscription_id}: + delete: + description: Deletes the Subscription. + operationId: delete_subscription + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: subscription_id + required: true + schema: + type: string + style: simple + responses: + "202": + description: ACCEPTED + security: + - app_key: [] + patch: + description: Updates an existing Subscription’s properties. + operationId: update_subscription + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: subscription_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSubscriptionRequestBody' + required: true + responses: + "202": + description: ACCEPTED + security: + - app_key: [] + /apps/{app_id}/subscriptions/{subscription_id}/user/identity: + get: + description: Lists all Aliases for the User identified by :subscription_id. + operationId: fetch_aliases + parameters: + - explode: false + in: path + name: app_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: subscription_id + required: true + schema: + type: string + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/OutcomesData' + $ref: '#/components/schemas/UserIdentityResponse' description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request security: - app_key: [] - summary: View Outcomes - /apps/{app_id}/live_activities/{activity_id}/notifications: - post: - description: Updates a specified live activity. - operationId: update_live_activity + patch: + description: Upserts one or more Aliases for the User identified by :subscription_id. + operationId: identify_user_by_subscription_id parameters: - - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: false + - explode: false in: path name: app_id required: true schema: type: string style: simple - - description: Live Activity record ID - explode: false + - explode: false in: path - name: activity_id + name: subscription_id required: true schema: type: string @@ -637,41 +1149,39 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateLiveActivityRequest' + $ref: '#/components/schemas/UserIdentityRequestBody' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UpdateLiveActivitySuccessResponse' + $ref: '#/components/schemas/UserIdentityResponse' description: OK - "400": + "409": content: application/json: schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request + $ref: '#/components/schemas/IdentifyUserConflictResponse' + description: Conflict security: - app_key: [] - summary: Update a Live Activity via Push - /apps/{app_id}/live_activities/{activity_id}/token: - post: - description: Starts a Live Activity - operationId: begin_live_activity + /apps/{app_id}/subscriptions/{subscription_id}/owner: + patch: + description: Transfers this Subscription to the User identified by the identity + in the payload. + operationId: transfer_subscription parameters: - - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: false + - explode: false in: path name: app_id required: true schema: type: string style: simple - - description: Live Activity record ID - explode: false + - explode: false in: path - name: activity_id + name: subscription_id required: true schema: type: string @@ -680,43 +1190,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BeginLiveActivityRequest' + $ref: '#/components/schemas/TransferSubscriptionRequestBody' required: true responses: - "204": - description: OK - "400": + "200": content: application/json: schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request + $ref: '#/components/schemas/UserIdentityResponse' + description: OK security: - app_key: [] - summary: Start Live Activity - /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}: - delete: - description: Stops a Live Activity - operationId: end_live_activity + /apps/{app_id}/subscriptions/{subscription_id}/iams: + get: + description: Manifest of In-App Messages the Subscription is eligible to display + by the SDK. + operationId: get_eligible_iams parameters: - - description: The OneSignal App ID for your app. Available in Keys & IDs. - explode: false + - explode: false in: path name: app_id required: true schema: type: string style: simple - - description: Live Activity record ID - explode: false - in: path - name: activity_id - required: true - schema: - type: string - style: simple - - description: Subscription ID - explode: false + - explode: false in: path name: subscription_id required: true @@ -724,17 +1222,14 @@ paths: type: string style: simple responses: - "204": - description: OK - "400": + "200": content: application/json: schema: - $ref: '#/components/schemas/BadRequestError' - description: Bad Request + $ref: '#/components/schemas/inline_response_200_3' + description: OK security: - app_key: [] - summary: Stop Live Activity /players: get: description: "View the details of multiple devices in one of your OneSignal\ @@ -1182,17 +1677,21 @@ components: apns_key_id: description: "iOS: Required if using p8. Unique identifier for the p8 authentication\ \ key." + nullable: true type: string apns_team_id: description: "iOS: Required if using p8. Team ID generated by Apple for\ \ your developer account." + nullable: true type: string apns_bundle_id: description: "iOS: Required if using p8. Bundle ID for your app in the Apple\ \ ecosystem." + nullable: true type: string apns_p8: description: "iOS: Required if using p8. Base64 encoded p8 key" + nullable: true type: string safari_site_origin: description: "Safari (Recommended): The hostname to your website including\ @@ -1225,6 +1724,7 @@ components: nullable: true type: string basic_auth_key: + nullable: true readOnly: true type: string organization_id: @@ -1265,6 +1765,7 @@ components: PlayerNotificationTarget: properties: include_player_ids: + deprecated: true description: "Specific playerids to send your notification to. _Does not\ \ require API Auth Key.\nDo not combine with other targeting parameters.\ \ Not compatible with any other targeting parameters.\nExample: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"\ @@ -1274,6 +1775,7 @@ components: nullable: true type: array include_external_user_ids: + deprecated: true description: "Target specific devices by custom user IDs assigned via API.\n\ Not compatible with any other targeting parameters\nExample: [\"custom-id-assigned-by-api\"\ ]\nREQUIRED: REST API Key Authentication\nLimit of 2,000 entries per REST\ @@ -1356,6 +1858,14 @@ components: items: type: string type: array + include_aliases: + $ref: '#/components/schemas/PlayerNotificationTarget_include_aliases' + target_channel: + enum: + - push + - email + - sms + type: string type: object NotificationTarget: anyOf: @@ -1593,17 +2103,24 @@ components: type: integer type: object Purchase: + example: + amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku properties: sku: description: The unique identifier of the purchased item. type: string amount: description: "The amount, in USD, spent purchasing the item." - type: number + type: string iso: description: The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. type: string + count: + type: number required: - amount - iso @@ -2038,6 +2555,270 @@ components: - push_token - subscription_id type: object + IdentityObject: + additionalProperties: true + type: object + PropertiesObject: + example: + country: country + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1.4658129805029452 + last_active: 5.962133916683182 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 + properties: + tags: + additionalProperties: true + type: object + language: + type: string + timezone_id: + type: string + lat: + type: number + long: + type: number + country: + type: string + first_active: + type: number + last_active: + type: number + amount_spent: + type: number + purchases: + items: + $ref: '#/components/schemas/Purchase' + type: array + ip: + type: string + type: object + PropertiesDeltas: + example: + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + session_count: 6.027456183070403 + session_time: 0.8008281904610115 + properties: + session_time: + type: number + session_count: + type: number + purchases: + items: + $ref: '#/components/schemas/Purchase' + type: array + type: object + SubscriptionObject: + example: + notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + properties: + id: + type: string + type: + enum: + - iOSPush + - AndroidPush + - FireOSPush + - ChromeExtensionPush + - ChromePush + - WindowsPush + - SafariLegacyPush + - FirefoxPush + - macOSPush + - HuaweiPush + - SafariPush + - Email + - SMS + type: string + token: + type: string + enabled: + type: boolean + notification_types: + type: number + session_time: + type: number + session_count: + type: number + sdk: + type: string + device_model: + type: string + device_os: + type: string + rooted: + type: boolean + test_type: + type: number + app_version: + type: string + net_type: + type: number + carrier: + type: string + web_auth: + type: string + web_p256: + type: string + type: object + User: + example: + subscriptions: + - notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + - notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + identity: + key: "" + subscription_options: + retain_previous_owner: true + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1.4658129805029452 + last_active: 5.962133916683182 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 + properties: + properties: + $ref: '#/components/schemas/PropertiesObject' + identity: + additionalProperties: true + type: object + subscriptions: + items: + $ref: '#/components/schemas/SubscriptionObject' + type: array + subscription_options: + $ref: '#/components/schemas/User_subscription_options' + type: object + UpdateUserRequest: + example: + refresh_device_metadata: false + deltas: + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + session_count: 6.027456183070403 + session_time: 0.8008281904610115 + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1.4658129805029452 + last_active: 5.962133916683182 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 + properties: + properties: + $ref: '#/components/schemas/PropertiesObject' + refresh_device_metadata: + default: false + type: boolean + deltas: + $ref: '#/components/schemas/PropertiesDeltas' + type: object CreateNotificationSuccessResponse: example: recipients: 0 @@ -2055,9 +2836,6 @@ components: type: string errors: $ref: '#/components/schemas/Notification200Errors' - required: - - id - - recipients type: object CancelNotificationSuccessResponse: example: @@ -2161,6 +2939,98 @@ components: errors: $ref: '#/components/schemas/Notification200Errors' type: object + CreateUserConflictResponse: + properties: + errors: + items: + $ref: '#/components/schemas/CreateUserConflictResponse_errors_inner' + type: array + type: object + IdentifyUserConflictResponse: + properties: + errors: + items: + $ref: '#/components/schemas/IdentifyUserConflictResponse_errors_inner' + type: array + type: object + CreateSubscriptionRequestBody: + example: + subscription: + notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + retain_previous_owner: true + properties: + subscription: + $ref: '#/components/schemas/SubscriptionObject' + retain_previous_owner: + type: boolean + type: object + UpdateSubscriptionRequestBody: + example: + subscription: + notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + properties: + subscription: + $ref: '#/components/schemas/SubscriptionObject' + type: object + TransferSubscriptionRequestBody: + example: + identity: + key: "" + properties: + identity: + additionalProperties: true + type: object + type: object + UserIdentityRequestBody: + example: + identity: + key: "" + properties: + identity: + additionalProperties: true + type: object + type: object + UserIdentityResponse: + example: + identity: + key: "" + properties: + identity: + additionalProperties: true + type: object + type: object get_notification_request_body: properties: events: @@ -2195,6 +3065,77 @@ components: type: object title: update_player_tags_request_body type: object + inline_response_202: + example: + properties: + country: country + purchases: + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + - amount: amount + iso: iso + count: 2.3021358869347655 + sku: sku + ip: ip + timezone_id: timezone_id + language: language + first_active: 1.4658129805029452 + last_active: 5.962133916683182 + lat: 0.8008281904610115 + long: 6.027456183070403 + tags: + key: "" + amount_spent: 5.637376656633329 + properties: + properties: + $ref: '#/components/schemas/PropertiesObject' + type: object + inline_response_200: + example: + identity: + key: "" + properties: + identity: + additionalProperties: true + type: object + type: object + inline_response_201: + example: + subscription: + notification_types: 7.061401241503109 + device_model: device_model + app_version: app_version + web_p256: web_p256 + net_type: 4.145608029883936 + type: iOSPush + device_os: device_os + enabled: true + session_time: 9.301444243932576 + test_type: 2.027123023002322 + token: token + carrier: carrier + session_count: 3.616076749251911 + web_auth: web_auth + rooted: true + id: id + sdk: sdk + properties: + subscription: + $ref: '#/components/schemas/SubscriptionObject' + type: object + inline_response_200_3: + example: + in_app_messages: + - "{}" + - "{}" + properties: + in_app_messages: + items: + type: object + type: array + type: object export_players_request_body: properties: extra_fields: @@ -2213,6 +3154,14 @@ components: type: string title: export_players_request_body type: object + PlayerNotificationTarget_include_aliases: + nullable: true + properties: + alias_label: + items: + type: string + type: array + type: object BasicNotification_allOf_android_background_layout: description: "Channel: Push Notifications\nPlatform: Android\nAllowing setting\ \ a background image for the notification. This is a JSON object containing\ @@ -2338,6 +3287,7 @@ components: \ days. After 30 days, the notification could be removed from our system\ \ and a notification with the same external_id will be sent again.\n \ \ See Idempotent Notification Requests for more details\nwriteOnly: true\n" + nullable: true type: string contents: allOf: @@ -3046,6 +3996,34 @@ components: unsubscribe link in this email. nullable: true type: integer + User_subscription_options: + example: + retain_previous_owner: true + properties: + retain_previous_owner: + type: boolean + type: object + CreateUserConflictResponse_errorsItems_meta: + properties: + conflicting_aliases: + type: object + type: object + CreateUserConflictResponse_errors_inner: + properties: + code: + type: string + title: + type: string + meta: + $ref: '#/components/schemas/CreateUserConflictResponse_errorsItems_meta' + type: object + IdentifyUserConflictResponse_errors_inner: + properties: + code: + type: string + title: + type: string + type: object securitySchemes: app_key: scheme: bearer diff --git a/api_default.go b/api_default.go index b25b308..47300f7 100644 --- a/api_default.go +++ b/api_default.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -766,70 +766,74 @@ func (a *DefaultApiService) CreateSegmentsExecute(r ApiCreateSegmentsRequest) (* return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeletePlayerRequest struct { +type ApiCreateSubscriptionRequest struct { ctx context.Context ApiService *DefaultApiService - appId *string - playerId string + appId string + aliasLabel string + aliasId string + createSubscriptionRequestBody *CreateSubscriptionRequestBody } -// The OneSignal App ID for your app. Available in Keys & IDs. -func (r ApiDeletePlayerRequest) AppId(appId string) ApiDeletePlayerRequest { - r.appId = &appId +func (r ApiCreateSubscriptionRequest) CreateSubscriptionRequestBody(createSubscriptionRequestBody CreateSubscriptionRequestBody) ApiCreateSubscriptionRequest { + r.createSubscriptionRequestBody = &createSubscriptionRequestBody return r } -func (r ApiDeletePlayerRequest) Execute() (*DeletePlayerSuccessResponse, *http.Response, error) { - return r.ApiService.DeletePlayerExecute(r) +func (r ApiCreateSubscriptionRequest) Execute() (*InlineResponse201, *http.Response, error) { + return r.ApiService.CreateSubscriptionExecute(r) } /* -DeletePlayer Delete a user record - -Delete player - Required: -Used to delete a single, specific Player ID record from a specific OneSignal app. +CreateSubscription Method for CreateSubscription +Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param playerId The OneSignal player_id - @return ApiDeletePlayerRequest + @param appId + @param aliasLabel + @param aliasId + @return ApiCreateSubscriptionRequest */ -func (a *DefaultApiService) DeletePlayer(ctx context.Context, playerId string) ApiDeletePlayerRequest { - return ApiDeletePlayerRequest{ +func (a *DefaultApiService) CreateSubscription(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiCreateSubscriptionRequest { + return ApiCreateSubscriptionRequest{ ApiService: a, ctx: ctx, - playerId: playerId, + appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, } } // Execute executes the request -// @return DeletePlayerSuccessResponse -func (a *DefaultApiService) DeletePlayerExecute(r ApiDeletePlayerRequest) (*DeletePlayerSuccessResponse, *http.Response, error) { +// @return InlineResponse201 +func (a *DefaultApiService) CreateSubscriptionExecute(r ApiCreateSubscriptionRequest) (*InlineResponse201, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *DeletePlayerSuccessResponse + localVarReturnValue *InlineResponse201 ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePlayer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSubscription") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/players/{player_id}" - localVarPath = strings.Replace(localVarPath, "{"+"player_id"+"}", url.PathEscape(parameterToString(r.playerId, "")), -1) + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.appId == nil { - return localVarReturnValue, nil, reportError("appId is required and must be specified") + if r.createSubscriptionRequestBody == nil { + return localVarReturnValue, nil, reportError("createSubscriptionRequestBody is required and must be specified") } - localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -845,6 +849,8 @@ func (a *DefaultApiService) DeletePlayerExecute(r ApiDeletePlayerRequest) (*Dele if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createSubscriptionRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -867,25 +873,6 @@ func (a *DefaultApiService) DeletePlayerExecute(r ApiDeletePlayerRequest) (*Dele body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v DeletePlayerNotFoundResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -901,64 +888,67 @@ func (a *DefaultApiService) DeletePlayerExecute(r ApiDeletePlayerRequest) (*Dele return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteSegmentsRequest struct { +type ApiCreateUserRequest struct { ctx context.Context ApiService *DefaultApiService appId string - segmentId string + user *User } -func (r ApiDeleteSegmentsRequest) Execute() (*DeleteSegmentSuccessResponse, *http.Response, error) { - return r.ApiService.DeleteSegmentsExecute(r) +func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest { + r.user = &user + return r } -/* -DeleteSegments Delete Segments +func (r ApiCreateUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CreateUserExecute(r) +} -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. +/* +CreateUser Method for CreateUser +Creates a User, optionally Subscriptions owned by the User as well as Aliases. +Aliases provided in the payload will be used to look up an existing User. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param appId The OneSignal App ID for your app. Available in Keys & IDs. - @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. - @return ApiDeleteSegmentsRequest + @param appId + @return ApiCreateUserRequest */ -func (a *DefaultApiService) DeleteSegments(ctx context.Context, appId string, segmentId string) ApiDeleteSegmentsRequest { - return ApiDeleteSegmentsRequest{ +func (a *DefaultApiService) CreateUser(ctx context.Context, appId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ ApiService: a, ctx: ctx, appId: appId, - segmentId: segmentId, } } // Execute executes the request -// @return DeleteSegmentSuccessResponse -func (a *DefaultApiService) DeleteSegmentsExecute(r ApiDeleteSegmentsRequest) (*DeleteSegmentSuccessResponse, *http.Response, error) { +// @return User +func (a *DefaultApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *DeleteSegmentSuccessResponse + localVarReturnValue *User ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSegments") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateUser") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/apps/{app_id}/segments/{segment_id}" + localVarPath := localBasePath + "/apps/{app_id}/users" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"segment_id"+"}", url.PathEscape(parameterToString(r.segmentId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.user == nil { + return localVarReturnValue, nil, reportError("user is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -974,6 +964,8 @@ func (a *DefaultApiService) DeleteSegmentsExecute(r ApiDeleteSegmentsRequest) (* if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.user req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -996,18 +988,8 @@ func (a *DefaultApiService) DeleteSegmentsExecute(r ApiDeleteSegmentsRequest) (* body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v DeleteSegmentNotFoundResponse + if localVarHTTPResponse.StatusCode == 409 { + var v CreateUserConflictResponse err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1030,56 +1012,62 @@ func (a *DefaultApiService) DeleteSegmentsExecute(r ApiDeleteSegmentsRequest) (* return localVarReturnValue, localVarHTTPResponse, nil } -type ApiEndLiveActivityRequest struct { +type ApiDeleteAliasRequest struct { ctx context.Context ApiService *DefaultApiService appId string - activityId string - subscriptionId string + aliasLabel string + aliasId string + aliasLabelToDelete string } -func (r ApiEndLiveActivityRequest) Execute() (*http.Response, error) { - return r.ApiService.EndLiveActivityExecute(r) +func (r ApiDeleteAliasRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.ApiService.DeleteAliasExecute(r) } /* -EndLiveActivity Stop Live Activity +DeleteAlias Method for DeleteAlias -Stops a Live Activity +Deletes an alias by alias label @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param appId The OneSignal App ID for your app. Available in Keys & IDs. - @param activityId Live Activity record ID - @param subscriptionId Subscription ID - @return ApiEndLiveActivityRequest + @param appId + @param aliasLabel + @param aliasId + @param aliasLabelToDelete + @return ApiDeleteAliasRequest */ -func (a *DefaultApiService) EndLiveActivity(ctx context.Context, appId string, activityId string, subscriptionId string) ApiEndLiveActivityRequest { - return ApiEndLiveActivityRequest{ +func (a *DefaultApiService) DeleteAlias(ctx context.Context, appId string, aliasLabel string, aliasId string, aliasLabelToDelete string) ApiDeleteAliasRequest { + return ApiDeleteAliasRequest{ ApiService: a, ctx: ctx, appId: appId, - activityId: activityId, - subscriptionId: subscriptionId, + aliasLabel: aliasLabel, + aliasId: aliasId, + aliasLabelToDelete: aliasLabelToDelete, } } // Execute executes the request -func (a *DefaultApiService) EndLiveActivityExecute(r ApiEndLiveActivityRequest) (*http.Response, error) { +// @return InlineResponse200 +func (a *DefaultApiService) DeleteAliasExecute(r ApiDeleteAliasRequest) (*InlineResponse200, *http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile + localVarReturnValue *InlineResponse200 ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EndLiveActivity") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteAlias") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}" + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"activity_id"+"}", url.PathEscape(parameterToString(r.activityId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label_to_delete"+"}", url.PathEscape(parameterToString(r.aliasLabelToDelete, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1104,19 +1092,19 @@ func (a *DefaultApiService) EndLiveActivityExecute(r ApiEndLiveActivityRequest) } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1124,123 +1112,85 @@ func (a *DefaultApiService) EndLiveActivityExecute(r ApiEndLiveActivityRequest) body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiExportPlayersRequest struct { +type ApiDeletePlayerRequest struct { ctx context.Context ApiService *DefaultApiService - appId string - exportPlayersRequestBody *ExportPlayersRequestBody + appId *string + playerId string } -func (r ApiExportPlayersRequest) ExportPlayersRequestBody(exportPlayersRequestBody ExportPlayersRequestBody) ApiExportPlayersRequest { - r.exportPlayersRequestBody = &exportPlayersRequestBody +// The OneSignal App ID for your app. Available in Keys & IDs. +func (r ApiDeletePlayerRequest) AppId(appId string) ApiDeletePlayerRequest { + r.appId = &appId return r } -func (r ApiExportPlayersRequest) Execute() (*ExportPlayersSuccessResponse, *http.Response, error) { - return r.ApiService.ExportPlayersExecute(r) +func (r ApiDeletePlayerRequest) Execute() (*DeletePlayerSuccessResponse, *http.Response, error) { + return r.ApiService.DeletePlayerExecute(r) } /* -ExportPlayers CSV export +DeletePlayer Delete a user record -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. | +Delete player - Required: +Used to delete a single, specific Player ID record from a specific OneSignal app. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param appId The app ID that you want to export devices from - @return ApiExportPlayersRequest + @param playerId The OneSignal player_id + @return ApiDeletePlayerRequest */ -func (a *DefaultApiService) ExportPlayers(ctx context.Context, appId string) ApiExportPlayersRequest { - return ApiExportPlayersRequest{ +func (a *DefaultApiService) DeletePlayer(ctx context.Context, playerId string) ApiDeletePlayerRequest { + return ApiDeletePlayerRequest{ ApiService: a, ctx: ctx, - appId: appId, + playerId: playerId, } } // Execute executes the request -// @return ExportPlayersSuccessResponse -func (a *DefaultApiService) ExportPlayersExecute(r ApiExportPlayersRequest) (*ExportPlayersSuccessResponse, *http.Response, error) { +// @return DeletePlayerSuccessResponse +func (a *DefaultApiService) DeletePlayerExecute(r ApiDeletePlayerRequest) (*DeletePlayerSuccessResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ExportPlayersSuccessResponse + localVarReturnValue *DeletePlayerSuccessResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ExportPlayers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePlayer") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/players/csv_export?app_id={app_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath := localBasePath + "/players/{player_id}" + localVarPath = strings.Replace(localVarPath, "{"+"player_id"+"}", url.PathEscape(parameterToString(r.playerId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.appId == nil { + return localVarReturnValue, nil, reportError("appId is required and must be specified") + } + localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1256,8 +1206,6 @@ func (a *DefaultApiService) ExportPlayersExecute(r ApiExportPlayersRequest) (*Ex if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.exportPlayersRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1288,6 +1236,16 @@ func (a *DefaultApiService) ExportPlayersExecute(r ApiExportPlayersRequest) (*Ex return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v DeletePlayerNotFoundResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1304,57 +1262,1443 @@ func (a *DefaultApiService) ExportPlayersExecute(r ApiExportPlayersRequest) (*Ex return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetAppRequest struct { +type ApiDeleteSegmentsRequest struct { ctx context.Context ApiService *DefaultApiService appId string + segmentId string } -func (r ApiGetAppRequest) Execute() (*App, *http.Response, error) { - return r.ApiService.GetAppExecute(r) -} +func (r ApiDeleteSegmentsRequest) Execute() (*DeleteSegmentSuccessResponse, *http.Response, error) { + return r.ApiService.DeleteSegmentsExecute(r) +} + +/* +DeleteSegments Delete Segments + +Delete segments (not user devices) - Required: OneSignal Paid Plan +You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. +The segment_id can be found in the URL of the segment when viewing it in the dashboard. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The OneSignal App ID for your app. Available in Keys & IDs. + @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard. + @return ApiDeleteSegmentsRequest +*/ +func (a *DefaultApiService) DeleteSegments(ctx context.Context, appId string, segmentId string) ApiDeleteSegmentsRequest { + return ApiDeleteSegmentsRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + segmentId: segmentId, + } +} + +// Execute executes the request +// @return DeleteSegmentSuccessResponse +func (a *DefaultApiService) DeleteSegmentsExecute(r ApiDeleteSegmentsRequest) (*DeleteSegmentSuccessResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteSegmentSuccessResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSegments") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/segments/{segment_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"segment_id"+"}", url.PathEscape(parameterToString(r.segmentId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v DeleteSegmentNotFoundResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteSubscriptionRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + subscriptionId string +} + +func (r ApiDeleteSubscriptionRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSubscriptionExecute(r) +} + +/* +DeleteSubscription Method for DeleteSubscription + +Deletes the Subscription. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param subscriptionId + @return ApiDeleteSubscriptionRequest +*/ +func (a *DefaultApiService) DeleteSubscription(ctx context.Context, appId string, subscriptionId string) ApiDeleteSubscriptionRequest { + return ApiDeleteSubscriptionRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +func (a *DefaultApiService) DeleteSubscriptionExecute(r ApiDeleteSubscriptionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSubscription") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + aliasLabel string + aliasId string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Method for DeleteUser + +Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param aliasLabel + @param aliasId + @return ApiDeleteUserRequest +*/ +func (a *DefaultApiService) DeleteUser(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, + } +} + +// Execute executes the request +func (a *DefaultApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndLiveActivityRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + activityId string + subscriptionId string +} + +func (r ApiEndLiveActivityRequest) Execute() (*http.Response, error) { + return r.ApiService.EndLiveActivityExecute(r) +} + +/* +EndLiveActivity Stop Live Activity + +Stops a Live Activity + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The OneSignal App ID for your app. Available in Keys & IDs. + @param activityId Live Activity record ID + @param subscriptionId Subscription ID + @return ApiEndLiveActivityRequest +*/ +func (a *DefaultApiService) EndLiveActivity(ctx context.Context, appId string, activityId string, subscriptionId string) ApiEndLiveActivityRequest { + return ApiEndLiveActivityRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + activityId: activityId, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +func (a *DefaultApiService) EndLiveActivityExecute(r ApiEndLiveActivityRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EndLiveActivity") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"activity_id"+"}", url.PathEscape(parameterToString(r.activityId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiExportPlayersRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + exportPlayersRequestBody *ExportPlayersRequestBody +} + +func (r ApiExportPlayersRequest) ExportPlayersRequestBody(exportPlayersRequestBody ExportPlayersRequestBody) ApiExportPlayersRequest { + r.exportPlayersRequestBody = &exportPlayersRequestBody + return r +} + +func (r ApiExportPlayersRequest) Execute() (*ExportPlayersSuccessResponse, *http.Response, error) { + return r.ApiService.ExportPlayersExecute(r) +} + +/* +ExportPlayers CSV export + +Generate a compressed CSV export of all of your current user data +This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. +The file will be compressed using GZip. +The file may take several minutes to generate depending on the number of users in your app. +The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. +🚧 +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. | + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app ID that you want to export devices from + @return ApiExportPlayersRequest +*/ +func (a *DefaultApiService) ExportPlayers(ctx context.Context, appId string) ApiExportPlayersRequest { + return ApiExportPlayersRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + } +} + +// Execute executes the request +// @return ExportPlayersSuccessResponse +func (a *DefaultApiService) ExportPlayersExecute(r ApiExportPlayersRequest) (*ExportPlayersSuccessResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExportPlayersSuccessResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ExportPlayers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/players/csv_export?app_id={app_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.exportPlayersRequestBody + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFetchAliasesRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + subscriptionId string +} + +func (r ApiFetchAliasesRequest) Execute() (*UserIdentityResponse, *http.Response, error) { + return r.ApiService.FetchAliasesExecute(r) +} + +/* +FetchAliases Method for FetchAliases + +Lists all Aliases for the User identified by :subscription_id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param subscriptionId + @return ApiFetchAliasesRequest +*/ +func (a *DefaultApiService) FetchAliases(ctx context.Context, appId string, subscriptionId string) ApiFetchAliasesRequest { + return ApiFetchAliasesRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +// @return UserIdentityResponse +func (a *DefaultApiService) FetchAliasesExecute(r ApiFetchAliasesRequest) (*UserIdentityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserIdentityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FetchAliases") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFetchUserRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + aliasLabel string + aliasId string +} + +func (r ApiFetchUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.FetchUserExecute(r) +} + +/* +FetchUser Method for FetchUser + +Returns the User’s properties, Aliases, and Subscriptions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param aliasLabel + @param aliasId + @return ApiFetchUserRequest +*/ +func (a *DefaultApiService) FetchUser(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiFetchUserRequest { + return ApiFetchUserRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, + } +} + +// Execute executes the request +// @return User +func (a *DefaultApiService) FetchUserExecute(r ApiFetchUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FetchUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFetchUserIdentityRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + aliasLabel string + aliasId string +} + +func (r ApiFetchUserIdentityRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.ApiService.FetchUserIdentityExecute(r) +} + +/* +FetchUserIdentity Method for FetchUserIdentity + +Lists all Aliases for the User identified by (:alias_label, :alias_id). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param aliasLabel + @param aliasId + @return ApiFetchUserIdentityRequest +*/ +func (a *DefaultApiService) FetchUserIdentity(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiFetchUserIdentityRequest { + return ApiFetchUserIdentityRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, + } +} + +// Execute executes the request +// @return InlineResponse200 +func (a *DefaultApiService) FetchUserIdentityExecute(r ApiFetchUserIdentityRequest) (*InlineResponse200, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InlineResponse200 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FetchUserIdentity") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAppRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string +} + +func (r ApiGetAppRequest) Execute() (*App, *http.Response, error) { + return r.ApiService.GetAppExecute(r) +} + +/* +GetApp View an app + +View the details of a single OneSignal app + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId An app id + @return ApiGetAppRequest +*/ +func (a *DefaultApiService) GetApp(ctx context.Context, appId string) ApiGetAppRequest { + return ApiGetAppRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + } +} + +// Execute executes the request +// @return App +func (a *DefaultApiService) GetAppExecute(r ApiGetAppRequest) (*App, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *App + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetApp") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAppsRequest struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetAppsRequest) Execute() ([]App, *http.Response, error) { + return r.ApiService.GetAppsExecute(r) +} + +/* +GetApps View apps + +View the details of all of your current OneSignal apps + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAppsRequest +*/ +func (a *DefaultApiService) GetApps(ctx context.Context) ApiGetAppsRequest { + return ApiGetAppsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []App +func (a *DefaultApiService) GetAppsExecute(r ApiGetAppsRequest) ([]App, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []App + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetApps") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetEligibleIamsRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + subscriptionId string +} + +func (r ApiGetEligibleIamsRequest) Execute() (*InlineResponse2003, *http.Response, error) { + return r.ApiService.GetEligibleIamsExecute(r) +} + +/* +GetEligibleIams Method for GetEligibleIams + +Manifest of In-App Messages the Subscription is eligible to display by the SDK. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param subscriptionId + @return ApiGetEligibleIamsRequest +*/ +func (a *DefaultApiService) GetEligibleIams(ctx context.Context, appId string, subscriptionId string) ApiGetEligibleIamsRequest { + return ApiGetEligibleIamsRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +// @return InlineResponse2003 +func (a *DefaultApiService) GetEligibleIamsExecute(r ApiGetEligibleIamsRequest) (*InlineResponse2003, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InlineResponse2003 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetEligibleIams") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}/iams" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetNotificationRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId *string + notificationId string +} + +func (r ApiGetNotificationRequest) AppId(appId string) ApiGetNotificationRequest { + r.appId = &appId + return r +} + +func (r ApiGetNotificationRequest) Execute() (*NotificationWithMeta, *http.Response, error) { + return r.ApiService.GetNotificationExecute(r) +} + +/* +GetNotification View notification + +View the details of a single notification and outcomes associated with it + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param notificationId + @return ApiGetNotificationRequest +*/ +func (a *DefaultApiService) GetNotification(ctx context.Context, notificationId string) ApiGetNotificationRequest { + return ApiGetNotificationRequest{ + ApiService: a, + ctx: ctx, + notificationId: notificationId, + } +} + +// Execute executes the request +// @return NotificationWithMeta +func (a *DefaultApiService) GetNotificationExecute(r ApiGetNotificationRequest) (*NotificationWithMeta, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationWithMeta + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotification") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/{notification_id}" + localVarPath = strings.Replace(localVarPath, "{"+"notification_id"+"}", url.PathEscape(parameterToString(r.notificationId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.appId == nil { + return localVarReturnValue, nil, reportError("appId is required and must be specified") + } + + localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadRequestError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetNotificationHistoryRequest struct { + ctx context.Context + ApiService *DefaultApiService + notificationId string + getNotificationRequestBody *GetNotificationRequestBody +} + +func (r ApiGetNotificationHistoryRequest) GetNotificationRequestBody(getNotificationRequestBody GetNotificationRequestBody) ApiGetNotificationHistoryRequest { + r.getNotificationRequestBody = &getNotificationRequestBody + return r +} + +func (r ApiGetNotificationHistoryRequest) Execute() (*NotificationHistorySuccessResponse, *http.Response, error) { + return r.ApiService.GetNotificationHistoryExecute(r) +} /* -GetApp View an app +GetNotificationHistory Notification History -View the details of a single OneSignal app +-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have "sent" events recorded, but will show "clicked" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param appId An app id - @return ApiGetAppRequest + @param notificationId The \"id\" of the message found in the Notification object + @return ApiGetNotificationHistoryRequest */ -func (a *DefaultApiService) GetApp(ctx context.Context, appId string) ApiGetAppRequest { - return ApiGetAppRequest{ +func (a *DefaultApiService) GetNotificationHistory(ctx context.Context, notificationId string) ApiGetNotificationHistoryRequest { + return ApiGetNotificationHistoryRequest{ ApiService: a, ctx: ctx, - appId: appId, + notificationId: notificationId, } } // Execute executes the request -// @return App -func (a *DefaultApiService) GetAppExecute(r ApiGetAppRequest) (*App, *http.Response, error) { +// @return NotificationHistorySuccessResponse +func (a *DefaultApiService) GetNotificationHistoryExecute(r ApiGetNotificationHistoryRequest) (*NotificationHistorySuccessResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *App + localVarReturnValue *NotificationHistorySuccessResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetApp") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotificationHistory") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/apps/{app_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath := localBasePath + "/notifications/{notification_id}/history" + localVarPath = strings.Replace(localVarPath, "{"+"notification_id"+"}", url.PathEscape(parameterToString(r.notificationId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.getNotificationRequestBody == nil { + return localVarReturnValue, nil, reportError("getNotificationRequestBody is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1370,6 +2714,8 @@ func (a *DefaultApiService) GetAppExecute(r ApiGetAppRequest) (*App, *http.Respo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.getNotificationRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1416,51 +2762,92 @@ func (a *DefaultApiService) GetAppExecute(r ApiGetAppRequest) (*App, *http.Respo return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetAppsRequest struct { +type ApiGetNotificationsRequest struct { ctx context.Context ApiService *DefaultApiService + appId *string + limit *int32 + offset *int32 + kind *int32 } -func (r ApiGetAppsRequest) Execute() ([]App, *http.Response, error) { - return r.ApiService.GetAppsExecute(r) +// The app ID that you want to view notifications from +func (r ApiGetNotificationsRequest) AppId(appId string) ApiGetNotificationsRequest { + r.appId = &appId + return r +} + +// How many notifications to return. Max is 50. Default is 50. +func (r ApiGetNotificationsRequest) Limit(limit int32) ApiGetNotificationsRequest { + r.limit = &limit + return r +} + +// 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. +func (r ApiGetNotificationsRequest) Offset(offset int32) ApiGetNotificationsRequest { + r.offset = &offset + return r +} + +// Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only +func (r ApiGetNotificationsRequest) Kind(kind int32) ApiGetNotificationsRequest { + r.kind = &kind + return r +} + +func (r ApiGetNotificationsRequest) Execute() (*NotificationSlice, *http.Response, error) { + return r.ApiService.GetNotificationsExecute(r) } /* -GetApps View apps +GetNotifications View notifications -View the details of all of your current OneSignal apps +View the details of multiple notifications @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetAppsRequest + @return ApiGetNotificationsRequest */ -func (a *DefaultApiService) GetApps(ctx context.Context) ApiGetAppsRequest { - return ApiGetAppsRequest{ +func (a *DefaultApiService) GetNotifications(ctx context.Context) ApiGetNotificationsRequest { + return ApiGetNotificationsRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return []App -func (a *DefaultApiService) GetAppsExecute(r ApiGetAppsRequest) ([]App, *http.Response, error) { +// @return NotificationSlice +func (a *DefaultApiService) GetNotificationsExecute(r ApiGetNotificationsRequest) (*NotificationSlice, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []App + localVarReturnValue *NotificationSlice ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetApps") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotifications") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/apps" + localVarPath := localBasePath + "/notifications" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.appId == nil { + return localVarReturnValue, nil, reportError("appId is required and must be specified") + } + localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.offset != nil { + localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + } + if r.kind != nil { + localVarQueryParams.Add("kind", parameterToString(*r.kind, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1524,65 +2911,115 @@ func (a *DefaultApiService) GetAppsExecute(r ApiGetAppsRequest) ([]App, *http.Re return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetNotificationRequest struct { +type ApiGetOutcomesRequest struct { ctx context.Context ApiService *DefaultApiService - appId *string - notificationId string + appId string + outcomeNames *string + outcomeNames2 *string + outcomeTimeRange *string + outcomePlatforms *string + outcomeAttribution *string } -func (r ApiGetNotificationRequest) AppId(appId string) ApiGetNotificationRequest { - r.appId = &appId +// 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 +func (r ApiGetOutcomesRequest) OutcomeNames(outcomeNames string) ApiGetOutcomesRequest { + r.outcomeNames = &outcomeNames return r } -func (r ApiGetNotificationRequest) Execute() (*NotificationWithMeta, *http.Response, error) { - return r.ApiService.GetNotificationExecute(r) +// 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. +func (r ApiGetOutcomesRequest) OutcomeNames2(outcomeNames2 string) ApiGetOutcomesRequest { + r.outcomeNames2 = &outcomeNames2 + return r +} + +// 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. +func (r ApiGetOutcomesRequest) OutcomeTimeRange(outcomeTimeRange string) ApiGetOutcomesRequest { + r.outcomeTimeRange = &outcomeTimeRange + return r +} + +// 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. +func (r ApiGetOutcomesRequest) OutcomePlatforms(outcomePlatforms string) ApiGetOutcomesRequest { + r.outcomePlatforms = &outcomePlatforms + return r +} + +// 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. +func (r ApiGetOutcomesRequest) OutcomeAttribution(outcomeAttribution string) ApiGetOutcomesRequest { + r.outcomeAttribution = &outcomeAttribution + return r +} + +func (r ApiGetOutcomesRequest) Execute() (*OutcomesData, *http.Response, error) { + return r.ApiService.GetOutcomesExecute(r) } /* -GetNotification View notification +GetOutcomes View Outcomes + +View the details of all the outcomes associated with your app + +🚧 +Requires Authentication Key +Requires your OneSignal App's REST API Key, available in Keys & IDs. + +🚧 +Outcome Data Limitations +Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. -View the details of a single notification and outcomes associated with it @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param notificationId - @return ApiGetNotificationRequest + @param appId The OneSignal App ID for your app. Available in Keys & IDs. + @return ApiGetOutcomesRequest */ -func (a *DefaultApiService) GetNotification(ctx context.Context, notificationId string) ApiGetNotificationRequest { - return ApiGetNotificationRequest{ +func (a *DefaultApiService) GetOutcomes(ctx context.Context, appId string) ApiGetOutcomesRequest { + return ApiGetOutcomesRequest{ ApiService: a, ctx: ctx, - notificationId: notificationId, + appId: appId, } } // Execute executes the request -// @return NotificationWithMeta -func (a *DefaultApiService) GetNotificationExecute(r ApiGetNotificationRequest) (*NotificationWithMeta, *http.Response, error) { +// @return OutcomesData +func (a *DefaultApiService) GetOutcomesExecute(r ApiGetOutcomesRequest) (*OutcomesData, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NotificationWithMeta + localVarReturnValue *OutcomesData ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotification") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOutcomes") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/{notification_id}" - localVarPath = strings.Replace(localVarPath, "{"+"notification_id"+"}", url.PathEscape(parameterToString(r.notificationId, "")), -1) + localVarPath := localBasePath + "/apps/{app_id}/outcomes" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.appId == nil { - return localVarReturnValue, nil, reportError("appId is required and must be specified") + if r.outcomeNames == nil { + return localVarReturnValue, nil, reportError("outcomeNames is required and must be specified") } - localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) + localVarQueryParams.Add("outcome_names", parameterToString(*r.outcomeNames, "")) + if r.outcomeNames2 != nil { + localVarQueryParams.Add("outcome_names[]", parameterToString(*r.outcomeNames2, "")) + } + if r.outcomeTimeRange != nil { + localVarQueryParams.Add("outcome_time_range", parameterToString(*r.outcomeTimeRange, "")) + } + if r.outcomePlatforms != nil { + localVarQueryParams.Add("outcome_platforms", parameterToString(*r.outcomePlatforms, "")) + } + if r.outcomeAttribution != nil { + localVarQueryParams.Add("outcome_attribution", parameterToString(*r.outcomeAttribution, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1646,66 +3083,78 @@ func (a *DefaultApiService) GetNotificationExecute(r ApiGetNotificationRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetNotificationHistoryRequest struct { +type ApiGetPlayerRequest struct { ctx context.Context ApiService *DefaultApiService - notificationId string - getNotificationRequestBody *GetNotificationRequestBody + appId *string + playerId string + emailAuthHash *string } -func (r ApiGetNotificationHistoryRequest) GetNotificationRequestBody(getNotificationRequestBody GetNotificationRequestBody) ApiGetNotificationHistoryRequest { - r.getNotificationRequestBody = &getNotificationRequestBody +// Your app_id for this device +func (r ApiGetPlayerRequest) AppId(appId string) ApiGetPlayerRequest { + r.appId = &appId return r } -func (r ApiGetNotificationHistoryRequest) Execute() (*NotificationHistorySuccessResponse, *http.Response, error) { - return r.ApiService.GetNotificationHistoryExecute(r) +// Email - Only required if you have enabled Identity Verification and device_type is email (11). +func (r ApiGetPlayerRequest) EmailAuthHash(emailAuthHash string) ApiGetPlayerRequest { + r.emailAuthHash = &emailAuthHash + return r +} + +func (r ApiGetPlayerRequest) Execute() (*Player, *http.Response, error) { + return r.ApiService.GetPlayerExecute(r) } /* -GetNotificationHistory Notification History +GetPlayer View device --> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have "sent" events recorded, but will show "clicked" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. +View the details of an existing device in one of your OneSignal apps @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param notificationId The \"id\" of the message found in the Notification object - @return ApiGetNotificationHistoryRequest + @param playerId Player's OneSignal ID + @return ApiGetPlayerRequest */ -func (a *DefaultApiService) GetNotificationHistory(ctx context.Context, notificationId string) ApiGetNotificationHistoryRequest { - return ApiGetNotificationHistoryRequest{ +func (a *DefaultApiService) GetPlayer(ctx context.Context, playerId string) ApiGetPlayerRequest { + return ApiGetPlayerRequest{ ApiService: a, ctx: ctx, - notificationId: notificationId, + playerId: playerId, } } // Execute executes the request -// @return NotificationHistorySuccessResponse -func (a *DefaultApiService) GetNotificationHistoryExecute(r ApiGetNotificationHistoryRequest) (*NotificationHistorySuccessResponse, *http.Response, error) { +// @return Player +func (a *DefaultApiService) GetPlayerExecute(r ApiGetPlayerRequest) (*Player, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NotificationHistorySuccessResponse + localVarReturnValue *Player ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotificationHistory") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPlayer") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/{notification_id}/history" - localVarPath = strings.Replace(localVarPath, "{"+"notification_id"+"}", url.PathEscape(parameterToString(r.notificationId, "")), -1) + localVarPath := localBasePath + "/players/{player_id}" + localVarPath = strings.Replace(localVarPath, "{"+"player_id"+"}", url.PathEscape(parameterToString(r.playerId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.getNotificationRequestBody == nil { - return localVarReturnValue, nil, reportError("getNotificationRequestBody is required and must be specified") + if r.appId == nil { + return localVarReturnValue, nil, reportError("appId is required and must be specified") } + localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) + if r.emailAuthHash != nil { + localVarQueryParams.Add("email_auth_hash", parameterToString(*r.emailAuthHash, "")) + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1721,8 +3170,6 @@ func (a *DefaultApiService) GetNotificationHistoryExecute(r ApiGetNotificationHi if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.getNotificationRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1769,74 +3216,70 @@ func (a *DefaultApiService) GetNotificationHistoryExecute(r ApiGetNotificationHi return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetNotificationsRequest struct { +type ApiGetPlayersRequest struct { ctx context.Context ApiService *DefaultApiService appId *string limit *int32 offset *int32 - kind *int32 } -// The app ID that you want to view notifications from -func (r ApiGetNotificationsRequest) AppId(appId string) ApiGetNotificationsRequest { +// The app ID that you want to view players from +func (r ApiGetPlayersRequest) AppId(appId string) ApiGetPlayersRequest { r.appId = &appId return r } -// How many notifications to return. Max is 50. Default is 50. -func (r ApiGetNotificationsRequest) Limit(limit int32) ApiGetNotificationsRequest { +// How many devices to return. Max is 300. Default is 300 +func (r ApiGetPlayersRequest) Limit(limit int32) ApiGetPlayersRequest { r.limit = &limit return r } -// 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. -func (r ApiGetNotificationsRequest) Offset(offset int32) ApiGetNotificationsRequest { +// Result offset. Default is 0. Results are sorted by id; +func (r ApiGetPlayersRequest) Offset(offset int32) ApiGetPlayersRequest { r.offset = &offset return r } -// Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only -func (r ApiGetNotificationsRequest) Kind(kind int32) ApiGetNotificationsRequest { - r.kind = &kind - return r -} - -func (r ApiGetNotificationsRequest) Execute() (*NotificationSlice, *http.Response, error) { - return r.ApiService.GetNotificationsExecute(r) +func (r ApiGetPlayersRequest) Execute() (*PlayerSlice, *http.Response, error) { + return r.ApiService.GetPlayersExecute(r) } /* -GetNotifications View notifications +GetPlayers 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. -View the details of multiple notifications @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetNotificationsRequest + @return ApiGetPlayersRequest */ -func (a *DefaultApiService) GetNotifications(ctx context.Context) ApiGetNotificationsRequest { - return ApiGetNotificationsRequest{ +func (a *DefaultApiService) GetPlayers(ctx context.Context) ApiGetPlayersRequest { + return ApiGetPlayersRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return NotificationSlice -func (a *DefaultApiService) GetNotificationsExecute(r ApiGetNotificationsRequest) (*NotificationSlice, *http.Response, error) { +// @return PlayerSlice +func (a *DefaultApiService) GetPlayersExecute(r ApiGetPlayersRequest) (*PlayerSlice, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NotificationSlice + localVarReturnValue *PlayerSlice ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNotifications") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPlayers") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications" + localVarPath := localBasePath + "/players" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1852,9 +3295,6 @@ func (a *DefaultApiService) GetNotificationsExecute(r ApiGetNotificationsRequest if r.offset != nil { localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) } - if r.kind != nil { - localVarQueryParams.Add("kind", parameterToString(*r.kind, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1918,117 +3358,74 @@ func (a *DefaultApiService) GetNotificationsExecute(r ApiGetNotificationsRequest return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetOutcomesRequest struct { +type ApiIdentifyUserByAliasRequest struct { ctx context.Context ApiService *DefaultApiService appId string - outcomeNames *string - outcomeNames2 *string - outcomeTimeRange *string - outcomePlatforms *string - outcomeAttribution *string -} - -// Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum -func (r ApiGetOutcomesRequest) OutcomeNames(outcomeNames string) ApiGetOutcomesRequest { - r.outcomeNames = &outcomeNames - return r -} - -// 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. -func (r ApiGetOutcomesRequest) OutcomeNames2(outcomeNames2 string) ApiGetOutcomesRequest { - r.outcomeNames2 = &outcomeNames2 - return r -} - -// 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. -func (r ApiGetOutcomesRequest) OutcomeTimeRange(outcomeTimeRange string) ApiGetOutcomesRequest { - r.outcomeTimeRange = &outcomeTimeRange - return r + aliasLabel string + aliasId string + userIdentityRequestBody *UserIdentityRequestBody } -// 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. -func (r ApiGetOutcomesRequest) OutcomePlatforms(outcomePlatforms string) ApiGetOutcomesRequest { - r.outcomePlatforms = &outcomePlatforms - return r -} - -// 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. -func (r ApiGetOutcomesRequest) OutcomeAttribution(outcomeAttribution string) ApiGetOutcomesRequest { - r.outcomeAttribution = &outcomeAttribution +func (r ApiIdentifyUserByAliasRequest) UserIdentityRequestBody(userIdentityRequestBody UserIdentityRequestBody) ApiIdentifyUserByAliasRequest { + r.userIdentityRequestBody = &userIdentityRequestBody return r } -func (r ApiGetOutcomesRequest) Execute() (*OutcomesData, *http.Response, error) { - return r.ApiService.GetOutcomesExecute(r) +func (r ApiIdentifyUserByAliasRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.ApiService.IdentifyUserByAliasExecute(r) } /* -GetOutcomes View Outcomes - -View the details of all the outcomes associated with your app - -🚧 -Requires Authentication Key -Requires your OneSignal App's REST API Key, available in Keys & IDs. - -🚧 -Outcome Data Limitations -Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. +IdentifyUserByAlias Method for IdentifyUserByAlias +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param appId The OneSignal App ID for your app. Available in Keys & IDs. - @return ApiGetOutcomesRequest + @param appId + @param aliasLabel + @param aliasId + @return ApiIdentifyUserByAliasRequest */ -func (a *DefaultApiService) GetOutcomes(ctx context.Context, appId string) ApiGetOutcomesRequest { - return ApiGetOutcomesRequest{ +func (a *DefaultApiService) IdentifyUserByAlias(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiIdentifyUserByAliasRequest { + return ApiIdentifyUserByAliasRequest{ ApiService: a, ctx: ctx, appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, } } // Execute executes the request -// @return OutcomesData -func (a *DefaultApiService) GetOutcomesExecute(r ApiGetOutcomesRequest) (*OutcomesData, *http.Response, error) { +// @return InlineResponse200 +func (a *DefaultApiService) IdentifyUserByAliasExecute(r ApiIdentifyUserByAliasRequest) (*InlineResponse200, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *OutcomesData + localVarReturnValue *InlineResponse200 ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOutcomes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.IdentifyUserByAlias") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/apps/{app_id}/outcomes" + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.outcomeNames == nil { - return localVarReturnValue, nil, reportError("outcomeNames is required and must be specified") + if r.userIdentityRequestBody == nil { + return localVarReturnValue, nil, reportError("userIdentityRequestBody is required and must be specified") } - localVarQueryParams.Add("outcome_names", parameterToString(*r.outcomeNames, "")) - if r.outcomeNames2 != nil { - localVarQueryParams.Add("outcome_names[]", parameterToString(*r.outcomeNames2, "")) - } - if r.outcomeTimeRange != nil { - localVarQueryParams.Add("outcome_time_range", parameterToString(*r.outcomeTimeRange, "")) - } - if r.outcomePlatforms != nil { - localVarQueryParams.Add("outcome_platforms", parameterToString(*r.outcomePlatforms, "")) - } - if r.outcomeAttribution != nil { - localVarQueryParams.Add("outcome_attribution", parameterToString(*r.outcomeAttribution, "")) - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2044,6 +3441,8 @@ func (a *DefaultApiService) GetOutcomesExecute(r ApiGetOutcomesRequest) (*Outcom if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.userIdentityRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2066,8 +3465,8 @@ func (a *DefaultApiService) GetOutcomesExecute(r ApiGetOutcomesRequest) (*Outcom body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError + if localVarHTTPResponse.StatusCode == 409 { + var v IdentifyUserConflictResponse err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2090,78 +3489,70 @@ func (a *DefaultApiService) GetOutcomesExecute(r ApiGetOutcomesRequest) (*Outcom return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetPlayerRequest struct { +type ApiIdentifyUserBySubscriptionIdRequest struct { ctx context.Context ApiService *DefaultApiService - appId *string - playerId string - emailAuthHash *string -} - -// Your app_id for this device -func (r ApiGetPlayerRequest) AppId(appId string) ApiGetPlayerRequest { - r.appId = &appId - return r + appId string + subscriptionId string + userIdentityRequestBody *UserIdentityRequestBody } -// Email - Only required if you have enabled Identity Verification and device_type is email (11). -func (r ApiGetPlayerRequest) EmailAuthHash(emailAuthHash string) ApiGetPlayerRequest { - r.emailAuthHash = &emailAuthHash +func (r ApiIdentifyUserBySubscriptionIdRequest) UserIdentityRequestBody(userIdentityRequestBody UserIdentityRequestBody) ApiIdentifyUserBySubscriptionIdRequest { + r.userIdentityRequestBody = &userIdentityRequestBody return r } -func (r ApiGetPlayerRequest) Execute() (*Player, *http.Response, error) { - return r.ApiService.GetPlayerExecute(r) +func (r ApiIdentifyUserBySubscriptionIdRequest) Execute() (*UserIdentityResponse, *http.Response, error) { + return r.ApiService.IdentifyUserBySubscriptionIdExecute(r) } /* -GetPlayer View device +IdentifyUserBySubscriptionId Method for IdentifyUserBySubscriptionId -View the details of an existing device in one of your OneSignal apps +Upserts one or more Aliases for the User identified by :subscription_id. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param playerId Player's OneSignal ID - @return ApiGetPlayerRequest + @param appId + @param subscriptionId + @return ApiIdentifyUserBySubscriptionIdRequest */ -func (a *DefaultApiService) GetPlayer(ctx context.Context, playerId string) ApiGetPlayerRequest { - return ApiGetPlayerRequest{ +func (a *DefaultApiService) IdentifyUserBySubscriptionId(ctx context.Context, appId string, subscriptionId string) ApiIdentifyUserBySubscriptionIdRequest { + return ApiIdentifyUserBySubscriptionIdRequest{ ApiService: a, ctx: ctx, - playerId: playerId, + appId: appId, + subscriptionId: subscriptionId, } } // Execute executes the request -// @return Player -func (a *DefaultApiService) GetPlayerExecute(r ApiGetPlayerRequest) (*Player, *http.Response, error) { +// @return UserIdentityResponse +func (a *DefaultApiService) IdentifyUserBySubscriptionIdExecute(r ApiIdentifyUserBySubscriptionIdRequest) (*UserIdentityResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Player + localVarReturnValue *UserIdentityResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPlayer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.IdentifyUserBySubscriptionId") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/players/{player_id}" - localVarPath = strings.Replace(localVarPath, "{"+"player_id"+"}", url.PathEscape(parameterToString(r.playerId, "")), -1) + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}/user/identity" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.appId == nil { - return localVarReturnValue, nil, reportError("appId is required and must be specified") - } - - localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) - if r.emailAuthHash != nil { - localVarQueryParams.Add("email_auth_hash", parameterToString(*r.emailAuthHash, "")) + localVarFormParams := url.Values{} + if r.userIdentityRequestBody == nil { + return localVarReturnValue, nil, reportError("userIdentityRequestBody is required and must be specified") } + // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2177,6 +3568,8 @@ func (a *DefaultApiService) GetPlayerExecute(r ApiGetPlayerRequest) (*Player, *h if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.userIdentityRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2199,8 +3592,8 @@ func (a *DefaultApiService) GetPlayerExecute(r ApiGetPlayerRequest) (*Player, *h body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError + if localVarHTTPResponse.StatusCode == 409 { + var v IdentifyUserConflictResponse err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2223,87 +3616,70 @@ func (a *DefaultApiService) GetPlayerExecute(r ApiGetPlayerRequest) (*Player, *h return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetPlayersRequest struct { +type ApiTransferSubscriptionRequest struct { ctx context.Context ApiService *DefaultApiService - appId *string - limit *int32 - offset *int32 -} - -// The app ID that you want to view players from -func (r ApiGetPlayersRequest) AppId(appId string) ApiGetPlayersRequest { - r.appId = &appId - return r -} - -// How many devices to return. Max is 300. Default is 300 -func (r ApiGetPlayersRequest) Limit(limit int32) ApiGetPlayersRequest { - r.limit = &limit - return r + appId string + subscriptionId string + transferSubscriptionRequestBody *TransferSubscriptionRequestBody } -// Result offset. Default is 0. Results are sorted by id; -func (r ApiGetPlayersRequest) Offset(offset int32) ApiGetPlayersRequest { - r.offset = &offset +func (r ApiTransferSubscriptionRequest) TransferSubscriptionRequestBody(transferSubscriptionRequestBody TransferSubscriptionRequestBody) ApiTransferSubscriptionRequest { + r.transferSubscriptionRequestBody = &transferSubscriptionRequestBody return r } -func (r ApiGetPlayersRequest) Execute() (*PlayerSlice, *http.Response, error) { - return r.ApiService.GetPlayersExecute(r) +func (r ApiTransferSubscriptionRequest) Execute() (*UserIdentityResponse, *http.Response, error) { + return r.ApiService.TransferSubscriptionExecute(r) } /* -GetPlayers 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. +TransferSubscription Method for TransferSubscription +Transfers this Subscription to the User identified by the identity in the payload. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetPlayersRequest + @param appId + @param subscriptionId + @return ApiTransferSubscriptionRequest */ -func (a *DefaultApiService) GetPlayers(ctx context.Context) ApiGetPlayersRequest { - return ApiGetPlayersRequest{ +func (a *DefaultApiService) TransferSubscription(ctx context.Context, appId string, subscriptionId string) ApiTransferSubscriptionRequest { + return ApiTransferSubscriptionRequest{ ApiService: a, ctx: ctx, + appId: appId, + subscriptionId: subscriptionId, } } // Execute executes the request -// @return PlayerSlice -func (a *DefaultApiService) GetPlayersExecute(r ApiGetPlayersRequest) (*PlayerSlice, *http.Response, error) { +// @return UserIdentityResponse +func (a *DefaultApiService) TransferSubscriptionExecute(r ApiTransferSubscriptionRequest) (*UserIdentityResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PlayerSlice + localVarReturnValue *UserIdentityResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPlayers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TransferSubscription") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/players" + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}/owner" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.appId == nil { - return localVarReturnValue, nil, reportError("appId is required and must be specified") + if r.transferSubscriptionRequestBody == nil { + return localVarReturnValue, nil, reportError("transferSubscriptionRequestBody is required and must be specified") } - localVarQueryParams.Add("app_id", parameterToString(*r.appId, "")) - if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) - } - if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2319,6 +3695,8 @@ func (a *DefaultApiService) GetPlayersExecute(r ApiGetPlayersRequest) (*PlayerSl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.transferSubscriptionRequestBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2341,15 +3719,6 @@ func (a *DefaultApiService) GetPlayersExecute(r ApiGetPlayersRequest) (*PlayerSl body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2855,14 +4224,234 @@ func (a *DefaultApiService) UpdatePlayerTagsExecute(r ApiUpdatePlayerTagsRequest body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequestError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateSubscriptionRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + subscriptionId string + updateSubscriptionRequestBody *UpdateSubscriptionRequestBody +} + +func (r ApiUpdateSubscriptionRequest) UpdateSubscriptionRequestBody(updateSubscriptionRequestBody UpdateSubscriptionRequestBody) ApiUpdateSubscriptionRequest { + r.updateSubscriptionRequestBody = &updateSubscriptionRequestBody + return r +} + +func (r ApiUpdateSubscriptionRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateSubscriptionExecute(r) +} + +/* +UpdateSubscription Method for UpdateSubscription + +Updates an existing Subscription’s properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param subscriptionId + @return ApiUpdateSubscriptionRequest +*/ +func (a *DefaultApiService) UpdateSubscription(ctx context.Context, appId string, subscriptionId string) ApiUpdateSubscriptionRequest { + return ApiUpdateSubscriptionRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + subscriptionId: subscriptionId, + } +} + +// Execute executes the request +func (a *DefaultApiService) UpdateSubscriptionExecute(r ApiUpdateSubscriptionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateSubscription") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/subscriptions/{subscription_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"subscription_id"+"}", url.PathEscape(parameterToString(r.subscriptionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateSubscriptionRequestBody == nil { + return nil, reportError("updateSubscriptionRequestBody is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSubscriptionRequestBody + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUpdateUserRequest struct { + ctx context.Context + ApiService *DefaultApiService + appId string + aliasLabel string + aliasId string + updateUserRequest *UpdateUserRequest +} + +func (r ApiUpdateUserRequest) UpdateUserRequest(updateUserRequest UpdateUserRequest) ApiUpdateUserRequest { + r.updateUserRequest = &updateUserRequest + return r +} + +func (r ApiUpdateUserRequest) Execute() (*InlineResponse202, *http.Response, error) { + return r.ApiService.UpdateUserExecute(r) +} + +/* +UpdateUser Method for UpdateUser + +Updates an existing User’s properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId + @param aliasLabel + @param aliasId + @return ApiUpdateUserRequest +*/ +func (a *DefaultApiService) UpdateUser(ctx context.Context, appId string, aliasLabel string, aliasId string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + aliasLabel: aliasLabel, + aliasId: aliasId, + } +} + +// Execute executes the request +// @return InlineResponse202 +func (a *DefaultApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*InlineResponse202, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InlineResponse202 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/apps/{app_id}/users/by/{alias_label}/{alias_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_label"+"}", url.PathEscape(parameterToString(r.aliasLabel, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alias_id"+"}", url.PathEscape(parameterToString(r.aliasId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateUserRequest == nil { + return localVarReturnValue, nil, reportError("updateUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, } return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/client.go b/client.go index 4d501cd..66e8daf 100644 --- a/client.go +++ b/client.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -42,7 +42,7 @@ var ( xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) -// APIClient manages communication with the OneSignal API v1.0.2 +// APIClient manages communication with the OneSignal API v1.2.1 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -324,7 +324,7 @@ func (c *APIClient) prepareRequest( localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) // Add the SDK version to OS-Usage header for telemetry - localVarRequest.Header.Add("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-go, version=1.0.5") + localVarRequest.Header.Add("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-go, version=2.0.0") if ctx != nil { // add context to the request diff --git a/configuration.go b/configuration.go index ddbf387..a7dbe0d 100644 --- a/configuration.go +++ b/configuration.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -105,7 +105,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.5/go", + UserAgent: "OpenAPI-Generator/2.0.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/docs/App.md b/docs/App.md index 66d0deb..bfa067e 100644 --- a/docs/App.md +++ b/docs/App.md @@ -23,10 +23,10 @@ Name | Type | Description | Notes **SafariApnsCertificates** | Pointer to **string** | | [optional] [readonly] **SafariApnsP12** | Pointer to **string** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional] **SafariApnsP12Password** | Pointer to **string** | Safari: Password for safari_apns_p12 file | [optional] -**ApnsKeyId** | Pointer to **string** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional] -**ApnsTeamId** | Pointer to **string** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional] -**ApnsBundleId** | Pointer to **string** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional] -**ApnsP8** | Pointer to **string** | iOS: Required if using p8. Base64 encoded p8 key | [optional] +**ApnsKeyId** | Pointer to **NullableString** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional] +**ApnsTeamId** | Pointer to **NullableString** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional] +**ApnsBundleId** | Pointer to **NullableString** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional] +**ApnsP8** | Pointer to **NullableString** | iOS: Required if using p8. Base64 encoded p8 key | [optional] **SafariSiteOrigin** | Pointer to **NullableString** | Safari (Recommended): The hostname to your website including http(s):// | [optional] **SafariPushId** | Pointer to **NullableString** | | [optional] [readonly] **SafariIcon1616** | Pointer to **string** | | [optional] [readonly] @@ -35,7 +35,7 @@ Name | Type | Description | Notes **SafariIcon128128** | Pointer to **string** | | [optional] [readonly] **SafariIcon256256** | Pointer to **string** | Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide. | [optional] **SiteName** | Pointer to **NullableString** | All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. | [optional] -**BasicAuthKey** | Pointer to **string** | | [optional] [readonly] +**BasicAuthKey** | Pointer to **NullableString** | | [optional] [readonly] **OrganizationId** | Pointer to **string** | The Id of the Organization you would like to add this app to. | [optional] **AdditionalDataIsRootPayload** | Pointer to **bool** | iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload. | [optional] @@ -628,6 +628,16 @@ SetApnsKeyId sets ApnsKeyId field to given value. HasApnsKeyId returns a boolean if a field has been set. +### SetApnsKeyIdNil + +`func (o *App) SetApnsKeyIdNil(b bool)` + + SetApnsKeyIdNil sets the value for ApnsKeyId to be an explicit nil + +### UnsetApnsKeyId +`func (o *App) UnsetApnsKeyId()` + +UnsetApnsKeyId ensures that no value is present for ApnsKeyId, not even an explicit nil ### GetApnsTeamId `func (o *App) GetApnsTeamId() string` @@ -653,6 +663,16 @@ SetApnsTeamId sets ApnsTeamId field to given value. HasApnsTeamId returns a boolean if a field has been set. +### SetApnsTeamIdNil + +`func (o *App) SetApnsTeamIdNil(b bool)` + + SetApnsTeamIdNil sets the value for ApnsTeamId to be an explicit nil + +### UnsetApnsTeamId +`func (o *App) UnsetApnsTeamId()` + +UnsetApnsTeamId ensures that no value is present for ApnsTeamId, not even an explicit nil ### GetApnsBundleId `func (o *App) GetApnsBundleId() string` @@ -678,6 +698,16 @@ SetApnsBundleId sets ApnsBundleId field to given value. HasApnsBundleId returns a boolean if a field has been set. +### SetApnsBundleIdNil + +`func (o *App) SetApnsBundleIdNil(b bool)` + + SetApnsBundleIdNil sets the value for ApnsBundleId to be an explicit nil + +### UnsetApnsBundleId +`func (o *App) UnsetApnsBundleId()` + +UnsetApnsBundleId ensures that no value is present for ApnsBundleId, not even an explicit nil ### GetApnsP8 `func (o *App) GetApnsP8() string` @@ -703,6 +733,16 @@ SetApnsP8 sets ApnsP8 field to given value. HasApnsP8 returns a boolean if a field has been set. +### SetApnsP8Nil + +`func (o *App) SetApnsP8Nil(b bool)` + + SetApnsP8Nil sets the value for ApnsP8 to be an explicit nil + +### UnsetApnsP8 +`func (o *App) UnsetApnsP8()` + +UnsetApnsP8 ensures that no value is present for ApnsP8, not even an explicit nil ### GetSafariSiteOrigin `func (o *App) GetSafariSiteOrigin() string` @@ -958,6 +998,16 @@ SetBasicAuthKey sets BasicAuthKey field to given value. HasBasicAuthKey returns a boolean if a field has been set. +### SetBasicAuthKeyNil + +`func (o *App) SetBasicAuthKeyNil(b bool)` + + SetBasicAuthKeyNil sets the value for BasicAuthKey to be an explicit nil + +### UnsetBasicAuthKey +`func (o *App) UnsetBasicAuthKey()` + +UnsetBasicAuthKey ensures that no value is present for BasicAuthKey, not even an explicit nil ### GetOrganizationId `func (o *App) GetOrganizationId() string` diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index f875e01..ba6ba23 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **IncludeChromeRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeChromeWebRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeAndroidRegIds** | Pointer to **[]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] +**IncludeAliases** | Pointer to [**NullablePlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**TargetChannel** | Pointer to **string** | | [optional] **Id** | Pointer to **string** | | [optional] **Value** | Pointer to **int32** | | [optional] [readonly] **Name** | Pointer to **NullableString** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] @@ -32,7 +34,7 @@ Name | Type | Description | Notes **IsChrome** | Pointer to **NullableBool** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] **ChannelForExternalUserIds** | Pointer to **string** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] **AppId** | **string** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | -**ExternalId** | Pointer to **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] +**ExternalId** | Pointer to **NullableString** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] **Contents** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Headings** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Subtitle** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] @@ -445,6 +447,66 @@ SetIncludeAndroidRegIds sets IncludeAndroidRegIds field to given value. HasIncludeAndroidRegIds returns a boolean if a field has been set. +### GetIncludeAliases + +`func (o *BasicNotification) GetIncludeAliases() PlayerNotificationTargetIncludeAliases` + +GetIncludeAliases returns the IncludeAliases field if non-nil, zero value otherwise. + +### GetIncludeAliasesOk + +`func (o *BasicNotification) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool)` + +GetIncludeAliasesOk returns a tuple with the IncludeAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeAliases + +`func (o *BasicNotification) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases)` + +SetIncludeAliases sets IncludeAliases field to given value. + +### HasIncludeAliases + +`func (o *BasicNotification) HasIncludeAliases() bool` + +HasIncludeAliases returns a boolean if a field has been set. + +### SetIncludeAliasesNil + +`func (o *BasicNotification) SetIncludeAliasesNil(b bool)` + + SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil + +### UnsetIncludeAliases +`func (o *BasicNotification) UnsetIncludeAliases()` + +UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +### GetTargetChannel + +`func (o *BasicNotification) GetTargetChannel() string` + +GetTargetChannel returns the TargetChannel field if non-nil, zero value otherwise. + +### GetTargetChannelOk + +`func (o *BasicNotification) GetTargetChannelOk() (*string, bool)` + +GetTargetChannelOk returns a tuple with the TargetChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetChannel + +`func (o *BasicNotification) SetTargetChannel(v string)` + +SetTargetChannel sets TargetChannel field to given value. + +### HasTargetChannel + +`func (o *BasicNotification) HasTargetChannel() bool` + +HasTargetChannel returns a boolean if a field has been set. + ### GetId `func (o *BasicNotification) GetId() string` @@ -975,6 +1037,16 @@ SetExternalId sets ExternalId field to given value. HasExternalId returns a boolean if a field has been set. +### SetExternalIdNil + +`func (o *BasicNotification) SetExternalIdNil(b bool)` + + SetExternalIdNil sets the value for ExternalId to be an explicit nil + +### UnsetExternalId +`func (o *BasicNotification) UnsetExternalId()` + +UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil ### GetContents `func (o *BasicNotification) GetContents() StringMap` diff --git a/docs/BasicNotificationAllOf.md b/docs/BasicNotificationAllOf.md index 3c09802..29849dd 100644 --- a/docs/BasicNotificationAllOf.md +++ b/docs/BasicNotificationAllOf.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **IsChrome** | Pointer to **NullableBool** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] **ChannelForExternalUserIds** | Pointer to **string** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] **AppId** | Pointer to **string** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | [optional] -**ExternalId** | Pointer to **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] +**ExternalId** | Pointer to **NullableString** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] **Contents** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Headings** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Subtitle** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] @@ -648,6 +648,16 @@ SetExternalId sets ExternalId field to given value. HasExternalId returns a boolean if a field has been set. +### SetExternalIdNil + +`func (o *BasicNotificationAllOf) SetExternalIdNil(b bool)` + + SetExternalIdNil sets the value for ExternalId to be an explicit nil + +### UnsetExternalId +`func (o *BasicNotificationAllOf) UnsetExternalId()` + +UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil ### GetContents `func (o *BasicNotificationAllOf) GetContents() StringMap` diff --git a/docs/CreateNotificationSuccessResponse.md b/docs/CreateNotificationSuccessResponse.md index 7f11e0b..1aee9a5 100644 --- a/docs/CreateNotificationSuccessResponse.md +++ b/docs/CreateNotificationSuccessResponse.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | | -**Recipients** | **int32** | Estimated number of subscribers targetted by notification. | +**Id** | Pointer to **string** | | [optional] +**Recipients** | Pointer to **int32** | Estimated number of subscribers targetted by notification. | [optional] **ExternalId** | Pointer to **NullableString** | | [optional] **Errors** | Pointer to [**Notification200Errors**](Notification200Errors.md) | | [optional] @@ -13,7 +13,7 @@ Name | Type | Description | Notes ### NewCreateNotificationSuccessResponse -`func NewCreateNotificationSuccessResponse(id string, recipients int32, ) *CreateNotificationSuccessResponse` +`func NewCreateNotificationSuccessResponse() *CreateNotificationSuccessResponse` NewCreateNotificationSuccessResponse instantiates a new CreateNotificationSuccessResponse object This constructor will assign default values to properties that have it defined, @@ -47,6 +47,11 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. +### HasId + +`func (o *CreateNotificationSuccessResponse) HasId() bool` + +HasId returns a boolean if a field has been set. ### GetRecipients @@ -67,6 +72,11 @@ and a boolean to check if the value has been set. SetRecipients sets Recipients field to given value. +### HasRecipients + +`func (o *CreateNotificationSuccessResponse) HasRecipients() bool` + +HasRecipients returns a boolean if a field has been set. ### GetExternalId diff --git a/docs/CreateSubscriptionRequestBody.md b/docs/CreateSubscriptionRequestBody.md new file mode 100644 index 0000000..2d348b2 --- /dev/null +++ b/docs/CreateSubscriptionRequestBody.md @@ -0,0 +1,82 @@ +# CreateSubscriptionRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | Pointer to [**SubscriptionObject**](SubscriptionObject.md) | | [optional] +**RetainPreviousOwner** | Pointer to **bool** | | [optional] + +## Methods + +### NewCreateSubscriptionRequestBody + +`func NewCreateSubscriptionRequestBody() *CreateSubscriptionRequestBody` + +NewCreateSubscriptionRequestBody instantiates a new CreateSubscriptionRequestBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateSubscriptionRequestBodyWithDefaults + +`func NewCreateSubscriptionRequestBodyWithDefaults() *CreateSubscriptionRequestBody` + +NewCreateSubscriptionRequestBodyWithDefaults instantiates a new CreateSubscriptionRequestBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSubscription + +`func (o *CreateSubscriptionRequestBody) GetSubscription() SubscriptionObject` + +GetSubscription returns the Subscription field if non-nil, zero value otherwise. + +### GetSubscriptionOk + +`func (o *CreateSubscriptionRequestBody) GetSubscriptionOk() (*SubscriptionObject, bool)` + +GetSubscriptionOk returns a tuple with the Subscription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubscription + +`func (o *CreateSubscriptionRequestBody) SetSubscription(v SubscriptionObject)` + +SetSubscription sets Subscription field to given value. + +### HasSubscription + +`func (o *CreateSubscriptionRequestBody) HasSubscription() bool` + +HasSubscription returns a boolean if a field has been set. + +### GetRetainPreviousOwner + +`func (o *CreateSubscriptionRequestBody) GetRetainPreviousOwner() bool` + +GetRetainPreviousOwner returns the RetainPreviousOwner field if non-nil, zero value otherwise. + +### GetRetainPreviousOwnerOk + +`func (o *CreateSubscriptionRequestBody) GetRetainPreviousOwnerOk() (*bool, bool)` + +GetRetainPreviousOwnerOk returns a tuple with the RetainPreviousOwner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetainPreviousOwner + +`func (o *CreateSubscriptionRequestBody) SetRetainPreviousOwner(v bool)` + +SetRetainPreviousOwner sets RetainPreviousOwner field to given value. + +### HasRetainPreviousOwner + +`func (o *CreateSubscriptionRequestBody) HasRetainPreviousOwner() bool` + +HasRetainPreviousOwner returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserConflictResponse.md b/docs/CreateUserConflictResponse.md new file mode 100644 index 0000000..ed9b2db --- /dev/null +++ b/docs/CreateUserConflictResponse.md @@ -0,0 +1,56 @@ +# CreateUserConflictResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | Pointer to [**[]CreateUserConflictResponseErrorsInner**](CreateUserConflictResponseErrorsInner.md) | | [optional] + +## Methods + +### NewCreateUserConflictResponse + +`func NewCreateUserConflictResponse() *CreateUserConflictResponse` + +NewCreateUserConflictResponse instantiates a new CreateUserConflictResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateUserConflictResponseWithDefaults + +`func NewCreateUserConflictResponseWithDefaults() *CreateUserConflictResponse` + +NewCreateUserConflictResponseWithDefaults instantiates a new CreateUserConflictResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrors + +`func (o *CreateUserConflictResponse) GetErrors() []CreateUserConflictResponseErrorsInner` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *CreateUserConflictResponse) GetErrorsOk() (*[]CreateUserConflictResponseErrorsInner, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *CreateUserConflictResponse) SetErrors(v []CreateUserConflictResponseErrorsInner)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *CreateUserConflictResponse) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserConflictResponseErrorsInner.md b/docs/CreateUserConflictResponseErrorsInner.md new file mode 100644 index 0000000..2a6f245 --- /dev/null +++ b/docs/CreateUserConflictResponseErrorsInner.md @@ -0,0 +1,108 @@ +# CreateUserConflictResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Title** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**CreateUserConflictResponseErrorsItemsMeta**](CreateUserConflictResponseErrorsItemsMeta.md) | | [optional] + +## Methods + +### NewCreateUserConflictResponseErrorsInner + +`func NewCreateUserConflictResponseErrorsInner() *CreateUserConflictResponseErrorsInner` + +NewCreateUserConflictResponseErrorsInner instantiates a new CreateUserConflictResponseErrorsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateUserConflictResponseErrorsInnerWithDefaults + +`func NewCreateUserConflictResponseErrorsInnerWithDefaults() *CreateUserConflictResponseErrorsInner` + +NewCreateUserConflictResponseErrorsInnerWithDefaults instantiates a new CreateUserConflictResponseErrorsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *CreateUserConflictResponseErrorsInner) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *CreateUserConflictResponseErrorsInner) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *CreateUserConflictResponseErrorsInner) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *CreateUserConflictResponseErrorsInner) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetTitle + +`func (o *CreateUserConflictResponseErrorsInner) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *CreateUserConflictResponseErrorsInner) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *CreateUserConflictResponseErrorsInner) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *CreateUserConflictResponseErrorsInner) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### GetMeta + +`func (o *CreateUserConflictResponseErrorsInner) GetMeta() CreateUserConflictResponseErrorsItemsMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *CreateUserConflictResponseErrorsInner) GetMetaOk() (*CreateUserConflictResponseErrorsItemsMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *CreateUserConflictResponseErrorsInner) SetMeta(v CreateUserConflictResponseErrorsItemsMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *CreateUserConflictResponseErrorsInner) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserConflictResponseErrorsItemsMeta.md b/docs/CreateUserConflictResponseErrorsItemsMeta.md new file mode 100644 index 0000000..b7968c4 --- /dev/null +++ b/docs/CreateUserConflictResponseErrorsItemsMeta.md @@ -0,0 +1,56 @@ +# CreateUserConflictResponseErrorsItemsMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ConflictingAliases** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewCreateUserConflictResponseErrorsItemsMeta + +`func NewCreateUserConflictResponseErrorsItemsMeta() *CreateUserConflictResponseErrorsItemsMeta` + +NewCreateUserConflictResponseErrorsItemsMeta instantiates a new CreateUserConflictResponseErrorsItemsMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateUserConflictResponseErrorsItemsMetaWithDefaults + +`func NewCreateUserConflictResponseErrorsItemsMetaWithDefaults() *CreateUserConflictResponseErrorsItemsMeta` + +NewCreateUserConflictResponseErrorsItemsMetaWithDefaults instantiates a new CreateUserConflictResponseErrorsItemsMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetConflictingAliases + +`func (o *CreateUserConflictResponseErrorsItemsMeta) GetConflictingAliases() map[string]interface{}` + +GetConflictingAliases returns the ConflictingAliases field if non-nil, zero value otherwise. + +### GetConflictingAliasesOk + +`func (o *CreateUserConflictResponseErrorsItemsMeta) GetConflictingAliasesOk() (*map[string]interface{}, bool)` + +GetConflictingAliasesOk returns a tuple with the ConflictingAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConflictingAliases + +`func (o *CreateUserConflictResponseErrorsItemsMeta) SetConflictingAliases(v map[string]interface{})` + +SetConflictingAliases sets ConflictingAliases field to given value. + +### HasConflictingAliases + +`func (o *CreateUserConflictResponseErrorsItemsMeta) HasConflictingAliases() bool` + +HasConflictingAliases returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 0060911..81fa9f7 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -10,22 +10,36 @@ Method | HTTP request | Description [**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 +[**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 +[**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 [**ExportPlayers**](DefaultApi.md#ExportPlayers) | **Post** /players/csv_export?app_id={app_id} | CSV export +[**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 | [**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 | +[**TransferSubscription**](DefaultApi.md#TransferSubscription) | **Patch** /apps/{app_id}/subscriptions/{subscription_id}/owner | [**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} | @@ -474,11 +488,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeletePlayer +## CreateSubscription + +> InlineResponse201 CreateSubscription(ctx, appId, aliasLabel, aliasId).CreateSubscriptionRequestBody(createSubscriptionRequestBody).Execute() -> DeletePlayerSuccessResponse DeletePlayer(ctx, playerId).AppId(appId).Execute() -Delete a user record @@ -500,22 +514,24 @@ import ( ) func main() { - appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. - playerId := "playerId_example" // string | The OneSignal player_id + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | + createSubscriptionRequestBody := *onesignal.NewCreateSubscriptionRequestBody() // CreateSubscriptionRequestBody | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.DeletePlayer(appAuth, playerId).AppId(appId).Execute() + resp, r, err := apiClient.DefaultApi.CreateSubscription(appAuth, appId, aliasLabel, aliasId).CreateSubscriptionRequestBody(createSubscriptionRequestBody).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeletePlayer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateSubscription``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `DeletePlayer`: DeletePlayerSuccessResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeletePlayer`: %v\n", resp) + // response from `CreateSubscription`: InlineResponse201 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateSubscription`: %v\n", resp) } ``` @@ -525,25 +541,29 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**playerId** | **string** | The OneSignal player_id | +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiDeletePlayerRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateSubscriptionRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | + + **createSubscriptionRequestBody** | [**CreateSubscriptionRequestBody**](CreateSubscriptionRequestBody.md) | | + ### Return type -[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) +[**InlineResponse201**](InlineResponse201.md) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -551,11 +571,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteSegments +## CreateUser + +> User CreateUser(ctx, appId).User(user).Execute() -> DeleteSegmentSuccessResponse DeleteSegments(ctx, appId, segmentId).Execute() -Delete Segments @@ -577,22 +597,22 @@ import ( ) func main() { - appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. - segmentId := "segmentId_example" // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard. + appId := "appId_example" // string | + user := *onesignal.NewUser() // User | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.DeleteSegments(appAuth, appId, segmentId).Execute() + resp, r, err := apiClient.DefaultApi.CreateUser(appAuth, appId).User(user).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSegments``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `DeleteSegments`: DeleteSegmentSuccessResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeleteSegments`: %v\n", resp) + // response from `CreateUser`: User + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateUser`: %v\n", resp) } ``` @@ -602,26 +622,25 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | -**segmentId** | **string** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | +**appId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteSegmentsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **user** | [**User**](User.md) | | ### Return type -[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) +[**User**](User.md) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -629,11 +648,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## EndLiveActivity +## DeleteAlias + +> InlineResponse200 DeleteAlias(ctx, appId, aliasLabel, aliasId, aliasLabelToDelete).Execute() -> EndLiveActivity(ctx, appId, activityId, subscriptionId).Execute() -Stop Live Activity @@ -655,21 +674,24 @@ import ( ) func main() { - appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. - activityId := "activityId_example" // string | Live Activity record ID - subscriptionId := "subscriptionId_example" // string | Subscription ID + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | + aliasLabelToDelete := "aliasLabelToDelete_example" // string | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.EndLiveActivity(appAuth, appId, activityId, subscriptionId).Execute() + resp, r, err := apiClient.DefaultApi.DeleteAlias(appAuth, appId, aliasLabel, aliasId, aliasLabelToDelete).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.EndLiveActivity``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteAlias``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `DeleteAlias`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeleteAlias`: %v\n", resp) } ``` @@ -679,13 +701,14 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | -**activityId** | **string** | Live Activity record ID | -**subscriptionId** | **string** | Subscription ID | +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | +**aliasLabelToDelete** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiEndLiveActivityRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteAliasRequest struct via the builder pattern Name | Type | Description | Notes @@ -694,9 +717,10 @@ Name | Type | Description | Notes + ### Return type - (empty response body) +[**InlineResponse200**](InlineResponse200.md) ### HTTP request headers @@ -708,11 +732,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ExportPlayers +## DeletePlayer -> ExportPlayersSuccessResponse ExportPlayers(ctx, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute() +> DeletePlayerSuccessResponse DeletePlayer(ctx, playerId).AppId(appId).Execute() -CSV export +Delete a user record @@ -734,22 +758,22 @@ import ( ) func main() { - appId := "appId_example" // string | The app ID that you want to export devices from - exportPlayersRequestBody := *onesignal.NewExportPlayersRequestBody() // ExportPlayersRequestBody | (optional) + appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. + playerId := "playerId_example" // string | The OneSignal player_id configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.ExportPlayers(appAuth, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute() + resp, r, err := apiClient.DefaultApi.DeletePlayer(appAuth, playerId).AppId(appId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ExportPlayers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeletePlayer``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ExportPlayers`: ExportPlayersSuccessResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ExportPlayers`: %v\n", resp) + // response from `DeletePlayer`: DeletePlayerSuccessResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeletePlayer`: %v\n", resp) } ``` @@ -759,25 +783,25 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**appId** | **string** | The app ID that you want to export devices from | +**playerId** | **string** | The OneSignal player_id | ### Other Parameters -Other parameters are passed through a pointer to a apiExportPlayersRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeletePlayerRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | - **exportPlayersRequestBody** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | ### Return type -[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) +[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -785,17 +809,17 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetApp +## DeleteSegments -> App GetApp(ctx, appId).Execute() +> DeleteSegmentSuccessResponse DeleteSegments(ctx, appId, segmentId).Execute() -View an app +Delete Segments ### Authorization -[user_key](../README.md#user_key) +[app_key](../README.md#app_key) ### Example @@ -811,21 +835,22 @@ import ( ) func main() { - appId := "appId_example" // string | An app id + appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. + segmentId := "segmentId_example" // string | The segment_id can be found in the URL of the segment when viewing it in the dashboard. configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) - userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING") + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetApp(userAuth, appId).Execute() + resp, r, err := apiClient.DefaultApi.DeleteSegments(appAuth, appId, segmentId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSegments``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetApp`: App - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApp`: %v\n", resp) + // response from `DeleteSegments`: DeleteSegmentSuccessResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeleteSegments`: %v\n", resp) } ``` @@ -835,20 +860,22 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**appId** | **string** | An app id | +**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | +**segmentId** | **string** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | ### Other Parameters -Other parameters are passed through a pointer to a apiGetAppRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteSegmentsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + ### Return type -[**App**](App.md) +[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) ### HTTP request headers @@ -860,17 +887,17 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetApps +## DeleteSubscription + +> DeleteSubscription(ctx, appId, subscriptionId).Execute() -> []App GetApps(ctx).Execute() -View apps ### Authorization -[user_key](../README.md#user_key) +[app_key](../README.md#app_key) ### Example @@ -886,57 +913,67 @@ import ( ) func main() { + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) - userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING") + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetApps(userAuth).Execute() + resp, r, err := apiClient.DefaultApi.DeleteSubscription(appAuth, appId, subscriptionId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApps``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSubscription``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetApps`: []App - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApps`: %v\n", resp) } ``` ### Path Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**subscriptionId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiGetAppsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteSubscriptionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type -[**[]App**](App.md) + (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## GetNotification +## DeleteUser + +> DeleteUser(ctx, appId, aliasLabel, aliasId).Execute() -> NotificationWithMeta GetNotification(ctx, notificationId).AppId(appId).Execute() -View notification ### Authorization -[app_key](../README.md#app_key) +No authorization required ### Example @@ -953,21 +990,19 @@ import ( func main() { appId := "appId_example" // string | - notificationId := "notificationId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) - appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetNotification(appAuth, notificationId).AppId(appId).Execute() + resp, r, err := apiClient.DefaultApi.DeleteUser(, appId, aliasLabel, aliasId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotification``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetNotification`: NotificationWithMeta - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotification`: %v\n", resp) } ``` @@ -977,37 +1012,40 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**notificationId** | **string** | | +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiGetNotificationRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | **string** | | + + ### Return type -[**NotificationWithMeta**](NotificationWithMeta.md) + (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## GetNotificationHistory +## EndLiveActivity -> NotificationHistorySuccessResponse GetNotificationHistory(ctx, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute() +> EndLiveActivity(ctx, appId, activityId, subscriptionId).Execute() -Notification History +Stop Live Activity @@ -1029,22 +1067,21 @@ import ( ) func main() { - notificationId := "notificationId_example" // string | The \"id\" of the message found in the Notification object - getNotificationRequestBody := *onesignal.NewGetNotificationRequestBody() // GetNotificationRequestBody | + appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. + activityId := "activityId_example" // string | Live Activity record ID + subscriptionId := "subscriptionId_example" // string | Subscription ID configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetNotificationHistory(appAuth, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute() + resp, r, err := apiClient.DefaultApi.EndLiveActivity(appAuth, appId, activityId, subscriptionId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotificationHistory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.EndLiveActivity``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetNotificationHistory`: NotificationHistorySuccessResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotificationHistory`: %v\n", resp) } ``` @@ -1054,25 +1091,28 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**notificationId** | **string** | The \"id\" of the message found in the Notification object | +**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | +**activityId** | **string** | Live Activity record ID | +**subscriptionId** | **string** | Subscription ID | ### Other Parameters -Other parameters are passed through a pointer to a apiGetNotificationHistoryRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiEndLiveActivityRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **getNotificationRequestBody** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | + + ### Return type -[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) + (empty response body) ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -1080,11 +1120,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetNotifications +## ExportPlayers -> NotificationSlice GetNotifications(ctx).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute() +> ExportPlayersSuccessResponse ExportPlayers(ctx, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute() -View notifications +CSV export @@ -1106,50 +1146,50 @@ import ( ) func main() { - appId := "appId_example" // string | The app ID that you want to view notifications from - limit := int32(56) // int32 | How many notifications to return. Max is 50. Default is 50. (optional) - offset := int32(56) // int32 | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) - kind := int32(56) // int32 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + appId := "appId_example" // string | The app ID that you want to export devices from + exportPlayersRequestBody := *onesignal.NewExportPlayersRequestBody() // ExportPlayersRequestBody | (optional) configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetNotifications(appAuth).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute() + resp, r, err := apiClient.DefaultApi.ExportPlayers(appAuth, appId).ExportPlayersRequestBody(exportPlayersRequestBody).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotifications``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ExportPlayers``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetNotifications`: NotificationSlice - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotifications`: %v\n", resp) + // response from `ExportPlayers`: ExportPlayersSuccessResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ExportPlayers`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | The app ID that you want to export devices from | ### Other Parameters -Other parameters are passed through a pointer to a apiGetNotificationsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiExportPlayersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | **string** | The app ID that you want to view notifications from | - **limit** | **int32** | How many notifications to return. Max is 50. Default is 50. | - **offset** | **int32** | 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. | - **kind** | **int32** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | + + **exportPlayersRequestBody** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | ### Return type -[**NotificationSlice**](NotificationSlice.md) +[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -1157,11 +1197,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetOutcomes +## FetchAliases + +> UserIdentityResponse FetchAliases(ctx, appId, subscriptionId).Execute() -> OutcomesData GetOutcomes(ctx, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute() -View Outcomes @@ -1183,26 +1223,22 @@ import ( ) func main() { - appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. - outcomeNames := "outcomeNames_example" // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum - outcomeNames2 := "outcomeNames_example" // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) - outcomeTimeRange := "outcomeTimeRange_example" // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) - outcomePlatforms := "outcomePlatforms_example" // string | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) - outcomeAttribution := "outcomeAttribution_example" // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetOutcomes(appAuth, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute() + resp, r, err := apiClient.DefaultApi.FetchAliases(appAuth, appId, subscriptionId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetOutcomes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchAliases``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetOutcomes`: OutcomesData - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetOutcomes`: %v\n", resp) + // response from `FetchAliases`: UserIdentityResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchAliases`: %v\n", resp) } ``` @@ -1212,25 +1248,22 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | +**appId** | **string** | | +**subscriptionId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiGetOutcomesRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiFetchAliasesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outcomeNames** | **string** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | - **outcomeNames2** | **string** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | - **outcomeTimeRange** | **string** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | - **outcomePlatforms** | **string** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | - **outcomeAttribution** | **string** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | + ### Return type -[**OutcomesData**](OutcomesData.md) +[**UserIdentityResponse**](UserIdentityResponse.md) ### HTTP request headers @@ -1242,11 +1275,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetPlayer +## FetchUser + +> User FetchUser(ctx, appId, aliasLabel, aliasId).Execute() -> Player GetPlayer(ctx, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute() -View device @@ -1268,19 +1301,716 @@ import ( ) func main() { - appId := "appId_example" // string | Your app_id for this device - playerId := "playerId_example" // string | Player's OneSignal ID - emailAuthHash := "emailAuthHash_example" // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetPlayer(appAuth, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute() + resp, r, err := apiClient.DefaultApi.FetchUser(appAuth, appId, aliasLabel, aliasId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FetchUser`: User + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFetchUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**User**](User.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FetchUserIdentity + +> InlineResponse200 FetchUserIdentity(ctx, appId, aliasLabel, aliasId).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.FetchUserIdentity(appAuth, appId, aliasLabel, aliasId).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FetchUserIdentity``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FetchUserIdentity`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FetchUserIdentity`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFetchUserIdentityRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetApp + +> App GetApp(ctx, appId).Execute() + +View an app + + + +### Authorization + +[user_key](../README.md#user_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | An app id + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetApp(userAuth, appId).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetApp`: App + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApp`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | An app id | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAppRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**App**](App.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetApps + +> []App GetApps(ctx).Execute() + +View apps + + + +### Authorization + +[user_key](../README.md#user_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + userAuth := context.WithValue(context.Background(), onesignal.UserAuth, "USER_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetApps(userAuth).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetApps``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetApps`: []App + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetApps`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAppsRequest struct via the builder pattern + + +### Return type + +[**[]App**](App.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetEligibleIams + +> InlineResponse2003 GetEligibleIams(ctx, appId, subscriptionId).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetEligibleIams(appAuth, appId, subscriptionId).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetEligibleIams``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetEligibleIams`: InlineResponse2003 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetEligibleIams`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**subscriptionId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetEligibleIamsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetNotification + +> NotificationWithMeta GetNotification(ctx, notificationId).AppId(appId).Execute() + +View notification + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + notificationId := "notificationId_example" // string | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetNotification(appAuth, notificationId).AppId(appId).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotification``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetNotification`: NotificationWithMeta + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotification`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**notificationId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetNotificationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string** | | + + +### Return type + +[**NotificationWithMeta**](NotificationWithMeta.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetNotificationHistory + +> NotificationHistorySuccessResponse GetNotificationHistory(ctx, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute() + +Notification History + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + notificationId := "notificationId_example" // string | The \"id\" of the message found in the Notification object + getNotificationRequestBody := *onesignal.NewGetNotificationRequestBody() // GetNotificationRequestBody | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetNotificationHistory(appAuth, notificationId).GetNotificationRequestBody(getNotificationRequestBody).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotificationHistory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetNotificationHistory`: NotificationHistorySuccessResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotificationHistory`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**notificationId** | **string** | The \"id\" of the message found in the Notification object | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetNotificationHistoryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **getNotificationRequestBody** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | + +### Return type + +[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetNotifications + +> NotificationSlice GetNotifications(ctx).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute() + +View notifications + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | The app ID that you want to view notifications from + limit := int32(56) // int32 | How many notifications to return. Max is 50. Default is 50. (optional) + offset := int32(56) // int32 | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) + kind := int32(56) // int32 | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetNotifications(appAuth).AppId(appId).Limit(limit).Offset(offset).Kind(kind).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetNotifications``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetNotifications`: NotificationSlice + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetNotifications`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetNotificationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string** | The app ID that you want to view notifications from | + **limit** | **int32** | How many notifications to return. Max is 50. Default is 50. | + **offset** | **int32** | 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. | + **kind** | **int32** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | + +### Return type + +[**NotificationSlice**](NotificationSlice.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOutcomes + +> OutcomesData GetOutcomes(ctx, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute() + +View Outcomes + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | The OneSignal App ID for your app. Available in Keys & IDs. + outcomeNames := "outcomeNames_example" // string | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + outcomeNames2 := "outcomeNames_example" // string | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. (optional) + outcomeTimeRange := "outcomeTimeRange_example" // string | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. (optional) + outcomePlatforms := "outcomePlatforms_example" // string | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. (optional) + outcomeAttribution := "outcomeAttribution_example" // string | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. (optional) + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetOutcomes(appAuth, appId).OutcomeNames(outcomeNames).OutcomeNames2(outcomeNames2).OutcomeTimeRange(outcomeTimeRange).OutcomePlatforms(outcomePlatforms).OutcomeAttribution(outcomeAttribution).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetOutcomes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOutcomes`: OutcomesData + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetOutcomes`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | The OneSignal App ID for your app. Available in Keys & IDs. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOutcomesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **outcomeNames** | **string** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | + **outcomeNames2** | **string** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | + **outcomeTimeRange** | **string** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | + **outcomePlatforms** | **string** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | + **outcomeAttribution** | **string** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | + +### Return type + +[**OutcomesData**](OutcomesData.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPlayer + +> Player GetPlayer(ctx, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute() + +View device + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | Your app_id for this device + playerId := "playerId_example" // string | Player's OneSignal ID + emailAuthHash := "emailAuthHash_example" // string | Email - Only required if you have enabled Identity Verification and device_type is email (11). (optional) + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetPlayer(appAuth, playerId).AppId(appId).EmailAuthHash(emailAuthHash).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayer``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetPlayer`: Player @@ -1294,26 +2024,184 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**playerId** | **string** | Player's OneSignal ID | +**playerId** | **string** | Player's OneSignal ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPlayerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string** | Your app_id for this device | + + **emailAuthHash** | **string** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | + +### Return type + +[**Player**](Player.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPlayers + +> PlayerSlice GetPlayers(ctx).AppId(appId).Limit(limit).Offset(offset).Execute() + +View devices + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | The app ID that you want to view players from + limit := int32(56) // int32 | How many devices to return. Max is 300. Default is 300 (optional) + offset := int32(56) // int32 | Result offset. Default is 0. Results are sorted by id; (optional) + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.GetPlayers(appAuth).AppId(appId).Limit(limit).Offset(offset).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPlayers`: PlayerSlice + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPlayers`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPlayersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **string** | The app ID that you want to view players from | + **limit** | **int32** | How many devices to return. Max is 300. Default is 300 | + **offset** | **int32** | Result offset. Default is 0. Results are sorted by id; | + +### Return type + +[**PlayerSlice**](PlayerSlice.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## IdentifyUserByAlias + +> InlineResponse200 IdentifyUserByAlias(ctx, appId, aliasLabel, aliasId).UserIdentityRequestBody(userIdentityRequestBody).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | + userIdentityRequestBody := *onesignal.NewUserIdentityRequestBody() // UserIdentityRequestBody | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.IdentifyUserByAlias(appAuth, appId, aliasLabel, aliasId).UserIdentityRequestBody(userIdentityRequestBody).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.IdentifyUserByAlias``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IdentifyUserByAlias`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.IdentifyUserByAlias`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiGetPlayerRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiIdentifyUserByAliasRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | **string** | Your app_id for this device | - **emailAuthHash** | **string** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | + + + **userIdentityRequestBody** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | ### Return type -[**Player**](Player.md) +[**InlineResponse200**](InlineResponse200.md) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -1321,11 +2209,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetPlayers +## IdentifyUserBySubscriptionId + +> UserIdentityResponse IdentifyUserBySubscriptionId(ctx, appId, subscriptionId).UserIdentityRequestBody(userIdentityRequestBody).Execute() -> PlayerSlice GetPlayers(ctx).AppId(appId).Limit(limit).Offset(offset).Execute() -View devices @@ -1347,48 +2235,133 @@ import ( ) func main() { - appId := "appId_example" // string | The app ID that you want to view players from - limit := int32(56) // int32 | How many devices to return. Max is 300. Default is 300 (optional) - offset := int32(56) // int32 | Result offset. Default is 0. Results are sorted by id; (optional) + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | + userIdentityRequestBody := *onesignal.NewUserIdentityRequestBody() // UserIdentityRequestBody | configuration := onesignal.NewConfiguration() apiClient := onesignal.NewAPIClient(configuration) appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") - resp, r, err := apiClient.DefaultApi.GetPlayers(appAuth).AppId(appId).Limit(limit).Offset(offset).Execute() + resp, r, err := apiClient.DefaultApi.IdentifyUserBySubscriptionId(appAuth, appId, subscriptionId).UserIdentityRequestBody(userIdentityRequestBody).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPlayers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.IdentifyUserBySubscriptionId``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetPlayers`: PlayerSlice - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPlayers`: %v\n", resp) + // response from `IdentifyUserBySubscriptionId`: UserIdentityResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.IdentifyUserBySubscriptionId`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**subscriptionId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiGetPlayersRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiIdentifyUserBySubscriptionIdRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **appId** | **string** | The app ID that you want to view players from | - **limit** | **int32** | How many devices to return. Max is 300. Default is 300 | - **offset** | **int32** | Result offset. Default is 0. Results are sorted by id; | + + + **userIdentityRequestBody** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | ### Return type -[**PlayerSlice**](PlayerSlice.md) +[**UserIdentityResponse**](UserIdentityResponse.md) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TransferSubscription + +> UserIdentityResponse TransferSubscription(ctx, appId, subscriptionId).TransferSubscriptionRequestBody(transferSubscriptionRequestBody).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | + transferSubscriptionRequestBody := *onesignal.NewTransferSubscriptionRequestBody() // TransferSubscriptionRequestBody | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.TransferSubscription(appAuth, appId, subscriptionId).TransferSubscriptionRequestBody(transferSubscriptionRequestBody).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.TransferSubscription``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TransferSubscription`: UserIdentityResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.TransferSubscription`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**subscriptionId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTransferSubscriptionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **transferSubscriptionRequestBody** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | + +### Return type + +[**UserIdentityResponse**](UserIdentityResponse.md) + +### HTTP request headers + +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -1709,3 +2682,164 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## UpdateSubscription + +> UpdateSubscription(ctx, appId, subscriptionId).UpdateSubscriptionRequestBody(updateSubscriptionRequestBody).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + subscriptionId := "subscriptionId_example" // string | + updateSubscriptionRequestBody := *onesignal.NewUpdateSubscriptionRequestBody() // UpdateSubscriptionRequestBody | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.UpdateSubscription(appAuth, appId, subscriptionId).UpdateSubscriptionRequestBody(updateSubscriptionRequestBody).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateSubscription``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**subscriptionId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateSubscriptionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **updateSubscriptionRequestBody** | [**UpdateSubscriptionRequestBody**](UpdateSubscriptionRequestBody.md) | | + +### Return type + + (empty response body) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser + +> InlineResponse202 UpdateUser(ctx, appId, aliasLabel, aliasId).UpdateUserRequest(updateUserRequest).Execute() + + + + + +### Authorization + +[app_key](../README.md#app_key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/OneSignal/onesignal-go-api" +) + +func main() { + appId := "appId_example" // string | + aliasLabel := "aliasLabel_example" // string | + aliasId := "aliasId_example" // string | + updateUserRequest := *onesignal.NewUpdateUserRequest() // UpdateUserRequest | + + configuration := onesignal.NewConfiguration() + apiClient := onesignal.NewAPIClient(configuration) + + appAuth := context.WithValue(context.Background(), onesignal.AppAuth, "APP_KEY_STRING") + + resp, r, err := apiClient.DefaultApi.UpdateUser(appAuth, appId, aliasLabel, aliasId).UpdateUserRequest(updateUserRequest).Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateUser`: InlineResponse202 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**appId** | **string** | | +**aliasLabel** | **string** | | +**aliasId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **updateUserRequest** | [**UpdateUserRequest**](UpdateUserRequest.md) | | + +### Return type + +[**InlineResponse202**](InlineResponse202.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/IdentifyUserConflictResponse.md b/docs/IdentifyUserConflictResponse.md new file mode 100644 index 0000000..b2d7256 --- /dev/null +++ b/docs/IdentifyUserConflictResponse.md @@ -0,0 +1,56 @@ +# IdentifyUserConflictResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | Pointer to [**[]IdentifyUserConflictResponseErrorsInner**](IdentifyUserConflictResponseErrorsInner.md) | | [optional] + +## Methods + +### NewIdentifyUserConflictResponse + +`func NewIdentifyUserConflictResponse() *IdentifyUserConflictResponse` + +NewIdentifyUserConflictResponse instantiates a new IdentifyUserConflictResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIdentifyUserConflictResponseWithDefaults + +`func NewIdentifyUserConflictResponseWithDefaults() *IdentifyUserConflictResponse` + +NewIdentifyUserConflictResponseWithDefaults instantiates a new IdentifyUserConflictResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrors + +`func (o *IdentifyUserConflictResponse) GetErrors() []IdentifyUserConflictResponseErrorsInner` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *IdentifyUserConflictResponse) GetErrorsOk() (*[]IdentifyUserConflictResponseErrorsInner, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *IdentifyUserConflictResponse) SetErrors(v []IdentifyUserConflictResponseErrorsInner)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *IdentifyUserConflictResponse) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IdentifyUserConflictResponseErrorsInner.md b/docs/IdentifyUserConflictResponseErrorsInner.md new file mode 100644 index 0000000..6a67004 --- /dev/null +++ b/docs/IdentifyUserConflictResponseErrorsInner.md @@ -0,0 +1,82 @@ +# IdentifyUserConflictResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Title** | Pointer to **string** | | [optional] + +## Methods + +### NewIdentifyUserConflictResponseErrorsInner + +`func NewIdentifyUserConflictResponseErrorsInner() *IdentifyUserConflictResponseErrorsInner` + +NewIdentifyUserConflictResponseErrorsInner instantiates a new IdentifyUserConflictResponseErrorsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIdentifyUserConflictResponseErrorsInnerWithDefaults + +`func NewIdentifyUserConflictResponseErrorsInnerWithDefaults() *IdentifyUserConflictResponseErrorsInner` + +NewIdentifyUserConflictResponseErrorsInnerWithDefaults instantiates a new IdentifyUserConflictResponseErrorsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *IdentifyUserConflictResponseErrorsInner) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *IdentifyUserConflictResponseErrorsInner) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *IdentifyUserConflictResponseErrorsInner) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *IdentifyUserConflictResponseErrorsInner) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetTitle + +`func (o *IdentifyUserConflictResponseErrorsInner) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *IdentifyUserConflictResponseErrorsInner) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *IdentifyUserConflictResponseErrorsInner) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *IdentifyUserConflictResponseErrorsInner) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md new file mode 100644 index 0000000..d36bf82 --- /dev/null +++ b/docs/InlineResponse200.md @@ -0,0 +1,56 @@ +# InlineResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identity** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewInlineResponse200 + +`func NewInlineResponse200() *InlineResponse200` + +NewInlineResponse200 instantiates a new InlineResponse200 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse200WithDefaults + +`func NewInlineResponse200WithDefaults() *InlineResponse200` + +NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIdentity + +`func (o *InlineResponse200) GetIdentity() map[string]interface{}` + +GetIdentity returns the Identity field if non-nil, zero value otherwise. + +### GetIdentityOk + +`func (o *InlineResponse200) GetIdentityOk() (*map[string]interface{}, bool)` + +GetIdentityOk returns a tuple with the Identity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentity + +`func (o *InlineResponse200) SetIdentity(v map[string]interface{})` + +SetIdentity sets Identity field to given value. + +### HasIdentity + +`func (o *InlineResponse200) HasIdentity() bool` + +HasIdentity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md new file mode 100644 index 0000000..99ff378 --- /dev/null +++ b/docs/InlineResponse2003.md @@ -0,0 +1,56 @@ +# InlineResponse2003 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InAppMessages** | Pointer to **[]map[string]interface{}** | | [optional] + +## Methods + +### NewInlineResponse2003 + +`func NewInlineResponse2003() *InlineResponse2003` + +NewInlineResponse2003 instantiates a new InlineResponse2003 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse2003WithDefaults + +`func NewInlineResponse2003WithDefaults() *InlineResponse2003` + +NewInlineResponse2003WithDefaults instantiates a new InlineResponse2003 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInAppMessages + +`func (o *InlineResponse2003) GetInAppMessages() []map[string]interface{}` + +GetInAppMessages returns the InAppMessages field if non-nil, zero value otherwise. + +### GetInAppMessagesOk + +`func (o *InlineResponse2003) GetInAppMessagesOk() (*[]map[string]interface{}, bool)` + +GetInAppMessagesOk returns a tuple with the InAppMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInAppMessages + +`func (o *InlineResponse2003) SetInAppMessages(v []map[string]interface{})` + +SetInAppMessages sets InAppMessages field to given value. + +### HasInAppMessages + +`func (o *InlineResponse2003) HasInAppMessages() bool` + +HasInAppMessages returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md new file mode 100644 index 0000000..8180227 --- /dev/null +++ b/docs/InlineResponse201.md @@ -0,0 +1,56 @@ +# InlineResponse201 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | Pointer to [**SubscriptionObject**](SubscriptionObject.md) | | [optional] + +## Methods + +### NewInlineResponse201 + +`func NewInlineResponse201() *InlineResponse201` + +NewInlineResponse201 instantiates a new InlineResponse201 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse201WithDefaults + +`func NewInlineResponse201WithDefaults() *InlineResponse201` + +NewInlineResponse201WithDefaults instantiates a new InlineResponse201 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSubscription + +`func (o *InlineResponse201) GetSubscription() SubscriptionObject` + +GetSubscription returns the Subscription field if non-nil, zero value otherwise. + +### GetSubscriptionOk + +`func (o *InlineResponse201) GetSubscriptionOk() (*SubscriptionObject, bool)` + +GetSubscriptionOk returns a tuple with the Subscription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubscription + +`func (o *InlineResponse201) SetSubscription(v SubscriptionObject)` + +SetSubscription sets Subscription field to given value. + +### HasSubscription + +`func (o *InlineResponse201) HasSubscription() bool` + +HasSubscription returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse202.md b/docs/InlineResponse202.md new file mode 100644 index 0000000..232d751 --- /dev/null +++ b/docs/InlineResponse202.md @@ -0,0 +1,56 @@ +# InlineResponse202 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Properties** | Pointer to [**PropertiesObject**](PropertiesObject.md) | | [optional] + +## Methods + +### NewInlineResponse202 + +`func NewInlineResponse202() *InlineResponse202` + +NewInlineResponse202 instantiates a new InlineResponse202 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse202WithDefaults + +`func NewInlineResponse202WithDefaults() *InlineResponse202` + +NewInlineResponse202WithDefaults instantiates a new InlineResponse202 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProperties + +`func (o *InlineResponse202) GetProperties() PropertiesObject` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *InlineResponse202) GetPropertiesOk() (*PropertiesObject, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *InlineResponse202) SetProperties(v PropertiesObject)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *InlineResponse202) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Notification.md b/docs/Notification.md index 04aa0f4..13acd0f 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **IncludeChromeRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeChromeWebRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeAndroidRegIds** | Pointer to **[]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] +**IncludeAliases** | Pointer to [**NullablePlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**TargetChannel** | Pointer to **string** | | [optional] **Id** | Pointer to **string** | | [optional] **Value** | Pointer to **int32** | | [optional] [readonly] **Name** | Pointer to **NullableString** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] @@ -32,7 +34,7 @@ Name | Type | Description | Notes **IsChrome** | Pointer to **NullableBool** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] **ChannelForExternalUserIds** | Pointer to **string** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] **AppId** | **string** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | -**ExternalId** | Pointer to **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] +**ExternalId** | Pointer to **NullableString** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] **Contents** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Headings** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Subtitle** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] @@ -446,6 +448,66 @@ SetIncludeAndroidRegIds sets IncludeAndroidRegIds field to given value. HasIncludeAndroidRegIds returns a boolean if a field has been set. +### GetIncludeAliases + +`func (o *Notification) GetIncludeAliases() PlayerNotificationTargetIncludeAliases` + +GetIncludeAliases returns the IncludeAliases field if non-nil, zero value otherwise. + +### GetIncludeAliasesOk + +`func (o *Notification) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool)` + +GetIncludeAliasesOk returns a tuple with the IncludeAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeAliases + +`func (o *Notification) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases)` + +SetIncludeAliases sets IncludeAliases field to given value. + +### HasIncludeAliases + +`func (o *Notification) HasIncludeAliases() bool` + +HasIncludeAliases returns a boolean if a field has been set. + +### SetIncludeAliasesNil + +`func (o *Notification) SetIncludeAliasesNil(b bool)` + + SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil + +### UnsetIncludeAliases +`func (o *Notification) UnsetIncludeAliases()` + +UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +### GetTargetChannel + +`func (o *Notification) GetTargetChannel() string` + +GetTargetChannel returns the TargetChannel field if non-nil, zero value otherwise. + +### GetTargetChannelOk + +`func (o *Notification) GetTargetChannelOk() (*string, bool)` + +GetTargetChannelOk returns a tuple with the TargetChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetChannel + +`func (o *Notification) SetTargetChannel(v string)` + +SetTargetChannel sets TargetChannel field to given value. + +### HasTargetChannel + +`func (o *Notification) HasTargetChannel() bool` + +HasTargetChannel returns a boolean if a field has been set. + ### GetId `func (o *Notification) GetId() string` @@ -976,6 +1038,16 @@ SetExternalId sets ExternalId field to given value. HasExternalId returns a boolean if a field has been set. +### SetExternalIdNil + +`func (o *Notification) SetExternalIdNil(b bool)` + + SetExternalIdNil sets the value for ExternalId to be an explicit nil + +### UnsetExternalId +`func (o *Notification) UnsetExternalId()` + +UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil ### GetContents `func (o *Notification) GetContents() StringMap` diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index a1baf7f..57b818b 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **IncludeChromeRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeChromeWebRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeAndroidRegIds** | Pointer to **[]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] +**IncludeAliases** | Pointer to [**NullablePlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**TargetChannel** | Pointer to **string** | | [optional] ## Methods @@ -356,6 +358,66 @@ SetIncludeAndroidRegIds sets IncludeAndroidRegIds field to given value. HasIncludeAndroidRegIds returns a boolean if a field has been set. +### GetIncludeAliases + +`func (o *NotificationTarget) GetIncludeAliases() PlayerNotificationTargetIncludeAliases` + +GetIncludeAliases returns the IncludeAliases field if non-nil, zero value otherwise. + +### GetIncludeAliasesOk + +`func (o *NotificationTarget) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool)` + +GetIncludeAliasesOk returns a tuple with the IncludeAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeAliases + +`func (o *NotificationTarget) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases)` + +SetIncludeAliases sets IncludeAliases field to given value. + +### HasIncludeAliases + +`func (o *NotificationTarget) HasIncludeAliases() bool` + +HasIncludeAliases returns a boolean if a field has been set. + +### SetIncludeAliasesNil + +`func (o *NotificationTarget) SetIncludeAliasesNil(b bool)` + + SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil + +### UnsetIncludeAliases +`func (o *NotificationTarget) UnsetIncludeAliases()` + +UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +### GetTargetChannel + +`func (o *NotificationTarget) GetTargetChannel() string` + +GetTargetChannel returns the TargetChannel field if non-nil, zero value otherwise. + +### GetTargetChannelOk + +`func (o *NotificationTarget) GetTargetChannelOk() (*string, bool)` + +GetTargetChannelOk returns a tuple with the TargetChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetChannel + +`func (o *NotificationTarget) SetTargetChannel(v string)` + +SetTargetChannel sets TargetChannel field to given value. + +### HasTargetChannel + +`func (o *NotificationTarget) HasTargetChannel() bool` + +HasTargetChannel returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index 4cfe00a..1cb1981 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **IncludeChromeRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeChromeWebRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeAndroidRegIds** | Pointer to **[]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] +**IncludeAliases** | Pointer to [**NullablePlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**TargetChannel** | Pointer to **string** | | [optional] **Id** | Pointer to **string** | | [optional] **Value** | Pointer to **int32** | | [optional] [readonly] **Name** | Pointer to **NullableString** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] @@ -32,7 +34,7 @@ Name | Type | Description | Notes **IsChrome** | Pointer to **NullableBool** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] **ChannelForExternalUserIds** | Pointer to **string** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] **AppId** | **string** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | -**ExternalId** | Pointer to **string** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] +**ExternalId** | Pointer to **NullableString** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] **Contents** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Headings** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] **Subtitle** | Pointer to [**NullableStringMap**](StringMap.md) | | [optional] @@ -456,6 +458,66 @@ SetIncludeAndroidRegIds sets IncludeAndroidRegIds field to given value. HasIncludeAndroidRegIds returns a boolean if a field has been set. +### GetIncludeAliases + +`func (o *NotificationWithMeta) GetIncludeAliases() PlayerNotificationTargetIncludeAliases` + +GetIncludeAliases returns the IncludeAliases field if non-nil, zero value otherwise. + +### GetIncludeAliasesOk + +`func (o *NotificationWithMeta) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool)` + +GetIncludeAliasesOk returns a tuple with the IncludeAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeAliases + +`func (o *NotificationWithMeta) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases)` + +SetIncludeAliases sets IncludeAliases field to given value. + +### HasIncludeAliases + +`func (o *NotificationWithMeta) HasIncludeAliases() bool` + +HasIncludeAliases returns a boolean if a field has been set. + +### SetIncludeAliasesNil + +`func (o *NotificationWithMeta) SetIncludeAliasesNil(b bool)` + + SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil + +### UnsetIncludeAliases +`func (o *NotificationWithMeta) UnsetIncludeAliases()` + +UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +### GetTargetChannel + +`func (o *NotificationWithMeta) GetTargetChannel() string` + +GetTargetChannel returns the TargetChannel field if non-nil, zero value otherwise. + +### GetTargetChannelOk + +`func (o *NotificationWithMeta) GetTargetChannelOk() (*string, bool)` + +GetTargetChannelOk returns a tuple with the TargetChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetChannel + +`func (o *NotificationWithMeta) SetTargetChannel(v string)` + +SetTargetChannel sets TargetChannel field to given value. + +### HasTargetChannel + +`func (o *NotificationWithMeta) HasTargetChannel() bool` + +HasTargetChannel returns a boolean if a field has been set. + ### GetId `func (o *NotificationWithMeta) GetId() string` @@ -986,6 +1048,16 @@ SetExternalId sets ExternalId field to given value. HasExternalId returns a boolean if a field has been set. +### SetExternalIdNil + +`func (o *NotificationWithMeta) SetExternalIdNil(b bool)` + + SetExternalIdNil sets the value for ExternalId to be an explicit nil + +### UnsetExternalId +`func (o *NotificationWithMeta) UnsetExternalId()` + +UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil ### GetContents `func (o *NotificationWithMeta) GetContents() StringMap` diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md index ea6e492..a0ac6a1 100644 --- a/docs/PlayerNotificationTarget.md +++ b/docs/PlayerNotificationTarget.md @@ -14,6 +14,8 @@ Name | Type | Description | Notes **IncludeChromeRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeChromeWebRegIds** | Pointer to **[]string** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **IncludeAndroidRegIds** | Pointer to **[]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] +**IncludeAliases** | Pointer to [**NullablePlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] +**TargetChannel** | Pointer to **string** | | [optional] ## Methods @@ -304,6 +306,66 @@ SetIncludeAndroidRegIds sets IncludeAndroidRegIds field to given value. HasIncludeAndroidRegIds returns a boolean if a field has been set. +### GetIncludeAliases + +`func (o *PlayerNotificationTarget) GetIncludeAliases() PlayerNotificationTargetIncludeAliases` + +GetIncludeAliases returns the IncludeAliases field if non-nil, zero value otherwise. + +### GetIncludeAliasesOk + +`func (o *PlayerNotificationTarget) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool)` + +GetIncludeAliasesOk returns a tuple with the IncludeAliases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeAliases + +`func (o *PlayerNotificationTarget) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases)` + +SetIncludeAliases sets IncludeAliases field to given value. + +### HasIncludeAliases + +`func (o *PlayerNotificationTarget) HasIncludeAliases() bool` + +HasIncludeAliases returns a boolean if a field has been set. + +### SetIncludeAliasesNil + +`func (o *PlayerNotificationTarget) SetIncludeAliasesNil(b bool)` + + SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil + +### UnsetIncludeAliases +`func (o *PlayerNotificationTarget) UnsetIncludeAliases()` + +UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +### GetTargetChannel + +`func (o *PlayerNotificationTarget) GetTargetChannel() string` + +GetTargetChannel returns the TargetChannel field if non-nil, zero value otherwise. + +### GetTargetChannelOk + +`func (o *PlayerNotificationTarget) GetTargetChannelOk() (*string, bool)` + +GetTargetChannelOk returns a tuple with the TargetChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetChannel + +`func (o *PlayerNotificationTarget) SetTargetChannel(v string)` + +SetTargetChannel sets TargetChannel field to given value. + +### HasTargetChannel + +`func (o *PlayerNotificationTarget) HasTargetChannel() bool` + +HasTargetChannel returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PlayerNotificationTargetIncludeAliases.md b/docs/PlayerNotificationTargetIncludeAliases.md new file mode 100644 index 0000000..40a77d3 --- /dev/null +++ b/docs/PlayerNotificationTargetIncludeAliases.md @@ -0,0 +1,56 @@ +# PlayerNotificationTargetIncludeAliases + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AliasLabel** | Pointer to **[]string** | | [optional] + +## Methods + +### NewPlayerNotificationTargetIncludeAliases + +`func NewPlayerNotificationTargetIncludeAliases() *PlayerNotificationTargetIncludeAliases` + +NewPlayerNotificationTargetIncludeAliases instantiates a new PlayerNotificationTargetIncludeAliases object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlayerNotificationTargetIncludeAliasesWithDefaults + +`func NewPlayerNotificationTargetIncludeAliasesWithDefaults() *PlayerNotificationTargetIncludeAliases` + +NewPlayerNotificationTargetIncludeAliasesWithDefaults instantiates a new PlayerNotificationTargetIncludeAliases object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAliasLabel + +`func (o *PlayerNotificationTargetIncludeAliases) GetAliasLabel() []string` + +GetAliasLabel returns the AliasLabel field if non-nil, zero value otherwise. + +### GetAliasLabelOk + +`func (o *PlayerNotificationTargetIncludeAliases) GetAliasLabelOk() (*[]string, bool)` + +GetAliasLabelOk returns a tuple with the AliasLabel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAliasLabel + +`func (o *PlayerNotificationTargetIncludeAliases) SetAliasLabel(v []string)` + +SetAliasLabel sets AliasLabel field to given value. + +### HasAliasLabel + +`func (o *PlayerNotificationTargetIncludeAliases) HasAliasLabel() bool` + +HasAliasLabel returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PropertiesDeltas.md b/docs/PropertiesDeltas.md new file mode 100644 index 0000000..7552ace --- /dev/null +++ b/docs/PropertiesDeltas.md @@ -0,0 +1,108 @@ +# PropertiesDeltas + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SessionTime** | Pointer to **float32** | | [optional] +**SessionCount** | Pointer to **float32** | | [optional] +**Purchases** | Pointer to [**[]Purchase**](Purchase.md) | | [optional] + +## Methods + +### NewPropertiesDeltas + +`func NewPropertiesDeltas() *PropertiesDeltas` + +NewPropertiesDeltas instantiates a new PropertiesDeltas object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPropertiesDeltasWithDefaults + +`func NewPropertiesDeltasWithDefaults() *PropertiesDeltas` + +NewPropertiesDeltasWithDefaults instantiates a new PropertiesDeltas object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSessionTime + +`func (o *PropertiesDeltas) GetSessionTime() float32` + +GetSessionTime returns the SessionTime field if non-nil, zero value otherwise. + +### GetSessionTimeOk + +`func (o *PropertiesDeltas) GetSessionTimeOk() (*float32, bool)` + +GetSessionTimeOk returns a tuple with the SessionTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionTime + +`func (o *PropertiesDeltas) SetSessionTime(v float32)` + +SetSessionTime sets SessionTime field to given value. + +### HasSessionTime + +`func (o *PropertiesDeltas) HasSessionTime() bool` + +HasSessionTime returns a boolean if a field has been set. + +### GetSessionCount + +`func (o *PropertiesDeltas) GetSessionCount() float32` + +GetSessionCount returns the SessionCount field if non-nil, zero value otherwise. + +### GetSessionCountOk + +`func (o *PropertiesDeltas) GetSessionCountOk() (*float32, bool)` + +GetSessionCountOk returns a tuple with the SessionCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionCount + +`func (o *PropertiesDeltas) SetSessionCount(v float32)` + +SetSessionCount sets SessionCount field to given value. + +### HasSessionCount + +`func (o *PropertiesDeltas) HasSessionCount() bool` + +HasSessionCount returns a boolean if a field has been set. + +### GetPurchases + +`func (o *PropertiesDeltas) GetPurchases() []Purchase` + +GetPurchases returns the Purchases field if non-nil, zero value otherwise. + +### GetPurchasesOk + +`func (o *PropertiesDeltas) GetPurchasesOk() (*[]Purchase, bool)` + +GetPurchasesOk returns a tuple with the Purchases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchases + +`func (o *PropertiesDeltas) SetPurchases(v []Purchase)` + +SetPurchases sets Purchases field to given value. + +### HasPurchases + +`func (o *PropertiesDeltas) HasPurchases() bool` + +HasPurchases returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PropertiesObject.md b/docs/PropertiesObject.md new file mode 100644 index 0000000..ee56ad3 --- /dev/null +++ b/docs/PropertiesObject.md @@ -0,0 +1,316 @@ +# PropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Tags** | Pointer to **map[string]interface{}** | | [optional] +**Language** | Pointer to **string** | | [optional] +**TimezoneId** | Pointer to **string** | | [optional] +**Lat** | Pointer to **float32** | | [optional] +**Long** | Pointer to **float32** | | [optional] +**Country** | Pointer to **string** | | [optional] +**FirstActive** | Pointer to **float32** | | [optional] +**LastActive** | Pointer to **float32** | | [optional] +**AmountSpent** | Pointer to **float32** | | [optional] +**Purchases** | Pointer to [**[]Purchase**](Purchase.md) | | [optional] +**Ip** | Pointer to **string** | | [optional] + +## Methods + +### NewPropertiesObject + +`func NewPropertiesObject() *PropertiesObject` + +NewPropertiesObject instantiates a new PropertiesObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPropertiesObjectWithDefaults + +`func NewPropertiesObjectWithDefaults() *PropertiesObject` + +NewPropertiesObjectWithDefaults instantiates a new PropertiesObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTags + +`func (o *PropertiesObject) GetTags() map[string]interface{}` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *PropertiesObject) GetTagsOk() (*map[string]interface{}, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *PropertiesObject) SetTags(v map[string]interface{})` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *PropertiesObject) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetLanguage + +`func (o *PropertiesObject) GetLanguage() string` + +GetLanguage returns the Language field if non-nil, zero value otherwise. + +### GetLanguageOk + +`func (o *PropertiesObject) GetLanguageOk() (*string, bool)` + +GetLanguageOk returns a tuple with the Language field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguage + +`func (o *PropertiesObject) SetLanguage(v string)` + +SetLanguage sets Language field to given value. + +### HasLanguage + +`func (o *PropertiesObject) HasLanguage() bool` + +HasLanguage returns a boolean if a field has been set. + +### GetTimezoneId + +`func (o *PropertiesObject) GetTimezoneId() string` + +GetTimezoneId returns the TimezoneId field if non-nil, zero value otherwise. + +### GetTimezoneIdOk + +`func (o *PropertiesObject) GetTimezoneIdOk() (*string, bool)` + +GetTimezoneIdOk returns a tuple with the TimezoneId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezoneId + +`func (o *PropertiesObject) SetTimezoneId(v string)` + +SetTimezoneId sets TimezoneId field to given value. + +### HasTimezoneId + +`func (o *PropertiesObject) HasTimezoneId() bool` + +HasTimezoneId returns a boolean if a field has been set. + +### GetLat + +`func (o *PropertiesObject) GetLat() float32` + +GetLat returns the Lat field if non-nil, zero value otherwise. + +### GetLatOk + +`func (o *PropertiesObject) GetLatOk() (*float32, bool)` + +GetLatOk returns a tuple with the Lat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLat + +`func (o *PropertiesObject) SetLat(v float32)` + +SetLat sets Lat field to given value. + +### HasLat + +`func (o *PropertiesObject) HasLat() bool` + +HasLat returns a boolean if a field has been set. + +### GetLong + +`func (o *PropertiesObject) GetLong() float32` + +GetLong returns the Long field if non-nil, zero value otherwise. + +### GetLongOk + +`func (o *PropertiesObject) GetLongOk() (*float32, bool)` + +GetLongOk returns a tuple with the Long field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLong + +`func (o *PropertiesObject) SetLong(v float32)` + +SetLong sets Long field to given value. + +### HasLong + +`func (o *PropertiesObject) HasLong() bool` + +HasLong returns a boolean if a field has been set. + +### GetCountry + +`func (o *PropertiesObject) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PropertiesObject) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PropertiesObject) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PropertiesObject) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetFirstActive + +`func (o *PropertiesObject) GetFirstActive() float32` + +GetFirstActive returns the FirstActive field if non-nil, zero value otherwise. + +### GetFirstActiveOk + +`func (o *PropertiesObject) GetFirstActiveOk() (*float32, bool)` + +GetFirstActiveOk returns a tuple with the FirstActive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstActive + +`func (o *PropertiesObject) SetFirstActive(v float32)` + +SetFirstActive sets FirstActive field to given value. + +### HasFirstActive + +`func (o *PropertiesObject) HasFirstActive() bool` + +HasFirstActive returns a boolean if a field has been set. + +### GetLastActive + +`func (o *PropertiesObject) GetLastActive() float32` + +GetLastActive returns the LastActive field if non-nil, zero value otherwise. + +### GetLastActiveOk + +`func (o *PropertiesObject) GetLastActiveOk() (*float32, bool)` + +GetLastActiveOk returns a tuple with the LastActive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastActive + +`func (o *PropertiesObject) SetLastActive(v float32)` + +SetLastActive sets LastActive field to given value. + +### HasLastActive + +`func (o *PropertiesObject) HasLastActive() bool` + +HasLastActive returns a boolean if a field has been set. + +### GetAmountSpent + +`func (o *PropertiesObject) GetAmountSpent() float32` + +GetAmountSpent returns the AmountSpent field if non-nil, zero value otherwise. + +### GetAmountSpentOk + +`func (o *PropertiesObject) GetAmountSpentOk() (*float32, bool)` + +GetAmountSpentOk returns a tuple with the AmountSpent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountSpent + +`func (o *PropertiesObject) SetAmountSpent(v float32)` + +SetAmountSpent sets AmountSpent field to given value. + +### HasAmountSpent + +`func (o *PropertiesObject) HasAmountSpent() bool` + +HasAmountSpent returns a boolean if a field has been set. + +### GetPurchases + +`func (o *PropertiesObject) GetPurchases() []Purchase` + +GetPurchases returns the Purchases field if non-nil, zero value otherwise. + +### GetPurchasesOk + +`func (o *PropertiesObject) GetPurchasesOk() (*[]Purchase, bool)` + +GetPurchasesOk returns a tuple with the Purchases field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchases + +`func (o *PropertiesObject) SetPurchases(v []Purchase)` + +SetPurchases sets Purchases field to given value. + +### HasPurchases + +`func (o *PropertiesObject) HasPurchases() bool` + +HasPurchases returns a boolean if a field has been set. + +### GetIp + +`func (o *PropertiesObject) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *PropertiesObject) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *PropertiesObject) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *PropertiesObject) HasIp() bool` + +HasIp returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Purchase.md b/docs/Purchase.md index 381c782..6a3b8dd 100644 --- a/docs/Purchase.md +++ b/docs/Purchase.md @@ -5,14 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Sku** | **string** | The unique identifier of the purchased item. | -**Amount** | **float32** | The amount, in USD, spent purchasing the 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** | Pointer to **float32** | | [optional] ## Methods ### NewPurchase -`func NewPurchase(sku string, amount float32, iso string, ) *Purchase` +`func NewPurchase(sku string, amount string, iso string, ) *Purchase` NewPurchase instantiates a new Purchase object This constructor will assign default values to properties that have it defined, @@ -49,20 +50,20 @@ SetSku sets Sku field to given value. ### GetAmount -`func (o *Purchase) GetAmount() float32` +`func (o *Purchase) GetAmount() string` GetAmount returns the Amount field if non-nil, zero value otherwise. ### GetAmountOk -`func (o *Purchase) GetAmountOk() (*float32, bool)` +`func (o *Purchase) GetAmountOk() (*string, bool)` GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAmount -`func (o *Purchase) SetAmount(v float32)` +`func (o *Purchase) SetAmount(v string)` SetAmount sets Amount field to given value. @@ -87,6 +88,31 @@ and a boolean to check if the value has been set. SetIso sets Iso field to given value. +### GetCount + +`func (o *Purchase) GetCount() float32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *Purchase) GetCountOk() (*float32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *Purchase) SetCount(v float32)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *Purchase) HasCount() bool` + +HasCount returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SubscriptionObject.md b/docs/SubscriptionObject.md new file mode 100644 index 0000000..a32bf51 --- /dev/null +++ b/docs/SubscriptionObject.md @@ -0,0 +1,472 @@ +# SubscriptionObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Token** | Pointer to **string** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**NotificationTypes** | Pointer to **float32** | | [optional] +**SessionTime** | Pointer to **float32** | | [optional] +**SessionCount** | Pointer to **float32** | | [optional] +**Sdk** | Pointer to **string** | | [optional] +**DeviceModel** | Pointer to **string** | | [optional] +**DeviceOs** | Pointer to **string** | | [optional] +**Rooted** | Pointer to **bool** | | [optional] +**TestType** | Pointer to **float32** | | [optional] +**AppVersion** | Pointer to **string** | | [optional] +**NetType** | Pointer to **float32** | | [optional] +**Carrier** | Pointer to **string** | | [optional] +**WebAuth** | Pointer to **string** | | [optional] +**WebP256** | Pointer to **string** | | [optional] + +## Methods + +### NewSubscriptionObject + +`func NewSubscriptionObject() *SubscriptionObject` + +NewSubscriptionObject instantiates a new SubscriptionObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSubscriptionObjectWithDefaults + +`func NewSubscriptionObjectWithDefaults() *SubscriptionObject` + +NewSubscriptionObjectWithDefaults instantiates a new SubscriptionObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *SubscriptionObject) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SubscriptionObject) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SubscriptionObject) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SubscriptionObject) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetType + +`func (o *SubscriptionObject) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SubscriptionObject) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SubscriptionObject) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SubscriptionObject) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetToken + +`func (o *SubscriptionObject) GetToken() string` + +GetToken returns the Token field if non-nil, zero value otherwise. + +### GetTokenOk + +`func (o *SubscriptionObject) GetTokenOk() (*string, bool)` + +GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToken + +`func (o *SubscriptionObject) SetToken(v string)` + +SetToken sets Token field to given value. + +### HasToken + +`func (o *SubscriptionObject) HasToken() bool` + +HasToken returns a boolean if a field has been set. + +### GetEnabled + +`func (o *SubscriptionObject) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *SubscriptionObject) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *SubscriptionObject) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *SubscriptionObject) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetNotificationTypes + +`func (o *SubscriptionObject) GetNotificationTypes() float32` + +GetNotificationTypes returns the NotificationTypes field if non-nil, zero value otherwise. + +### GetNotificationTypesOk + +`func (o *SubscriptionObject) GetNotificationTypesOk() (*float32, bool)` + +GetNotificationTypesOk returns a tuple with the NotificationTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationTypes + +`func (o *SubscriptionObject) SetNotificationTypes(v float32)` + +SetNotificationTypes sets NotificationTypes field to given value. + +### HasNotificationTypes + +`func (o *SubscriptionObject) HasNotificationTypes() bool` + +HasNotificationTypes returns a boolean if a field has been set. + +### GetSessionTime + +`func (o *SubscriptionObject) GetSessionTime() float32` + +GetSessionTime returns the SessionTime field if non-nil, zero value otherwise. + +### GetSessionTimeOk + +`func (o *SubscriptionObject) GetSessionTimeOk() (*float32, bool)` + +GetSessionTimeOk returns a tuple with the SessionTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionTime + +`func (o *SubscriptionObject) SetSessionTime(v float32)` + +SetSessionTime sets SessionTime field to given value. + +### HasSessionTime + +`func (o *SubscriptionObject) HasSessionTime() bool` + +HasSessionTime returns a boolean if a field has been set. + +### GetSessionCount + +`func (o *SubscriptionObject) GetSessionCount() float32` + +GetSessionCount returns the SessionCount field if non-nil, zero value otherwise. + +### GetSessionCountOk + +`func (o *SubscriptionObject) GetSessionCountOk() (*float32, bool)` + +GetSessionCountOk returns a tuple with the SessionCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionCount + +`func (o *SubscriptionObject) SetSessionCount(v float32)` + +SetSessionCount sets SessionCount field to given value. + +### HasSessionCount + +`func (o *SubscriptionObject) HasSessionCount() bool` + +HasSessionCount returns a boolean if a field has been set. + +### GetSdk + +`func (o *SubscriptionObject) GetSdk() string` + +GetSdk returns the Sdk field if non-nil, zero value otherwise. + +### GetSdkOk + +`func (o *SubscriptionObject) GetSdkOk() (*string, bool)` + +GetSdkOk returns a tuple with the Sdk field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdk + +`func (o *SubscriptionObject) SetSdk(v string)` + +SetSdk sets Sdk field to given value. + +### HasSdk + +`func (o *SubscriptionObject) HasSdk() bool` + +HasSdk returns a boolean if a field has been set. + +### GetDeviceModel + +`func (o *SubscriptionObject) GetDeviceModel() string` + +GetDeviceModel returns the DeviceModel field if non-nil, zero value otherwise. + +### GetDeviceModelOk + +`func (o *SubscriptionObject) GetDeviceModelOk() (*string, bool)` + +GetDeviceModelOk returns a tuple with the DeviceModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceModel + +`func (o *SubscriptionObject) SetDeviceModel(v string)` + +SetDeviceModel sets DeviceModel field to given value. + +### HasDeviceModel + +`func (o *SubscriptionObject) HasDeviceModel() bool` + +HasDeviceModel returns a boolean if a field has been set. + +### GetDeviceOs + +`func (o *SubscriptionObject) GetDeviceOs() string` + +GetDeviceOs returns the DeviceOs field if non-nil, zero value otherwise. + +### GetDeviceOsOk + +`func (o *SubscriptionObject) GetDeviceOsOk() (*string, bool)` + +GetDeviceOsOk returns a tuple with the DeviceOs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceOs + +`func (o *SubscriptionObject) SetDeviceOs(v string)` + +SetDeviceOs sets DeviceOs field to given value. + +### HasDeviceOs + +`func (o *SubscriptionObject) HasDeviceOs() bool` + +HasDeviceOs returns a boolean if a field has been set. + +### GetRooted + +`func (o *SubscriptionObject) GetRooted() bool` + +GetRooted returns the Rooted field if non-nil, zero value otherwise. + +### GetRootedOk + +`func (o *SubscriptionObject) GetRootedOk() (*bool, bool)` + +GetRootedOk returns a tuple with the Rooted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRooted + +`func (o *SubscriptionObject) SetRooted(v bool)` + +SetRooted sets Rooted field to given value. + +### HasRooted + +`func (o *SubscriptionObject) HasRooted() bool` + +HasRooted returns a boolean if a field has been set. + +### GetTestType + +`func (o *SubscriptionObject) GetTestType() float32` + +GetTestType returns the TestType field if non-nil, zero value otherwise. + +### GetTestTypeOk + +`func (o *SubscriptionObject) GetTestTypeOk() (*float32, bool)` + +GetTestTypeOk returns a tuple with the TestType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTestType + +`func (o *SubscriptionObject) SetTestType(v float32)` + +SetTestType sets TestType field to given value. + +### HasTestType + +`func (o *SubscriptionObject) HasTestType() bool` + +HasTestType returns a boolean if a field has been set. + +### GetAppVersion + +`func (o *SubscriptionObject) GetAppVersion() string` + +GetAppVersion returns the AppVersion field if non-nil, zero value otherwise. + +### GetAppVersionOk + +`func (o *SubscriptionObject) GetAppVersionOk() (*string, bool)` + +GetAppVersionOk returns a tuple with the AppVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAppVersion + +`func (o *SubscriptionObject) SetAppVersion(v string)` + +SetAppVersion sets AppVersion field to given value. + +### HasAppVersion + +`func (o *SubscriptionObject) HasAppVersion() bool` + +HasAppVersion returns a boolean if a field has been set. + +### GetNetType + +`func (o *SubscriptionObject) GetNetType() float32` + +GetNetType returns the NetType field if non-nil, zero value otherwise. + +### GetNetTypeOk + +`func (o *SubscriptionObject) GetNetTypeOk() (*float32, bool)` + +GetNetTypeOk returns a tuple with the NetType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetType + +`func (o *SubscriptionObject) SetNetType(v float32)` + +SetNetType sets NetType field to given value. + +### HasNetType + +`func (o *SubscriptionObject) HasNetType() bool` + +HasNetType returns a boolean if a field has been set. + +### GetCarrier + +`func (o *SubscriptionObject) GetCarrier() string` + +GetCarrier returns the Carrier field if non-nil, zero value otherwise. + +### GetCarrierOk + +`func (o *SubscriptionObject) GetCarrierOk() (*string, bool)` + +GetCarrierOk returns a tuple with the Carrier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCarrier + +`func (o *SubscriptionObject) SetCarrier(v string)` + +SetCarrier sets Carrier field to given value. + +### HasCarrier + +`func (o *SubscriptionObject) HasCarrier() bool` + +HasCarrier returns a boolean if a field has been set. + +### GetWebAuth + +`func (o *SubscriptionObject) GetWebAuth() string` + +GetWebAuth returns the WebAuth field if non-nil, zero value otherwise. + +### GetWebAuthOk + +`func (o *SubscriptionObject) GetWebAuthOk() (*string, bool)` + +GetWebAuthOk returns a tuple with the WebAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebAuth + +`func (o *SubscriptionObject) SetWebAuth(v string)` + +SetWebAuth sets WebAuth field to given value. + +### HasWebAuth + +`func (o *SubscriptionObject) HasWebAuth() bool` + +HasWebAuth returns a boolean if a field has been set. + +### GetWebP256 + +`func (o *SubscriptionObject) GetWebP256() string` + +GetWebP256 returns the WebP256 field if non-nil, zero value otherwise. + +### GetWebP256Ok + +`func (o *SubscriptionObject) GetWebP256Ok() (*string, bool)` + +GetWebP256Ok returns a tuple with the WebP256 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebP256 + +`func (o *SubscriptionObject) SetWebP256(v string)` + +SetWebP256 sets WebP256 field to given value. + +### HasWebP256 + +`func (o *SubscriptionObject) HasWebP256() bool` + +HasWebP256 returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransferSubscriptionRequestBody.md b/docs/TransferSubscriptionRequestBody.md new file mode 100644 index 0000000..e03c326 --- /dev/null +++ b/docs/TransferSubscriptionRequestBody.md @@ -0,0 +1,56 @@ +# TransferSubscriptionRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identity** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewTransferSubscriptionRequestBody + +`func NewTransferSubscriptionRequestBody() *TransferSubscriptionRequestBody` + +NewTransferSubscriptionRequestBody instantiates a new TransferSubscriptionRequestBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransferSubscriptionRequestBodyWithDefaults + +`func NewTransferSubscriptionRequestBodyWithDefaults() *TransferSubscriptionRequestBody` + +NewTransferSubscriptionRequestBodyWithDefaults instantiates a new TransferSubscriptionRequestBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIdentity + +`func (o *TransferSubscriptionRequestBody) GetIdentity() map[string]interface{}` + +GetIdentity returns the Identity field if non-nil, zero value otherwise. + +### GetIdentityOk + +`func (o *TransferSubscriptionRequestBody) GetIdentityOk() (*map[string]interface{}, bool)` + +GetIdentityOk returns a tuple with the Identity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentity + +`func (o *TransferSubscriptionRequestBody) SetIdentity(v map[string]interface{})` + +SetIdentity sets Identity field to given value. + +### HasIdentity + +`func (o *TransferSubscriptionRequestBody) HasIdentity() bool` + +HasIdentity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateSubscriptionRequestBody.md b/docs/UpdateSubscriptionRequestBody.md new file mode 100644 index 0000000..b1c452a --- /dev/null +++ b/docs/UpdateSubscriptionRequestBody.md @@ -0,0 +1,56 @@ +# UpdateSubscriptionRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subscription** | Pointer to [**SubscriptionObject**](SubscriptionObject.md) | | [optional] + +## Methods + +### NewUpdateSubscriptionRequestBody + +`func NewUpdateSubscriptionRequestBody() *UpdateSubscriptionRequestBody` + +NewUpdateSubscriptionRequestBody instantiates a new UpdateSubscriptionRequestBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateSubscriptionRequestBodyWithDefaults + +`func NewUpdateSubscriptionRequestBodyWithDefaults() *UpdateSubscriptionRequestBody` + +NewUpdateSubscriptionRequestBodyWithDefaults instantiates a new UpdateSubscriptionRequestBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSubscription + +`func (o *UpdateSubscriptionRequestBody) GetSubscription() SubscriptionObject` + +GetSubscription returns the Subscription field if non-nil, zero value otherwise. + +### GetSubscriptionOk + +`func (o *UpdateSubscriptionRequestBody) GetSubscriptionOk() (*SubscriptionObject, bool)` + +GetSubscriptionOk returns a tuple with the Subscription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubscription + +`func (o *UpdateSubscriptionRequestBody) SetSubscription(v SubscriptionObject)` + +SetSubscription sets Subscription field to given value. + +### HasSubscription + +`func (o *UpdateSubscriptionRequestBody) HasSubscription() bool` + +HasSubscription returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateUserRequest.md b/docs/UpdateUserRequest.md new file mode 100644 index 0000000..1a5ebb1 --- /dev/null +++ b/docs/UpdateUserRequest.md @@ -0,0 +1,108 @@ +# UpdateUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Properties** | Pointer to [**PropertiesObject**](PropertiesObject.md) | | [optional] +**RefreshDeviceMetadata** | Pointer to **bool** | | [optional] [default to false] +**Deltas** | Pointer to [**PropertiesDeltas**](PropertiesDeltas.md) | | [optional] + +## Methods + +### NewUpdateUserRequest + +`func NewUpdateUserRequest() *UpdateUserRequest` + +NewUpdateUserRequest instantiates a new UpdateUserRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateUserRequestWithDefaults + +`func NewUpdateUserRequestWithDefaults() *UpdateUserRequest` + +NewUpdateUserRequestWithDefaults instantiates a new UpdateUserRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProperties + +`func (o *UpdateUserRequest) GetProperties() PropertiesObject` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *UpdateUserRequest) GetPropertiesOk() (*PropertiesObject, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *UpdateUserRequest) SetProperties(v PropertiesObject)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *UpdateUserRequest) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + +### GetRefreshDeviceMetadata + +`func (o *UpdateUserRequest) GetRefreshDeviceMetadata() bool` + +GetRefreshDeviceMetadata returns the RefreshDeviceMetadata field if non-nil, zero value otherwise. + +### GetRefreshDeviceMetadataOk + +`func (o *UpdateUserRequest) GetRefreshDeviceMetadataOk() (*bool, bool)` + +GetRefreshDeviceMetadataOk returns a tuple with the RefreshDeviceMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRefreshDeviceMetadata + +`func (o *UpdateUserRequest) SetRefreshDeviceMetadata(v bool)` + +SetRefreshDeviceMetadata sets RefreshDeviceMetadata field to given value. + +### HasRefreshDeviceMetadata + +`func (o *UpdateUserRequest) HasRefreshDeviceMetadata() bool` + +HasRefreshDeviceMetadata returns a boolean if a field has been set. + +### GetDeltas + +`func (o *UpdateUserRequest) GetDeltas() PropertiesDeltas` + +GetDeltas returns the Deltas field if non-nil, zero value otherwise. + +### GetDeltasOk + +`func (o *UpdateUserRequest) GetDeltasOk() (*PropertiesDeltas, bool)` + +GetDeltasOk returns a tuple with the Deltas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeltas + +`func (o *UpdateUserRequest) SetDeltas(v PropertiesDeltas)` + +SetDeltas sets Deltas field to given value. + +### HasDeltas + +`func (o *UpdateUserRequest) HasDeltas() bool` + +HasDeltas returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 0000000..7149f71 --- /dev/null +++ b/docs/User.md @@ -0,0 +1,134 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Properties** | Pointer to [**PropertiesObject**](PropertiesObject.md) | | [optional] +**Identity** | Pointer to **map[string]interface{}** | | [optional] +**Subscriptions** | Pointer to [**[]SubscriptionObject**](SubscriptionObject.md) | | [optional] +**SubscriptionOptions** | Pointer to [**UserSubscriptionOptions**](UserSubscriptionOptions.md) | | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProperties + +`func (o *User) GetProperties() PropertiesObject` + +GetProperties returns the Properties field if non-nil, zero value otherwise. + +### GetPropertiesOk + +`func (o *User) GetPropertiesOk() (*PropertiesObject, bool)` + +GetPropertiesOk returns a tuple with the Properties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperties + +`func (o *User) SetProperties(v PropertiesObject)` + +SetProperties sets Properties field to given value. + +### HasProperties + +`func (o *User) HasProperties() bool` + +HasProperties returns a boolean if a field has been set. + +### GetIdentity + +`func (o *User) GetIdentity() map[string]interface{}` + +GetIdentity returns the Identity field if non-nil, zero value otherwise. + +### GetIdentityOk + +`func (o *User) GetIdentityOk() (*map[string]interface{}, bool)` + +GetIdentityOk returns a tuple with the Identity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentity + +`func (o *User) SetIdentity(v map[string]interface{})` + +SetIdentity sets Identity field to given value. + +### HasIdentity + +`func (o *User) HasIdentity() bool` + +HasIdentity returns a boolean if a field has been set. + +### GetSubscriptions + +`func (o *User) GetSubscriptions() []SubscriptionObject` + +GetSubscriptions returns the Subscriptions field if non-nil, zero value otherwise. + +### GetSubscriptionsOk + +`func (o *User) GetSubscriptionsOk() (*[]SubscriptionObject, bool)` + +GetSubscriptionsOk returns a tuple with the Subscriptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubscriptions + +`func (o *User) SetSubscriptions(v []SubscriptionObject)` + +SetSubscriptions sets Subscriptions field to given value. + +### HasSubscriptions + +`func (o *User) HasSubscriptions() bool` + +HasSubscriptions returns a boolean if a field has been set. + +### GetSubscriptionOptions + +`func (o *User) GetSubscriptionOptions() UserSubscriptionOptions` + +GetSubscriptionOptions returns the SubscriptionOptions field if non-nil, zero value otherwise. + +### GetSubscriptionOptionsOk + +`func (o *User) GetSubscriptionOptionsOk() (*UserSubscriptionOptions, bool)` + +GetSubscriptionOptionsOk returns a tuple with the SubscriptionOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubscriptionOptions + +`func (o *User) SetSubscriptionOptions(v UserSubscriptionOptions)` + +SetSubscriptionOptions sets SubscriptionOptions field to given value. + +### HasSubscriptionOptions + +`func (o *User) HasSubscriptionOptions() bool` + +HasSubscriptionOptions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserIdentityRequestBody.md b/docs/UserIdentityRequestBody.md new file mode 100644 index 0000000..8a9a8d6 --- /dev/null +++ b/docs/UserIdentityRequestBody.md @@ -0,0 +1,56 @@ +# UserIdentityRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identity** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewUserIdentityRequestBody + +`func NewUserIdentityRequestBody() *UserIdentityRequestBody` + +NewUserIdentityRequestBody instantiates a new UserIdentityRequestBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserIdentityRequestBodyWithDefaults + +`func NewUserIdentityRequestBodyWithDefaults() *UserIdentityRequestBody` + +NewUserIdentityRequestBodyWithDefaults instantiates a new UserIdentityRequestBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIdentity + +`func (o *UserIdentityRequestBody) GetIdentity() map[string]interface{}` + +GetIdentity returns the Identity field if non-nil, zero value otherwise. + +### GetIdentityOk + +`func (o *UserIdentityRequestBody) GetIdentityOk() (*map[string]interface{}, bool)` + +GetIdentityOk returns a tuple with the Identity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentity + +`func (o *UserIdentityRequestBody) SetIdentity(v map[string]interface{})` + +SetIdentity sets Identity field to given value. + +### HasIdentity + +`func (o *UserIdentityRequestBody) HasIdentity() bool` + +HasIdentity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserIdentityResponse.md b/docs/UserIdentityResponse.md new file mode 100644 index 0000000..54203fe --- /dev/null +++ b/docs/UserIdentityResponse.md @@ -0,0 +1,56 @@ +# UserIdentityResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identity** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewUserIdentityResponse + +`func NewUserIdentityResponse() *UserIdentityResponse` + +NewUserIdentityResponse instantiates a new UserIdentityResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserIdentityResponseWithDefaults + +`func NewUserIdentityResponseWithDefaults() *UserIdentityResponse` + +NewUserIdentityResponseWithDefaults instantiates a new UserIdentityResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIdentity + +`func (o *UserIdentityResponse) GetIdentity() map[string]interface{}` + +GetIdentity returns the Identity field if non-nil, zero value otherwise. + +### GetIdentityOk + +`func (o *UserIdentityResponse) GetIdentityOk() (*map[string]interface{}, bool)` + +GetIdentityOk returns a tuple with the Identity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentity + +`func (o *UserIdentityResponse) SetIdentity(v map[string]interface{})` + +SetIdentity sets Identity field to given value. + +### HasIdentity + +`func (o *UserIdentityResponse) HasIdentity() bool` + +HasIdentity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserSubscriptionOptions.md b/docs/UserSubscriptionOptions.md new file mode 100644 index 0000000..453a153 --- /dev/null +++ b/docs/UserSubscriptionOptions.md @@ -0,0 +1,56 @@ +# UserSubscriptionOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RetainPreviousOwner** | Pointer to **bool** | | [optional] + +## Methods + +### NewUserSubscriptionOptions + +`func NewUserSubscriptionOptions() *UserSubscriptionOptions` + +NewUserSubscriptionOptions instantiates a new UserSubscriptionOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserSubscriptionOptionsWithDefaults + +`func NewUserSubscriptionOptionsWithDefaults() *UserSubscriptionOptions` + +NewUserSubscriptionOptionsWithDefaults instantiates a new UserSubscriptionOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRetainPreviousOwner + +`func (o *UserSubscriptionOptions) GetRetainPreviousOwner() bool` + +GetRetainPreviousOwner returns the RetainPreviousOwner field if non-nil, zero value otherwise. + +### GetRetainPreviousOwnerOk + +`func (o *UserSubscriptionOptions) GetRetainPreviousOwnerOk() (*bool, bool)` + +GetRetainPreviousOwnerOk returns a tuple with the RetainPreviousOwner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetainPreviousOwner + +`func (o *UserSubscriptionOptions) SetRetainPreviousOwner(v bool)` + +SetRetainPreviousOwner sets RetainPreviousOwner field to given value. + +### HasRetainPreviousOwner + +`func (o *UserSubscriptionOptions) HasRetainPreviousOwner() bool` + +HasRetainPreviousOwner returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/model_app.go b/model_app.go index 58ee7e9..6614d89 100644 --- a/model_app.go +++ b/model_app.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -50,13 +50,13 @@ type App struct { // Safari: Password for safari_apns_p12 file SafariApnsP12Password *string `json:"safari_apns_p12_password,omitempty"` // iOS: Required if using p8. Unique identifier for the p8 authentication key. - ApnsKeyId *string `json:"apns_key_id,omitempty"` + ApnsKeyId NullableString `json:"apns_key_id,omitempty"` // iOS: Required if using p8. Team ID generated by Apple for your developer account. - ApnsTeamId *string `json:"apns_team_id,omitempty"` + ApnsTeamId NullableString `json:"apns_team_id,omitempty"` // iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. - ApnsBundleId *string `json:"apns_bundle_id,omitempty"` + ApnsBundleId NullableString `json:"apns_bundle_id,omitempty"` // iOS: Required if using p8. Base64 encoded p8 key - ApnsP8 *string `json:"apns_p8,omitempty"` + ApnsP8 NullableString `json:"apns_p8,omitempty"` // Safari (Recommended): The hostname to your website including http(s):// SafariSiteOrigin NullableString `json:"safari_site_origin,omitempty"` SafariPushId NullableString `json:"safari_push_id,omitempty"` @@ -68,7 +68,7 @@ type App struct { SafariIcon256256 *string `json:"safari_icon_256_256,omitempty"` // All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. SiteName NullableString `json:"site_name,omitempty"` - BasicAuthKey *string `json:"basic_auth_key,omitempty"` + BasicAuthKey NullableString `json:"basic_auth_key,omitempty"` // The Id of the Organization you would like to add this app to. OrganizationId *string `json:"organization_id,omitempty"` // iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload. @@ -773,132 +773,172 @@ func (o *App) SetSafariApnsP12Password(v string) { o.SafariApnsP12Password = &v } -// GetApnsKeyId returns the ApnsKeyId field value if set, zero value otherwise. +// GetApnsKeyId returns the ApnsKeyId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *App) GetApnsKeyId() string { - if o == nil || o.ApnsKeyId == nil { + if o == nil || o.ApnsKeyId.Get() == nil { var ret string return ret } - return *o.ApnsKeyId + return *o.ApnsKeyId.Get() } // GetApnsKeyIdOk returns a tuple with the ApnsKeyId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *App) GetApnsKeyIdOk() (*string, bool) { - if o == nil || o.ApnsKeyId == nil { + if o == nil { return nil, false } - return o.ApnsKeyId, true + return o.ApnsKeyId.Get(), o.ApnsKeyId.IsSet() } // HasApnsKeyId returns a boolean if a field has been set. func (o *App) HasApnsKeyId() bool { - if o != nil && o.ApnsKeyId != nil { + if o != nil && o.ApnsKeyId.IsSet() { return true } return false } -// SetApnsKeyId gets a reference to the given string and assigns it to the ApnsKeyId field. +// SetApnsKeyId gets a reference to the given NullableString and assigns it to the ApnsKeyId field. func (o *App) SetApnsKeyId(v string) { - o.ApnsKeyId = &v + o.ApnsKeyId.Set(&v) +} +// SetApnsKeyIdNil sets the value for ApnsKeyId to be an explicit nil +func (o *App) SetApnsKeyIdNil() { + o.ApnsKeyId.Set(nil) } -// GetApnsTeamId returns the ApnsTeamId field value if set, zero value otherwise. +// UnsetApnsKeyId ensures that no value is present for ApnsKeyId, not even an explicit nil +func (o *App) UnsetApnsKeyId() { + o.ApnsKeyId.Unset() +} + +// GetApnsTeamId returns the ApnsTeamId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *App) GetApnsTeamId() string { - if o == nil || o.ApnsTeamId == nil { + if o == nil || o.ApnsTeamId.Get() == nil { var ret string return ret } - return *o.ApnsTeamId + return *o.ApnsTeamId.Get() } // GetApnsTeamIdOk returns a tuple with the ApnsTeamId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *App) GetApnsTeamIdOk() (*string, bool) { - if o == nil || o.ApnsTeamId == nil { + if o == nil { return nil, false } - return o.ApnsTeamId, true + return o.ApnsTeamId.Get(), o.ApnsTeamId.IsSet() } // HasApnsTeamId returns a boolean if a field has been set. func (o *App) HasApnsTeamId() bool { - if o != nil && o.ApnsTeamId != nil { + if o != nil && o.ApnsTeamId.IsSet() { return true } return false } -// SetApnsTeamId gets a reference to the given string and assigns it to the ApnsTeamId field. +// SetApnsTeamId gets a reference to the given NullableString and assigns it to the ApnsTeamId field. func (o *App) SetApnsTeamId(v string) { - o.ApnsTeamId = &v + o.ApnsTeamId.Set(&v) +} +// SetApnsTeamIdNil sets the value for ApnsTeamId to be an explicit nil +func (o *App) SetApnsTeamIdNil() { + o.ApnsTeamId.Set(nil) +} + +// UnsetApnsTeamId ensures that no value is present for ApnsTeamId, not even an explicit nil +func (o *App) UnsetApnsTeamId() { + o.ApnsTeamId.Unset() } -// GetApnsBundleId returns the ApnsBundleId field value if set, zero value otherwise. +// GetApnsBundleId returns the ApnsBundleId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *App) GetApnsBundleId() string { - if o == nil || o.ApnsBundleId == nil { + if o == nil || o.ApnsBundleId.Get() == nil { var ret string return ret } - return *o.ApnsBundleId + return *o.ApnsBundleId.Get() } // GetApnsBundleIdOk returns a tuple with the ApnsBundleId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *App) GetApnsBundleIdOk() (*string, bool) { - if o == nil || o.ApnsBundleId == nil { + if o == nil { return nil, false } - return o.ApnsBundleId, true + return o.ApnsBundleId.Get(), o.ApnsBundleId.IsSet() } // HasApnsBundleId returns a boolean if a field has been set. func (o *App) HasApnsBundleId() bool { - if o != nil && o.ApnsBundleId != nil { + if o != nil && o.ApnsBundleId.IsSet() { return true } return false } -// SetApnsBundleId gets a reference to the given string and assigns it to the ApnsBundleId field. +// SetApnsBundleId gets a reference to the given NullableString and assigns it to the ApnsBundleId field. func (o *App) SetApnsBundleId(v string) { - o.ApnsBundleId = &v + o.ApnsBundleId.Set(&v) +} +// SetApnsBundleIdNil sets the value for ApnsBundleId to be an explicit nil +func (o *App) SetApnsBundleIdNil() { + o.ApnsBundleId.Set(nil) } -// GetApnsP8 returns the ApnsP8 field value if set, zero value otherwise. +// UnsetApnsBundleId ensures that no value is present for ApnsBundleId, not even an explicit nil +func (o *App) UnsetApnsBundleId() { + o.ApnsBundleId.Unset() +} + +// GetApnsP8 returns the ApnsP8 field value if set, zero value otherwise (both if not set or set to explicit null). func (o *App) GetApnsP8() string { - if o == nil || o.ApnsP8 == nil { + if o == nil || o.ApnsP8.Get() == nil { var ret string return ret } - return *o.ApnsP8 + return *o.ApnsP8.Get() } // GetApnsP8Ok returns a tuple with the ApnsP8 field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *App) GetApnsP8Ok() (*string, bool) { - if o == nil || o.ApnsP8 == nil { + if o == nil { return nil, false } - return o.ApnsP8, true + return o.ApnsP8.Get(), o.ApnsP8.IsSet() } // HasApnsP8 returns a boolean if a field has been set. func (o *App) HasApnsP8() bool { - if o != nil && o.ApnsP8 != nil { + if o != nil && o.ApnsP8.IsSet() { return true } return false } -// SetApnsP8 gets a reference to the given string and assigns it to the ApnsP8 field. +// SetApnsP8 gets a reference to the given NullableString and assigns it to the ApnsP8 field. func (o *App) SetApnsP8(v string) { - o.ApnsP8 = &v + o.ApnsP8.Set(&v) +} +// SetApnsP8Nil sets the value for ApnsP8 to be an explicit nil +func (o *App) SetApnsP8Nil() { + o.ApnsP8.Set(nil) +} + +// UnsetApnsP8 ensures that no value is present for ApnsP8, not even an explicit nil +func (o *App) UnsetApnsP8() { + o.ApnsP8.Unset() } // GetSafariSiteOrigin returns the SafariSiteOrigin field value if set, zero value otherwise (both if not set or set to explicit null). @@ -1187,36 +1227,46 @@ func (o *App) UnsetSiteName() { o.SiteName.Unset() } -// GetBasicAuthKey returns the BasicAuthKey field value if set, zero value otherwise. +// GetBasicAuthKey returns the BasicAuthKey field value if set, zero value otherwise (both if not set or set to explicit null). func (o *App) GetBasicAuthKey() string { - if o == nil || o.BasicAuthKey == nil { + if o == nil || o.BasicAuthKey.Get() == nil { var ret string return ret } - return *o.BasicAuthKey + return *o.BasicAuthKey.Get() } // GetBasicAuthKeyOk returns a tuple with the BasicAuthKey field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *App) GetBasicAuthKeyOk() (*string, bool) { - if o == nil || o.BasicAuthKey == nil { + if o == nil { return nil, false } - return o.BasicAuthKey, true + return o.BasicAuthKey.Get(), o.BasicAuthKey.IsSet() } // HasBasicAuthKey returns a boolean if a field has been set. func (o *App) HasBasicAuthKey() bool { - if o != nil && o.BasicAuthKey != nil { + if o != nil && o.BasicAuthKey.IsSet() { return true } return false } -// SetBasicAuthKey gets a reference to the given string and assigns it to the BasicAuthKey field. +// SetBasicAuthKey gets a reference to the given NullableString and assigns it to the BasicAuthKey field. func (o *App) SetBasicAuthKey(v string) { - o.BasicAuthKey = &v + o.BasicAuthKey.Set(&v) +} +// SetBasicAuthKeyNil sets the value for BasicAuthKey to be an explicit nil +func (o *App) SetBasicAuthKeyNil() { + o.BasicAuthKey.Set(nil) +} + +// UnsetBasicAuthKey ensures that no value is present for BasicAuthKey, not even an explicit nil +func (o *App) UnsetBasicAuthKey() { + o.BasicAuthKey.Unset() } // GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. @@ -1342,17 +1392,17 @@ func (o App) MarshalJSON() ([]byte, error) { if o.SafariApnsP12Password != nil { toSerialize["safari_apns_p12_password"] = o.SafariApnsP12Password } - if o.ApnsKeyId != nil { - toSerialize["apns_key_id"] = o.ApnsKeyId + if o.ApnsKeyId.IsSet() { + toSerialize["apns_key_id"] = o.ApnsKeyId.Get() } - if o.ApnsTeamId != nil { - toSerialize["apns_team_id"] = o.ApnsTeamId + if o.ApnsTeamId.IsSet() { + toSerialize["apns_team_id"] = o.ApnsTeamId.Get() } - if o.ApnsBundleId != nil { - toSerialize["apns_bundle_id"] = o.ApnsBundleId + if o.ApnsBundleId.IsSet() { + toSerialize["apns_bundle_id"] = o.ApnsBundleId.Get() } - if o.ApnsP8 != nil { - toSerialize["apns_p8"] = o.ApnsP8 + if o.ApnsP8.IsSet() { + toSerialize["apns_p8"] = o.ApnsP8.Get() } if o.SafariSiteOrigin.IsSet() { toSerialize["safari_site_origin"] = o.SafariSiteOrigin.Get() @@ -1378,8 +1428,8 @@ func (o App) MarshalJSON() ([]byte, error) { if o.SiteName.IsSet() { toSerialize["site_name"] = o.SiteName.Get() } - if o.BasicAuthKey != nil { - toSerialize["basic_auth_key"] = o.BasicAuthKey + if o.BasicAuthKey.IsSet() { + toSerialize["basic_auth_key"] = o.BasicAuthKey.Get() } if o.OrganizationId != nil { toSerialize["organization_id"] = o.OrganizationId diff --git a/model_bad_request_error.go b/model_bad_request_error.go index 1312a1f..fb9ef2e 100644 --- a/model_bad_request_error.go +++ b/model_bad_request_error.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_basic_notification.go b/model_basic_notification.go index 013337b..ab202ad 100644 --- a/model_basic_notification.go +++ b/model_basic_notification.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -22,8 +22,10 @@ type BasicNotification struct { // 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\"] ExcludedSegments []string `json:"excluded_segments,omitempty"` // 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 + // Deprecated IncludePlayerIds []string `json:"include_player_ids,omitempty"` // 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. + // Deprecated IncludeExternalUserIds []string `json:"include_external_user_ids,omitempty"` // 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 IncludeEmailTokens []string `json:"include_email_tokens,omitempty"` @@ -41,6 +43,8 @@ type BasicNotification struct { IncludeChromeWebRegIds []string `json:"include_chrome_web_reg_ids,omitempty"` // 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 IncludeAndroidRegIds []string `json:"include_android_reg_ids,omitempty"` + IncludeAliases NullablePlayerNotificationTargetIncludeAliases `json:"include_aliases,omitempty"` + TargetChannel *string `json:"target_channel,omitempty"` Id *string `json:"id,omitempty"` Value *int32 `json:"value,omitempty"` // Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. @@ -71,7 +75,7 @@ type BasicNotification struct { // 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. AppId string `json:"app_id"` // 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 - ExternalId *string `json:"external_id,omitempty"` + ExternalId NullableString `json:"external_id,omitempty"` Contents NullableStringMap `json:"contents,omitempty"` Headings NullableStringMap `json:"headings,omitempty"` Subtitle NullableStringMap `json:"subtitle,omitempty"` @@ -299,6 +303,7 @@ func (o *BasicNotification) SetExcludedSegments(v []string) { } // GetIncludePlayerIds returns the IncludePlayerIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *BasicNotification) GetIncludePlayerIds() []string { if o == nil { var ret []string @@ -310,6 +315,7 @@ func (o *BasicNotification) GetIncludePlayerIds() []string { // GetIncludePlayerIdsOk returns a tuple with the IncludePlayerIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *BasicNotification) GetIncludePlayerIdsOk() ([]string, bool) { if o == nil || o.IncludePlayerIds == nil { return nil, false @@ -327,11 +333,13 @@ func (o *BasicNotification) HasIncludePlayerIds() bool { } // SetIncludePlayerIds gets a reference to the given []string and assigns it to the IncludePlayerIds field. +// Deprecated func (o *BasicNotification) SetIncludePlayerIds(v []string) { o.IncludePlayerIds = v } // GetIncludeExternalUserIds returns the IncludeExternalUserIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *BasicNotification) GetIncludeExternalUserIds() []string { if o == nil { var ret []string @@ -343,6 +351,7 @@ func (o *BasicNotification) GetIncludeExternalUserIds() []string { // GetIncludeExternalUserIdsOk returns a tuple with the IncludeExternalUserIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *BasicNotification) GetIncludeExternalUserIdsOk() ([]string, bool) { if o == nil || o.IncludeExternalUserIds == nil { return nil, false @@ -360,6 +369,7 @@ func (o *BasicNotification) HasIncludeExternalUserIds() bool { } // SetIncludeExternalUserIds gets a reference to the given []string and assigns it to the IncludeExternalUserIds field. +// Deprecated func (o *BasicNotification) SetIncludeExternalUserIds(v []string) { o.IncludeExternalUserIds = v } @@ -620,6 +630,80 @@ func (o *BasicNotification) SetIncludeAndroidRegIds(v []string) { o.IncludeAndroidRegIds = v } +// GetIncludeAliases returns the IncludeAliases field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BasicNotification) GetIncludeAliases() PlayerNotificationTargetIncludeAliases { + if o == nil || o.IncludeAliases.Get() == nil { + var ret PlayerNotificationTargetIncludeAliases + return ret + } + return *o.IncludeAliases.Get() +} + +// GetIncludeAliasesOk returns a tuple with the IncludeAliases field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BasicNotification) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool) { + if o == nil { + return nil, false + } + return o.IncludeAliases.Get(), o.IncludeAliases.IsSet() +} + +// HasIncludeAliases returns a boolean if a field has been set. +func (o *BasicNotification) HasIncludeAliases() bool { + if o != nil && o.IncludeAliases.IsSet() { + return true + } + + return false +} + +// SetIncludeAliases gets a reference to the given NullablePlayerNotificationTargetIncludeAliases and assigns it to the IncludeAliases field. +func (o *BasicNotification) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases) { + o.IncludeAliases.Set(&v) +} +// SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil +func (o *BasicNotification) SetIncludeAliasesNil() { + o.IncludeAliases.Set(nil) +} + +// UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +func (o *BasicNotification) UnsetIncludeAliases() { + o.IncludeAliases.Unset() +} + +// GetTargetChannel returns the TargetChannel field value if set, zero value otherwise. +func (o *BasicNotification) GetTargetChannel() string { + if o == nil || o.TargetChannel == nil { + var ret string + return ret + } + return *o.TargetChannel +} + +// GetTargetChannelOk returns a tuple with the TargetChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BasicNotification) GetTargetChannelOk() (*string, bool) { + if o == nil || o.TargetChannel == nil { + return nil, false + } + return o.TargetChannel, true +} + +// HasTargetChannel returns a boolean if a field has been set. +func (o *BasicNotification) HasTargetChannel() bool { + if o != nil && o.TargetChannel != nil { + return true + } + + return false +} + +// SetTargetChannel gets a reference to the given string and assigns it to the TargetChannel field. +func (o *BasicNotification) SetTargetChannel(v string) { + o.TargetChannel = &v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *BasicNotification) GetId() string { if o == nil || o.Id == nil { @@ -1234,36 +1318,46 @@ func (o *BasicNotification) SetAppId(v string) { o.AppId = v } -// GetExternalId returns the ExternalId field value if set, zero value otherwise. +// GetExternalId returns the ExternalId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BasicNotification) GetExternalId() string { - if o == nil || o.ExternalId == nil { + if o == nil || o.ExternalId.Get() == nil { var ret string return ret } - return *o.ExternalId + return *o.ExternalId.Get() } // GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BasicNotification) GetExternalIdOk() (*string, bool) { - if o == nil || o.ExternalId == nil { + if o == nil { return nil, false } - return o.ExternalId, true + return o.ExternalId.Get(), o.ExternalId.IsSet() } // HasExternalId returns a boolean if a field has been set. func (o *BasicNotification) HasExternalId() bool { - if o != nil && o.ExternalId != nil { + if o != nil && o.ExternalId.IsSet() { return true } return false } -// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +// SetExternalId gets a reference to the given NullableString and assigns it to the ExternalId field. func (o *BasicNotification) SetExternalId(v string) { - o.ExternalId = &v + o.ExternalId.Set(&v) +} +// SetExternalIdNil sets the value for ExternalId to be an explicit nil +func (o *BasicNotification) SetExternalIdNil() { + o.ExternalId.Set(nil) +} + +// UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil +func (o *BasicNotification) UnsetExternalId() { + o.ExternalId.Unset() } // GetContents returns the Contents field value if set, zero value otherwise (both if not set or set to explicit null). @@ -4166,6 +4260,12 @@ func (o BasicNotification) MarshalJSON() ([]byte, error) { if o.IncludeAndroidRegIds != nil { toSerialize["include_android_reg_ids"] = o.IncludeAndroidRegIds } + if o.IncludeAliases.IsSet() { + toSerialize["include_aliases"] = o.IncludeAliases.Get() + } + if o.TargetChannel != nil { + toSerialize["target_channel"] = o.TargetChannel + } if o.Id != nil { toSerialize["id"] = o.Id } @@ -4214,8 +4314,8 @@ func (o BasicNotification) MarshalJSON() ([]byte, error) { if true { toSerialize["app_id"] = o.AppId } - if o.ExternalId != nil { - toSerialize["external_id"] = o.ExternalId + if o.ExternalId.IsSet() { + toSerialize["external_id"] = o.ExternalId.Get() } if o.Contents.IsSet() { toSerialize["contents"] = o.Contents.Get() @@ -4463,6 +4563,8 @@ func (o *BasicNotification) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "include_chrome_reg_ids") delete(additionalProperties, "include_chrome_web_reg_ids") delete(additionalProperties, "include_android_reg_ids") + delete(additionalProperties, "include_aliases") + delete(additionalProperties, "target_channel") delete(additionalProperties, "id") delete(additionalProperties, "value") delete(additionalProperties, "name") diff --git a/model_basic_notification_all_of.go b/model_basic_notification_all_of.go index 3996776..c9d5b0f 100644 --- a/model_basic_notification_all_of.go +++ b/model_basic_notification_all_of.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -47,7 +47,7 @@ type BasicNotificationAllOf struct { // 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. AppId *string `json:"app_id,omitempty"` // 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 - ExternalId *string `json:"external_id,omitempty"` + ExternalId NullableString `json:"external_id,omitempty"` Contents NullableStringMap `json:"contents,omitempty"` Headings NullableStringMap `json:"headings,omitempty"` Subtitle NullableStringMap `json:"subtitle,omitempty"` @@ -831,36 +831,46 @@ func (o *BasicNotificationAllOf) SetAppId(v string) { o.AppId = &v } -// GetExternalId returns the ExternalId field value if set, zero value otherwise. +// GetExternalId returns the ExternalId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BasicNotificationAllOf) GetExternalId() string { - if o == nil || o.ExternalId == nil { + if o == nil || o.ExternalId.Get() == nil { var ret string return ret } - return *o.ExternalId + return *o.ExternalId.Get() } // GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BasicNotificationAllOf) GetExternalIdOk() (*string, bool) { - if o == nil || o.ExternalId == nil { + if o == nil { return nil, false } - return o.ExternalId, true + return o.ExternalId.Get(), o.ExternalId.IsSet() } // HasExternalId returns a boolean if a field has been set. func (o *BasicNotificationAllOf) HasExternalId() bool { - if o != nil && o.ExternalId != nil { + if o != nil && o.ExternalId.IsSet() { return true } return false } -// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +// SetExternalId gets a reference to the given NullableString and assigns it to the ExternalId field. func (o *BasicNotificationAllOf) SetExternalId(v string) { - o.ExternalId = &v + o.ExternalId.Set(&v) +} +// SetExternalIdNil sets the value for ExternalId to be an explicit nil +func (o *BasicNotificationAllOf) SetExternalIdNil() { + o.ExternalId.Set(nil) +} + +// UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil +func (o *BasicNotificationAllOf) UnsetExternalId() { + o.ExternalId.Unset() } // GetContents returns the Contents field value if set, zero value otherwise (both if not set or set to explicit null). @@ -3775,8 +3785,8 @@ func (o BasicNotificationAllOf) MarshalJSON() ([]byte, error) { if o.AppId != nil { toSerialize["app_id"] = o.AppId } - if o.ExternalId != nil { - toSerialize["external_id"] = o.ExternalId + if o.ExternalId.IsSet() { + toSerialize["external_id"] = o.ExternalId.Get() } if o.Contents.IsSet() { toSerialize["contents"] = o.Contents.Get() diff --git a/model_basic_notification_all_of_android_background_layout.go b/model_basic_notification_all_of_android_background_layout.go index 37247b6..443b46f 100644 --- a/model_basic_notification_all_of_android_background_layout.go +++ b/model_basic_notification_all_of_android_background_layout.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_begin_live_activity_request.go b/model_begin_live_activity_request.go index b10b21c..c0d387c 100644 --- a/model_begin_live_activity_request.go +++ b/model_begin_live_activity_request.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_button.go b/model_button.go index 629941a..85211d1 100644 --- a/model_button.go +++ b/model_button.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_cancel_notification_success_response.go b/model_cancel_notification_success_response.go index 7de1575..e3f629f 100644 --- a/model_cancel_notification_success_response.go +++ b/model_cancel_notification_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_create_notification_success_response.go b/model_create_notification_success_response.go index 9cabb21..98d4ada 100644 --- a/model_create_notification_success_response.go +++ b/model_create_notification_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -17,9 +17,9 @@ import ( // CreateNotificationSuccessResponse struct for CreateNotificationSuccessResponse type CreateNotificationSuccessResponse struct { - Id string `json:"id"` + Id *string `json:"id,omitempty"` // Estimated number of subscribers targetted by notification. - Recipients int32 `json:"recipients"` + Recipients *int32 `json:"recipients,omitempty"` ExternalId NullableString `json:"external_id,omitempty"` Errors *Notification200Errors `json:"errors,omitempty"` AdditionalProperties map[string]interface{} @@ -31,10 +31,8 @@ type _CreateNotificationSuccessResponse CreateNotificationSuccessResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateNotificationSuccessResponse(id string, recipients int32) *CreateNotificationSuccessResponse { +func NewCreateNotificationSuccessResponse() *CreateNotificationSuccessResponse { this := CreateNotificationSuccessResponse{} - this.Id = id - this.Recipients = recipients return &this } @@ -46,52 +44,68 @@ func NewCreateNotificationSuccessResponseWithDefaults() *CreateNotificationSucce return &this } -// GetId returns the Id field value +// GetId returns the Id field value if set, zero value otherwise. func (o *CreateNotificationSuccessResponse) GetId() string { - if o == nil { + if o == nil || o.Id == nil { var ret string return ret } - - return o.Id + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateNotificationSuccessResponse) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || o.Id == nil { return nil, false } - return &o.Id, true + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateNotificationSuccessResponse) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false } -// SetId sets field value +// SetId gets a reference to the given string and assigns it to the Id field. func (o *CreateNotificationSuccessResponse) SetId(v string) { - o.Id = v + o.Id = &v } -// GetRecipients returns the Recipients field value +// GetRecipients returns the Recipients field value if set, zero value otherwise. func (o *CreateNotificationSuccessResponse) GetRecipients() int32 { - if o == nil { + if o == nil || o.Recipients == nil { var ret int32 return ret } - - return o.Recipients + return *o.Recipients } -// GetRecipientsOk returns a tuple with the Recipients field value +// GetRecipientsOk returns a tuple with the Recipients field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateNotificationSuccessResponse) GetRecipientsOk() (*int32, bool) { - if o == nil { + if o == nil || o.Recipients == nil { return nil, false } - return &o.Recipients, true + return o.Recipients, true +} + +// HasRecipients returns a boolean if a field has been set. +func (o *CreateNotificationSuccessResponse) HasRecipients() bool { + if o != nil && o.Recipients != nil { + return true + } + + return false } -// SetRecipients sets field value +// SetRecipients gets a reference to the given int32 and assigns it to the Recipients field. func (o *CreateNotificationSuccessResponse) SetRecipients(v int32) { - o.Recipients = v + o.Recipients = &v } // GetExternalId returns the ExternalId field value if set, zero value otherwise (both if not set or set to explicit null). @@ -170,10 +184,10 @@ func (o *CreateNotificationSuccessResponse) SetErrors(v Notification200Errors) { func (o CreateNotificationSuccessResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if true { + if o.Id != nil { toSerialize["id"] = o.Id } - if true { + if o.Recipients != nil { toSerialize["recipients"] = o.Recipients } if o.ExternalId.IsSet() { diff --git a/model_create_player_success_response.go b/model_create_player_success_response.go index 3dc5cb7..5949c9b 100644 --- a/model_create_player_success_response.go +++ b/model_create_player_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_create_segment_conflict_response.go b/model_create_segment_conflict_response.go index f76d0cf..5354049 100644 --- a/model_create_segment_conflict_response.go +++ b/model_create_segment_conflict_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_create_segment_success_response.go b/model_create_segment_success_response.go index 51d921b..eeab08a 100644 --- a/model_create_segment_success_response.go +++ b/model_create_segment_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_create_subscription_request_body.go b/model_create_subscription_request_body.go new file mode 100644 index 0000000..8ee93e1 --- /dev/null +++ b/model_create_subscription_request_body.go @@ -0,0 +1,178 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// CreateSubscriptionRequestBody struct for CreateSubscriptionRequestBody +type CreateSubscriptionRequestBody struct { + Subscription *SubscriptionObject `json:"subscription,omitempty"` + RetainPreviousOwner *bool `json:"retain_previous_owner,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateSubscriptionRequestBody CreateSubscriptionRequestBody + +// NewCreateSubscriptionRequestBody instantiates a new CreateSubscriptionRequestBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSubscriptionRequestBody() *CreateSubscriptionRequestBody { + this := CreateSubscriptionRequestBody{} + return &this +} + +// NewCreateSubscriptionRequestBodyWithDefaults instantiates a new CreateSubscriptionRequestBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSubscriptionRequestBodyWithDefaults() *CreateSubscriptionRequestBody { + this := CreateSubscriptionRequestBody{} + return &this +} + +// GetSubscription returns the Subscription field value if set, zero value otherwise. +func (o *CreateSubscriptionRequestBody) GetSubscription() SubscriptionObject { + if o == nil || o.Subscription == nil { + var ret SubscriptionObject + return ret + } + return *o.Subscription +} + +// GetSubscriptionOk returns a tuple with the Subscription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSubscriptionRequestBody) GetSubscriptionOk() (*SubscriptionObject, bool) { + if o == nil || o.Subscription == nil { + return nil, false + } + return o.Subscription, true +} + +// HasSubscription returns a boolean if a field has been set. +func (o *CreateSubscriptionRequestBody) HasSubscription() bool { + if o != nil && o.Subscription != nil { + return true + } + + return false +} + +// SetSubscription gets a reference to the given SubscriptionObject and assigns it to the Subscription field. +func (o *CreateSubscriptionRequestBody) SetSubscription(v SubscriptionObject) { + o.Subscription = &v +} + +// GetRetainPreviousOwner returns the RetainPreviousOwner field value if set, zero value otherwise. +func (o *CreateSubscriptionRequestBody) GetRetainPreviousOwner() bool { + if o == nil || o.RetainPreviousOwner == nil { + var ret bool + return ret + } + return *o.RetainPreviousOwner +} + +// GetRetainPreviousOwnerOk returns a tuple with the RetainPreviousOwner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSubscriptionRequestBody) GetRetainPreviousOwnerOk() (*bool, bool) { + if o == nil || o.RetainPreviousOwner == nil { + return nil, false + } + return o.RetainPreviousOwner, true +} + +// HasRetainPreviousOwner returns a boolean if a field has been set. +func (o *CreateSubscriptionRequestBody) HasRetainPreviousOwner() bool { + if o != nil && o.RetainPreviousOwner != nil { + return true + } + + return false +} + +// SetRetainPreviousOwner gets a reference to the given bool and assigns it to the RetainPreviousOwner field. +func (o *CreateSubscriptionRequestBody) SetRetainPreviousOwner(v bool) { + o.RetainPreviousOwner = &v +} + +func (o CreateSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Subscription != nil { + toSerialize["subscription"] = o.Subscription + } + if o.RetainPreviousOwner != nil { + toSerialize["retain_previous_owner"] = o.RetainPreviousOwner + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *CreateSubscriptionRequestBody) UnmarshalJSON(bytes []byte) (err error) { + varCreateSubscriptionRequestBody := _CreateSubscriptionRequestBody{} + + if err = json.Unmarshal(bytes, &varCreateSubscriptionRequestBody); err == nil { + *o = CreateSubscriptionRequestBody(varCreateSubscriptionRequestBody) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "subscription") + delete(additionalProperties, "retain_previous_owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateSubscriptionRequestBody struct { + value *CreateSubscriptionRequestBody + isSet bool +} + +func (v NullableCreateSubscriptionRequestBody) Get() *CreateSubscriptionRequestBody { + return v.value +} + +func (v *NullableCreateSubscriptionRequestBody) Set(val *CreateSubscriptionRequestBody) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSubscriptionRequestBody) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSubscriptionRequestBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSubscriptionRequestBody(val *CreateSubscriptionRequestBody) *NullableCreateSubscriptionRequestBody { + return &NullableCreateSubscriptionRequestBody{value: val, isSet: true} +} + +func (v NullableCreateSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSubscriptionRequestBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_user_conflict_response.go b/model_create_user_conflict_response.go new file mode 100644 index 0000000..6e8102e --- /dev/null +++ b/model_create_user_conflict_response.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// CreateUserConflictResponse struct for CreateUserConflictResponse +type CreateUserConflictResponse struct { + Errors []CreateUserConflictResponseErrorsInner `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserConflictResponse CreateUserConflictResponse + +// NewCreateUserConflictResponse instantiates a new CreateUserConflictResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserConflictResponse() *CreateUserConflictResponse { + this := CreateUserConflictResponse{} + return &this +} + +// NewCreateUserConflictResponseWithDefaults instantiates a new CreateUserConflictResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserConflictResponseWithDefaults() *CreateUserConflictResponse { + this := CreateUserConflictResponse{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CreateUserConflictResponse) GetErrors() []CreateUserConflictResponseErrorsInner { + if o == nil || o.Errors == nil { + var ret []CreateUserConflictResponseErrorsInner + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserConflictResponse) GetErrorsOk() ([]CreateUserConflictResponseErrorsInner, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *CreateUserConflictResponse) HasErrors() bool { + if o != nil && o.Errors != nil { + return true + } + + return false +} + +// SetErrors gets a reference to the given []CreateUserConflictResponseErrorsInner and assigns it to the Errors field. +func (o *CreateUserConflictResponse) SetErrors(v []CreateUserConflictResponseErrorsInner) { + o.Errors = v +} + +func (o CreateUserConflictResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *CreateUserConflictResponse) UnmarshalJSON(bytes []byte) (err error) { + varCreateUserConflictResponse := _CreateUserConflictResponse{} + + if err = json.Unmarshal(bytes, &varCreateUserConflictResponse); err == nil { + *o = CreateUserConflictResponse(varCreateUserConflictResponse) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserConflictResponse struct { + value *CreateUserConflictResponse + isSet bool +} + +func (v NullableCreateUserConflictResponse) Get() *CreateUserConflictResponse { + return v.value +} + +func (v *NullableCreateUserConflictResponse) Set(val *CreateUserConflictResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserConflictResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserConflictResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserConflictResponse(val *CreateUserConflictResponse) *NullableCreateUserConflictResponse { + return &NullableCreateUserConflictResponse{value: val, isSet: true} +} + +func (v NullableCreateUserConflictResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserConflictResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_user_conflict_response_errors_inner.go b/model_create_user_conflict_response_errors_inner.go new file mode 100644 index 0000000..1ff7ed7 --- /dev/null +++ b/model_create_user_conflict_response_errors_inner.go @@ -0,0 +1,215 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// CreateUserConflictResponseErrorsInner struct for CreateUserConflictResponseErrorsInner +type CreateUserConflictResponseErrorsInner struct { + Code *string `json:"code,omitempty"` + Title *string `json:"title,omitempty"` + Meta *CreateUserConflictResponseErrorsItemsMeta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserConflictResponseErrorsInner CreateUserConflictResponseErrorsInner + +// NewCreateUserConflictResponseErrorsInner instantiates a new CreateUserConflictResponseErrorsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserConflictResponseErrorsInner() *CreateUserConflictResponseErrorsInner { + this := CreateUserConflictResponseErrorsInner{} + return &this +} + +// NewCreateUserConflictResponseErrorsInnerWithDefaults instantiates a new CreateUserConflictResponseErrorsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserConflictResponseErrorsInnerWithDefaults() *CreateUserConflictResponseErrorsInner { + this := CreateUserConflictResponseErrorsInner{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *CreateUserConflictResponseErrorsInner) GetCode() string { + if o == nil || o.Code == nil { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserConflictResponseErrorsInner) GetCodeOk() (*string, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *CreateUserConflictResponseErrorsInner) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *CreateUserConflictResponseErrorsInner) SetCode(v string) { + o.Code = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *CreateUserConflictResponseErrorsInner) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserConflictResponseErrorsInner) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *CreateUserConflictResponseErrorsInner) HasTitle() bool { + if o != nil && o.Title != nil { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *CreateUserConflictResponseErrorsInner) SetTitle(v string) { + o.Title = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CreateUserConflictResponseErrorsInner) GetMeta() CreateUserConflictResponseErrorsItemsMeta { + if o == nil || o.Meta == nil { + var ret CreateUserConflictResponseErrorsItemsMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserConflictResponseErrorsInner) GetMetaOk() (*CreateUserConflictResponseErrorsItemsMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CreateUserConflictResponseErrorsInner) HasMeta() bool { + if o != nil && o.Meta != nil { + return true + } + + return false +} + +// SetMeta gets a reference to the given CreateUserConflictResponseErrorsItemsMeta and assigns it to the Meta field. +func (o *CreateUserConflictResponseErrorsInner) SetMeta(v CreateUserConflictResponseErrorsItemsMeta) { + o.Meta = &v +} + +func (o CreateUserConflictResponseErrorsInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *CreateUserConflictResponseErrorsInner) UnmarshalJSON(bytes []byte) (err error) { + varCreateUserConflictResponseErrorsInner := _CreateUserConflictResponseErrorsInner{} + + if err = json.Unmarshal(bytes, &varCreateUserConflictResponseErrorsInner); err == nil { + *o = CreateUserConflictResponseErrorsInner(varCreateUserConflictResponseErrorsInner) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "title") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserConflictResponseErrorsInner struct { + value *CreateUserConflictResponseErrorsInner + isSet bool +} + +func (v NullableCreateUserConflictResponseErrorsInner) Get() *CreateUserConflictResponseErrorsInner { + return v.value +} + +func (v *NullableCreateUserConflictResponseErrorsInner) Set(val *CreateUserConflictResponseErrorsInner) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserConflictResponseErrorsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserConflictResponseErrorsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserConflictResponseErrorsInner(val *CreateUserConflictResponseErrorsInner) *NullableCreateUserConflictResponseErrorsInner { + return &NullableCreateUserConflictResponseErrorsInner{value: val, isSet: true} +} + +func (v NullableCreateUserConflictResponseErrorsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserConflictResponseErrorsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_user_conflict_response_errors_items_meta.go b/model_create_user_conflict_response_errors_items_meta.go new file mode 100644 index 0000000..76d4456 --- /dev/null +++ b/model_create_user_conflict_response_errors_items_meta.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// CreateUserConflictResponseErrorsItemsMeta struct for CreateUserConflictResponseErrorsItemsMeta +type CreateUserConflictResponseErrorsItemsMeta struct { + ConflictingAliases map[string]interface{} `json:"conflicting_aliases,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserConflictResponseErrorsItemsMeta CreateUserConflictResponseErrorsItemsMeta + +// NewCreateUserConflictResponseErrorsItemsMeta instantiates a new CreateUserConflictResponseErrorsItemsMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserConflictResponseErrorsItemsMeta() *CreateUserConflictResponseErrorsItemsMeta { + this := CreateUserConflictResponseErrorsItemsMeta{} + return &this +} + +// NewCreateUserConflictResponseErrorsItemsMetaWithDefaults instantiates a new CreateUserConflictResponseErrorsItemsMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserConflictResponseErrorsItemsMetaWithDefaults() *CreateUserConflictResponseErrorsItemsMeta { + this := CreateUserConflictResponseErrorsItemsMeta{} + return &this +} + +// GetConflictingAliases returns the ConflictingAliases field value if set, zero value otherwise. +func (o *CreateUserConflictResponseErrorsItemsMeta) GetConflictingAliases() map[string]interface{} { + if o == nil || o.ConflictingAliases == nil { + var ret map[string]interface{} + return ret + } + return o.ConflictingAliases +} + +// GetConflictingAliasesOk returns a tuple with the ConflictingAliases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserConflictResponseErrorsItemsMeta) GetConflictingAliasesOk() (map[string]interface{}, bool) { + if o == nil || o.ConflictingAliases == nil { + return nil, false + } + return o.ConflictingAliases, true +} + +// HasConflictingAliases returns a boolean if a field has been set. +func (o *CreateUserConflictResponseErrorsItemsMeta) HasConflictingAliases() bool { + if o != nil && o.ConflictingAliases != nil { + return true + } + + return false +} + +// SetConflictingAliases gets a reference to the given map[string]interface{} and assigns it to the ConflictingAliases field. +func (o *CreateUserConflictResponseErrorsItemsMeta) SetConflictingAliases(v map[string]interface{}) { + o.ConflictingAliases = v +} + +func (o CreateUserConflictResponseErrorsItemsMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ConflictingAliases != nil { + toSerialize["conflicting_aliases"] = o.ConflictingAliases + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *CreateUserConflictResponseErrorsItemsMeta) UnmarshalJSON(bytes []byte) (err error) { + varCreateUserConflictResponseErrorsItemsMeta := _CreateUserConflictResponseErrorsItemsMeta{} + + if err = json.Unmarshal(bytes, &varCreateUserConflictResponseErrorsItemsMeta); err == nil { + *o = CreateUserConflictResponseErrorsItemsMeta(varCreateUserConflictResponseErrorsItemsMeta) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "conflicting_aliases") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserConflictResponseErrorsItemsMeta struct { + value *CreateUserConflictResponseErrorsItemsMeta + isSet bool +} + +func (v NullableCreateUserConflictResponseErrorsItemsMeta) Get() *CreateUserConflictResponseErrorsItemsMeta { + return v.value +} + +func (v *NullableCreateUserConflictResponseErrorsItemsMeta) Set(val *CreateUserConflictResponseErrorsItemsMeta) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserConflictResponseErrorsItemsMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserConflictResponseErrorsItemsMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserConflictResponseErrorsItemsMeta(val *CreateUserConflictResponseErrorsItemsMeta) *NullableCreateUserConflictResponseErrorsItemsMeta { + return &NullableCreateUserConflictResponseErrorsItemsMeta{value: val, isSet: true} +} + +func (v NullableCreateUserConflictResponseErrorsItemsMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserConflictResponseErrorsItemsMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_delete_player_not_found_response.go b/model_delete_player_not_found_response.go index ff2b6b8..4897394 100644 --- a/model_delete_player_not_found_response.go +++ b/model_delete_player_not_found_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_delete_player_success_response.go b/model_delete_player_success_response.go index 85d730f..b4a0358 100644 --- a/model_delete_player_success_response.go +++ b/model_delete_player_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_delete_segment_not_found_response.go b/model_delete_segment_not_found_response.go index 54ec170..78a42fd 100644 --- a/model_delete_segment_not_found_response.go +++ b/model_delete_segment_not_found_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_delete_segment_success_response.go b/model_delete_segment_success_response.go index a86813f..4e6591e 100644 --- a/model_delete_segment_success_response.go +++ b/model_delete_segment_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_delivery_data.go b/model_delivery_data.go index a16e964..cb98655 100644 --- a/model_delivery_data.go +++ b/model_delivery_data.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_export_players_request_body.go b/model_export_players_request_body.go index 4c16a1a..90d2aeb 100644 --- a/model_export_players_request_body.go +++ b/model_export_players_request_body.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_export_players_success_response.go b/model_export_players_success_response.go index 87c182a..ab76225 100644 --- a/model_export_players_success_response.go +++ b/model_export_players_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_filter.go b/model_filter.go index 5ca9739..ec7ec31 100644 --- a/model_filter.go +++ b/model_filter.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_filter_expressions.go b/model_filter_expressions.go index 1aaa528..cdad916 100644 --- a/model_filter_expressions.go +++ b/model_filter_expressions.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_get_notification_request_body.go b/model_get_notification_request_body.go index 55513fd..6c22ae9 100644 --- a/model_get_notification_request_body.go +++ b/model_get_notification_request_body.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_identify_user_conflict_response.go b/model_identify_user_conflict_response.go new file mode 100644 index 0000000..0162eab --- /dev/null +++ b/model_identify_user_conflict_response.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// IdentifyUserConflictResponse struct for IdentifyUserConflictResponse +type IdentifyUserConflictResponse struct { + Errors []IdentifyUserConflictResponseErrorsInner `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentifyUserConflictResponse IdentifyUserConflictResponse + +// NewIdentifyUserConflictResponse instantiates a new IdentifyUserConflictResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentifyUserConflictResponse() *IdentifyUserConflictResponse { + this := IdentifyUserConflictResponse{} + return &this +} + +// NewIdentifyUserConflictResponseWithDefaults instantiates a new IdentifyUserConflictResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentifyUserConflictResponseWithDefaults() *IdentifyUserConflictResponse { + this := IdentifyUserConflictResponse{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *IdentifyUserConflictResponse) GetErrors() []IdentifyUserConflictResponseErrorsInner { + if o == nil || o.Errors == nil { + var ret []IdentifyUserConflictResponseErrorsInner + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentifyUserConflictResponse) GetErrorsOk() ([]IdentifyUserConflictResponseErrorsInner, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *IdentifyUserConflictResponse) HasErrors() bool { + if o != nil && o.Errors != nil { + return true + } + + return false +} + +// SetErrors gets a reference to the given []IdentifyUserConflictResponseErrorsInner and assigns it to the Errors field. +func (o *IdentifyUserConflictResponse) SetErrors(v []IdentifyUserConflictResponseErrorsInner) { + o.Errors = v +} + +func (o IdentifyUserConflictResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *IdentifyUserConflictResponse) UnmarshalJSON(bytes []byte) (err error) { + varIdentifyUserConflictResponse := _IdentifyUserConflictResponse{} + + if err = json.Unmarshal(bytes, &varIdentifyUserConflictResponse); err == nil { + *o = IdentifyUserConflictResponse(varIdentifyUserConflictResponse) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentifyUserConflictResponse struct { + value *IdentifyUserConflictResponse + isSet bool +} + +func (v NullableIdentifyUserConflictResponse) Get() *IdentifyUserConflictResponse { + return v.value +} + +func (v *NullableIdentifyUserConflictResponse) Set(val *IdentifyUserConflictResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIdentifyUserConflictResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentifyUserConflictResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentifyUserConflictResponse(val *IdentifyUserConflictResponse) *NullableIdentifyUserConflictResponse { + return &NullableIdentifyUserConflictResponse{value: val, isSet: true} +} + +func (v NullableIdentifyUserConflictResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentifyUserConflictResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_identify_user_conflict_response_errors_inner.go b/model_identify_user_conflict_response_errors_inner.go new file mode 100644 index 0000000..90cab50 --- /dev/null +++ b/model_identify_user_conflict_response_errors_inner.go @@ -0,0 +1,178 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// IdentifyUserConflictResponseErrorsInner struct for IdentifyUserConflictResponseErrorsInner +type IdentifyUserConflictResponseErrorsInner struct { + Code *string `json:"code,omitempty"` + Title *string `json:"title,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentifyUserConflictResponseErrorsInner IdentifyUserConflictResponseErrorsInner + +// NewIdentifyUserConflictResponseErrorsInner instantiates a new IdentifyUserConflictResponseErrorsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentifyUserConflictResponseErrorsInner() *IdentifyUserConflictResponseErrorsInner { + this := IdentifyUserConflictResponseErrorsInner{} + return &this +} + +// NewIdentifyUserConflictResponseErrorsInnerWithDefaults instantiates a new IdentifyUserConflictResponseErrorsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentifyUserConflictResponseErrorsInnerWithDefaults() *IdentifyUserConflictResponseErrorsInner { + this := IdentifyUserConflictResponseErrorsInner{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *IdentifyUserConflictResponseErrorsInner) GetCode() string { + if o == nil || o.Code == nil { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentifyUserConflictResponseErrorsInner) GetCodeOk() (*string, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *IdentifyUserConflictResponseErrorsInner) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *IdentifyUserConflictResponseErrorsInner) SetCode(v string) { + o.Code = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *IdentifyUserConflictResponseErrorsInner) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentifyUserConflictResponseErrorsInner) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *IdentifyUserConflictResponseErrorsInner) HasTitle() bool { + if o != nil && o.Title != nil { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *IdentifyUserConflictResponseErrorsInner) SetTitle(v string) { + o.Title = &v +} + +func (o IdentifyUserConflictResponseErrorsInner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *IdentifyUserConflictResponseErrorsInner) UnmarshalJSON(bytes []byte) (err error) { + varIdentifyUserConflictResponseErrorsInner := _IdentifyUserConflictResponseErrorsInner{} + + if err = json.Unmarshal(bytes, &varIdentifyUserConflictResponseErrorsInner); err == nil { + *o = IdentifyUserConflictResponseErrorsInner(varIdentifyUserConflictResponseErrorsInner) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "title") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentifyUserConflictResponseErrorsInner struct { + value *IdentifyUserConflictResponseErrorsInner + isSet bool +} + +func (v NullableIdentifyUserConflictResponseErrorsInner) Get() *IdentifyUserConflictResponseErrorsInner { + return v.value +} + +func (v *NullableIdentifyUserConflictResponseErrorsInner) Set(val *IdentifyUserConflictResponseErrorsInner) { + v.value = val + v.isSet = true +} + +func (v NullableIdentifyUserConflictResponseErrorsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentifyUserConflictResponseErrorsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentifyUserConflictResponseErrorsInner(val *IdentifyUserConflictResponseErrorsInner) *NullableIdentifyUserConflictResponseErrorsInner { + return &NullableIdentifyUserConflictResponseErrorsInner{value: val, isSet: true} +} + +func (v NullableIdentifyUserConflictResponseErrorsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentifyUserConflictResponseErrorsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_inline_response_200.go b/model_inline_response_200.go new file mode 100644 index 0000000..20333ca --- /dev/null +++ b/model_inline_response_200.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// InlineResponse200 struct for InlineResponse200 +type InlineResponse200 struct { + Identity map[string]interface{} `json:"identity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InlineResponse200 InlineResponse200 + +// NewInlineResponse200 instantiates a new InlineResponse200 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse200() *InlineResponse200 { + this := InlineResponse200{} + return &this +} + +// NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse200WithDefaults() *InlineResponse200 { + this := InlineResponse200{} + return &this +} + +// GetIdentity returns the Identity field value if set, zero value otherwise. +func (o *InlineResponse200) GetIdentity() map[string]interface{} { + if o == nil || o.Identity == nil { + var ret map[string]interface{} + return ret + } + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse200) GetIdentityOk() (map[string]interface{}, bool) { + if o == nil || o.Identity == nil { + return nil, false + } + return o.Identity, true +} + +// HasIdentity returns a boolean if a field has been set. +func (o *InlineResponse200) HasIdentity() bool { + if o != nil && o.Identity != nil { + return true + } + + return false +} + +// SetIdentity gets a reference to the given map[string]interface{} and assigns it to the Identity field. +func (o *InlineResponse200) SetIdentity(v map[string]interface{}) { + o.Identity = v +} + +func (o InlineResponse200) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Identity != nil { + toSerialize["identity"] = o.Identity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineResponse200) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse200 := _InlineResponse200{} + + if err = json.Unmarshal(bytes, &varInlineResponse200); err == nil { + *o = InlineResponse200(varInlineResponse200) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "identity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineResponse200 struct { + value *InlineResponse200 + isSet bool +} + +func (v NullableInlineResponse200) Get() *InlineResponse200 { + return v.value +} + +func (v *NullableInlineResponse200) Set(val *InlineResponse200) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse200) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse200) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse200(val *InlineResponse200) *NullableInlineResponse200 { + return &NullableInlineResponse200{value: val, isSet: true} +} + +func (v NullableInlineResponse200) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse200) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_inline_response_200_3.go b/model_inline_response_200_3.go new file mode 100644 index 0000000..cc71ca4 --- /dev/null +++ b/model_inline_response_200_3.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// InlineResponse2003 struct for InlineResponse2003 +type InlineResponse2003 struct { + InAppMessages []map[string]interface{} `json:"in_app_messages,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InlineResponse2003 InlineResponse2003 + +// NewInlineResponse2003 instantiates a new InlineResponse2003 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse2003() *InlineResponse2003 { + this := InlineResponse2003{} + return &this +} + +// NewInlineResponse2003WithDefaults instantiates a new InlineResponse2003 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse2003WithDefaults() *InlineResponse2003 { + this := InlineResponse2003{} + return &this +} + +// GetInAppMessages returns the InAppMessages field value if set, zero value otherwise. +func (o *InlineResponse2003) GetInAppMessages() []map[string]interface{} { + if o == nil || o.InAppMessages == nil { + var ret []map[string]interface{} + return ret + } + return o.InAppMessages +} + +// GetInAppMessagesOk returns a tuple with the InAppMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse2003) GetInAppMessagesOk() ([]map[string]interface{}, bool) { + if o == nil || o.InAppMessages == nil { + return nil, false + } + return o.InAppMessages, true +} + +// HasInAppMessages returns a boolean if a field has been set. +func (o *InlineResponse2003) HasInAppMessages() bool { + if o != nil && o.InAppMessages != nil { + return true + } + + return false +} + +// SetInAppMessages gets a reference to the given []map[string]interface{} and assigns it to the InAppMessages field. +func (o *InlineResponse2003) SetInAppMessages(v []map[string]interface{}) { + o.InAppMessages = v +} + +func (o InlineResponse2003) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.InAppMessages != nil { + toSerialize["in_app_messages"] = o.InAppMessages + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineResponse2003) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse2003 := _InlineResponse2003{} + + if err = json.Unmarshal(bytes, &varInlineResponse2003); err == nil { + *o = InlineResponse2003(varInlineResponse2003) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "in_app_messages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineResponse2003 struct { + value *InlineResponse2003 + isSet bool +} + +func (v NullableInlineResponse2003) Get() *InlineResponse2003 { + return v.value +} + +func (v *NullableInlineResponse2003) Set(val *InlineResponse2003) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse2003) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse2003) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse2003(val *InlineResponse2003) *NullableInlineResponse2003 { + return &NullableInlineResponse2003{value: val, isSet: true} +} + +func (v NullableInlineResponse2003) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse2003) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_inline_response_201.go b/model_inline_response_201.go new file mode 100644 index 0000000..d1d52db --- /dev/null +++ b/model_inline_response_201.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// InlineResponse201 struct for InlineResponse201 +type InlineResponse201 struct { + Subscription *SubscriptionObject `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InlineResponse201 InlineResponse201 + +// NewInlineResponse201 instantiates a new InlineResponse201 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse201() *InlineResponse201 { + this := InlineResponse201{} + return &this +} + +// NewInlineResponse201WithDefaults instantiates a new InlineResponse201 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse201WithDefaults() *InlineResponse201 { + this := InlineResponse201{} + return &this +} + +// GetSubscription returns the Subscription field value if set, zero value otherwise. +func (o *InlineResponse201) GetSubscription() SubscriptionObject { + if o == nil || o.Subscription == nil { + var ret SubscriptionObject + return ret + } + return *o.Subscription +} + +// GetSubscriptionOk returns a tuple with the Subscription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse201) GetSubscriptionOk() (*SubscriptionObject, bool) { + if o == nil || o.Subscription == nil { + return nil, false + } + return o.Subscription, true +} + +// HasSubscription returns a boolean if a field has been set. +func (o *InlineResponse201) HasSubscription() bool { + if o != nil && o.Subscription != nil { + return true + } + + return false +} + +// SetSubscription gets a reference to the given SubscriptionObject and assigns it to the Subscription field. +func (o *InlineResponse201) SetSubscription(v SubscriptionObject) { + o.Subscription = &v +} + +func (o InlineResponse201) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Subscription != nil { + toSerialize["subscription"] = o.Subscription + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineResponse201) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse201 := _InlineResponse201{} + + if err = json.Unmarshal(bytes, &varInlineResponse201); err == nil { + *o = InlineResponse201(varInlineResponse201) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "subscription") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineResponse201 struct { + value *InlineResponse201 + isSet bool +} + +func (v NullableInlineResponse201) Get() *InlineResponse201 { + return v.value +} + +func (v *NullableInlineResponse201) Set(val *InlineResponse201) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse201) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse201) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse201(val *InlineResponse201) *NullableInlineResponse201 { + return &NullableInlineResponse201{value: val, isSet: true} +} + +func (v NullableInlineResponse201) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse201) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_inline_response_202.go b/model_inline_response_202.go new file mode 100644 index 0000000..f690c7b --- /dev/null +++ b/model_inline_response_202.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// InlineResponse202 struct for InlineResponse202 +type InlineResponse202 struct { + Properties *PropertiesObject `json:"properties,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InlineResponse202 InlineResponse202 + +// NewInlineResponse202 instantiates a new InlineResponse202 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse202() *InlineResponse202 { + this := InlineResponse202{} + return &this +} + +// NewInlineResponse202WithDefaults instantiates a new InlineResponse202 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse202WithDefaults() *InlineResponse202 { + this := InlineResponse202{} + return &this +} + +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *InlineResponse202) GetProperties() PropertiesObject { + if o == nil || o.Properties == nil { + var ret PropertiesObject + return ret + } + return *o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse202) GetPropertiesOk() (*PropertiesObject, bool) { + if o == nil || o.Properties == nil { + return nil, false + } + return o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *InlineResponse202) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// SetProperties gets a reference to the given PropertiesObject and assigns it to the Properties field. +func (o *InlineResponse202) SetProperties(v PropertiesObject) { + o.Properties = &v +} + +func (o InlineResponse202) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineResponse202) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse202 := _InlineResponse202{} + + if err = json.Unmarshal(bytes, &varInlineResponse202); err == nil { + *o = InlineResponse202(varInlineResponse202) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "properties") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineResponse202 struct { + value *InlineResponse202 + isSet bool +} + +func (v NullableInlineResponse202) Get() *InlineResponse202 { + return v.value +} + +func (v *NullableInlineResponse202) Set(val *InlineResponse202) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse202) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse202) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse202(val *InlineResponse202) *NullableInlineResponse202 { + return &NullableInlineResponse202{value: val, isSet: true} +} + +func (v NullableInlineResponse202) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse202) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_invalid_identifier_error.go b/model_invalid_identifier_error.go index a1bb0f5..7e40138 100644 --- a/model_invalid_identifier_error.go +++ b/model_invalid_identifier_error.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification.go b/model_notification.go index 680d07f..c9984e9 100644 --- a/model_notification.go +++ b/model_notification.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -23,8 +23,10 @@ type Notification struct { // 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\"] ExcludedSegments []string `json:"excluded_segments,omitempty"` // 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 + // Deprecated IncludePlayerIds []string `json:"include_player_ids,omitempty"` // 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. + // Deprecated IncludeExternalUserIds []string `json:"include_external_user_ids,omitempty"` // 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 IncludeEmailTokens []string `json:"include_email_tokens,omitempty"` @@ -42,6 +44,8 @@ type Notification struct { IncludeChromeWebRegIds []string `json:"include_chrome_web_reg_ids,omitempty"` // 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 IncludeAndroidRegIds []string `json:"include_android_reg_ids,omitempty"` + IncludeAliases NullablePlayerNotificationTargetIncludeAliases `json:"include_aliases,omitempty"` + TargetChannel *string `json:"target_channel,omitempty"` Id *string `json:"id,omitempty"` Value *int32 `json:"value,omitempty"` // Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. @@ -72,7 +76,7 @@ type Notification struct { // 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. AppId string `json:"app_id"` // 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 - ExternalId *string `json:"external_id,omitempty"` + ExternalId NullableString `json:"external_id,omitempty"` Contents NullableStringMap `json:"contents,omitempty"` Headings NullableStringMap `json:"headings,omitempty"` Subtitle NullableStringMap `json:"subtitle,omitempty"` @@ -302,6 +306,7 @@ func (o *Notification) SetExcludedSegments(v []string) { } // GetIncludePlayerIds returns the IncludePlayerIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *Notification) GetIncludePlayerIds() []string { if o == nil { var ret []string @@ -313,6 +318,7 @@ func (o *Notification) GetIncludePlayerIds() []string { // GetIncludePlayerIdsOk returns a tuple with the IncludePlayerIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *Notification) GetIncludePlayerIdsOk() ([]string, bool) { if o == nil || o.IncludePlayerIds == nil { return nil, false @@ -330,11 +336,13 @@ func (o *Notification) HasIncludePlayerIds() bool { } // SetIncludePlayerIds gets a reference to the given []string and assigns it to the IncludePlayerIds field. +// Deprecated func (o *Notification) SetIncludePlayerIds(v []string) { o.IncludePlayerIds = v } // GetIncludeExternalUserIds returns the IncludeExternalUserIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *Notification) GetIncludeExternalUserIds() []string { if o == nil { var ret []string @@ -346,6 +354,7 @@ func (o *Notification) GetIncludeExternalUserIds() []string { // GetIncludeExternalUserIdsOk returns a tuple with the IncludeExternalUserIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *Notification) GetIncludeExternalUserIdsOk() ([]string, bool) { if o == nil || o.IncludeExternalUserIds == nil { return nil, false @@ -363,6 +372,7 @@ func (o *Notification) HasIncludeExternalUserIds() bool { } // SetIncludeExternalUserIds gets a reference to the given []string and assigns it to the IncludeExternalUserIds field. +// Deprecated func (o *Notification) SetIncludeExternalUserIds(v []string) { o.IncludeExternalUserIds = v } @@ -623,6 +633,80 @@ func (o *Notification) SetIncludeAndroidRegIds(v []string) { o.IncludeAndroidRegIds = v } +// GetIncludeAliases returns the IncludeAliases field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Notification) GetIncludeAliases() PlayerNotificationTargetIncludeAliases { + if o == nil || o.IncludeAliases.Get() == nil { + var ret PlayerNotificationTargetIncludeAliases + return ret + } + return *o.IncludeAliases.Get() +} + +// GetIncludeAliasesOk returns a tuple with the IncludeAliases field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Notification) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool) { + if o == nil { + return nil, false + } + return o.IncludeAliases.Get(), o.IncludeAliases.IsSet() +} + +// HasIncludeAliases returns a boolean if a field has been set. +func (o *Notification) HasIncludeAliases() bool { + if o != nil && o.IncludeAliases.IsSet() { + return true + } + + return false +} + +// SetIncludeAliases gets a reference to the given NullablePlayerNotificationTargetIncludeAliases and assigns it to the IncludeAliases field. +func (o *Notification) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases) { + o.IncludeAliases.Set(&v) +} +// SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil +func (o *Notification) SetIncludeAliasesNil() { + o.IncludeAliases.Set(nil) +} + +// UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +func (o *Notification) UnsetIncludeAliases() { + o.IncludeAliases.Unset() +} + +// GetTargetChannel returns the TargetChannel field value if set, zero value otherwise. +func (o *Notification) GetTargetChannel() string { + if o == nil || o.TargetChannel == nil { + var ret string + return ret + } + return *o.TargetChannel +} + +// GetTargetChannelOk returns a tuple with the TargetChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Notification) GetTargetChannelOk() (*string, bool) { + if o == nil || o.TargetChannel == nil { + return nil, false + } + return o.TargetChannel, true +} + +// HasTargetChannel returns a boolean if a field has been set. +func (o *Notification) HasTargetChannel() bool { + if o != nil && o.TargetChannel != nil { + return true + } + + return false +} + +// SetTargetChannel gets a reference to the given string and assigns it to the TargetChannel field. +func (o *Notification) SetTargetChannel(v string) { + o.TargetChannel = &v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *Notification) GetId() string { if o == nil || o.Id == nil { @@ -1237,36 +1321,46 @@ func (o *Notification) SetAppId(v string) { o.AppId = v } -// GetExternalId returns the ExternalId field value if set, zero value otherwise. +// GetExternalId returns the ExternalId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Notification) GetExternalId() string { - if o == nil || o.ExternalId == nil { + if o == nil || o.ExternalId.Get() == nil { var ret string return ret } - return *o.ExternalId + return *o.ExternalId.Get() } // GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Notification) GetExternalIdOk() (*string, bool) { - if o == nil || o.ExternalId == nil { + if o == nil { return nil, false } - return o.ExternalId, true + return o.ExternalId.Get(), o.ExternalId.IsSet() } // HasExternalId returns a boolean if a field has been set. func (o *Notification) HasExternalId() bool { - if o != nil && o.ExternalId != nil { + if o != nil && o.ExternalId.IsSet() { return true } return false } -// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +// SetExternalId gets a reference to the given NullableString and assigns it to the ExternalId field. func (o *Notification) SetExternalId(v string) { - o.ExternalId = &v + o.ExternalId.Set(&v) +} +// SetExternalIdNil sets the value for ExternalId to be an explicit nil +func (o *Notification) SetExternalIdNil() { + o.ExternalId.Set(nil) +} + +// UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil +func (o *Notification) UnsetExternalId() { + o.ExternalId.Unset() } // GetContents returns the Contents field value if set, zero value otherwise (both if not set or set to explicit null). @@ -4211,6 +4305,12 @@ func (o Notification) MarshalJSON() ([]byte, error) { if o.IncludeAndroidRegIds != nil { toSerialize["include_android_reg_ids"] = o.IncludeAndroidRegIds } + if o.IncludeAliases.IsSet() { + toSerialize["include_aliases"] = o.IncludeAliases.Get() + } + if o.TargetChannel != nil { + toSerialize["target_channel"] = o.TargetChannel + } if o.Id != nil { toSerialize["id"] = o.Id } @@ -4259,8 +4359,8 @@ func (o Notification) MarshalJSON() ([]byte, error) { if true { toSerialize["app_id"] = o.AppId } - if o.ExternalId != nil { - toSerialize["external_id"] = o.ExternalId + if o.ExternalId.IsSet() { + toSerialize["external_id"] = o.ExternalId.Get() } if o.Contents.IsSet() { toSerialize["contents"] = o.Contents.Get() @@ -4511,6 +4611,8 @@ func (o *Notification) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "include_chrome_reg_ids") delete(additionalProperties, "include_chrome_web_reg_ids") delete(additionalProperties, "include_android_reg_ids") + delete(additionalProperties, "include_aliases") + delete(additionalProperties, "target_channel") delete(additionalProperties, "id") delete(additionalProperties, "value") delete(additionalProperties, "name") diff --git a/model_notification200_errors.go b/model_notification200_errors.go index 9a09d05..168e8b9 100644 --- a/model_notification200_errors.go +++ b/model_notification200_errors.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification_all_of.go b/model_notification_all_of.go index d13fe22..b70fa4d 100644 --- a/model_notification_all_of.go +++ b/model_notification_all_of.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification_history_success_response.go b/model_notification_history_success_response.go index d421293..5445e4f 100644 --- a/model_notification_history_success_response.go +++ b/model_notification_history_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification_slice.go b/model_notification_slice.go index d526b87..c1e2c38 100644 --- a/model_notification_slice.go +++ b/model_notification_slice.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification_target.go b/model_notification_target.go index 2a35188..9a50507 100644 --- a/model_notification_target.go +++ b/model_notification_target.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_notification_with_meta.go b/model_notification_with_meta.go index 8e6b96e..6b50c31 100644 --- a/model_notification_with_meta.go +++ b/model_notification_with_meta.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -22,8 +22,10 @@ type NotificationWithMeta struct { // 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\"] ExcludedSegments []string `json:"excluded_segments,omitempty"` // 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 + // Deprecated IncludePlayerIds []string `json:"include_player_ids,omitempty"` // 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. + // Deprecated IncludeExternalUserIds []string `json:"include_external_user_ids,omitempty"` // 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 IncludeEmailTokens []string `json:"include_email_tokens,omitempty"` @@ -41,6 +43,8 @@ type NotificationWithMeta struct { IncludeChromeWebRegIds []string `json:"include_chrome_web_reg_ids,omitempty"` // 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 IncludeAndroidRegIds []string `json:"include_android_reg_ids,omitempty"` + IncludeAliases NullablePlayerNotificationTargetIncludeAliases `json:"include_aliases,omitempty"` + TargetChannel *string `json:"target_channel,omitempty"` Id *string `json:"id,omitempty"` Value *int32 `json:"value,omitempty"` // Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. @@ -71,7 +75,7 @@ type NotificationWithMeta struct { // 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. AppId string `json:"app_id"` // 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 - ExternalId *string `json:"external_id,omitempty"` + ExternalId NullableString `json:"external_id,omitempty"` Contents NullableStringMap `json:"contents,omitempty"` Headings NullableStringMap `json:"headings,omitempty"` Subtitle NullableStringMap `json:"subtitle,omitempty"` @@ -319,6 +323,7 @@ func (o *NotificationWithMeta) SetExcludedSegments(v []string) { } // GetIncludePlayerIds returns the IncludePlayerIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *NotificationWithMeta) GetIncludePlayerIds() []string { if o == nil { var ret []string @@ -330,6 +335,7 @@ func (o *NotificationWithMeta) GetIncludePlayerIds() []string { // GetIncludePlayerIdsOk returns a tuple with the IncludePlayerIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *NotificationWithMeta) GetIncludePlayerIdsOk() ([]string, bool) { if o == nil || o.IncludePlayerIds == nil { return nil, false @@ -347,11 +353,13 @@ func (o *NotificationWithMeta) HasIncludePlayerIds() bool { } // SetIncludePlayerIds gets a reference to the given []string and assigns it to the IncludePlayerIds field. +// Deprecated func (o *NotificationWithMeta) SetIncludePlayerIds(v []string) { o.IncludePlayerIds = v } // GetIncludeExternalUserIds returns the IncludeExternalUserIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *NotificationWithMeta) GetIncludeExternalUserIds() []string { if o == nil { var ret []string @@ -363,6 +371,7 @@ func (o *NotificationWithMeta) GetIncludeExternalUserIds() []string { // GetIncludeExternalUserIdsOk returns a tuple with the IncludeExternalUserIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *NotificationWithMeta) GetIncludeExternalUserIdsOk() ([]string, bool) { if o == nil || o.IncludeExternalUserIds == nil { return nil, false @@ -380,6 +389,7 @@ func (o *NotificationWithMeta) HasIncludeExternalUserIds() bool { } // SetIncludeExternalUserIds gets a reference to the given []string and assigns it to the IncludeExternalUserIds field. +// Deprecated func (o *NotificationWithMeta) SetIncludeExternalUserIds(v []string) { o.IncludeExternalUserIds = v } @@ -640,6 +650,80 @@ func (o *NotificationWithMeta) SetIncludeAndroidRegIds(v []string) { o.IncludeAndroidRegIds = v } +// GetIncludeAliases returns the IncludeAliases field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationWithMeta) GetIncludeAliases() PlayerNotificationTargetIncludeAliases { + if o == nil || o.IncludeAliases.Get() == nil { + var ret PlayerNotificationTargetIncludeAliases + return ret + } + return *o.IncludeAliases.Get() +} + +// GetIncludeAliasesOk returns a tuple with the IncludeAliases field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationWithMeta) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool) { + if o == nil { + return nil, false + } + return o.IncludeAliases.Get(), o.IncludeAliases.IsSet() +} + +// HasIncludeAliases returns a boolean if a field has been set. +func (o *NotificationWithMeta) HasIncludeAliases() bool { + if o != nil && o.IncludeAliases.IsSet() { + return true + } + + return false +} + +// SetIncludeAliases gets a reference to the given NullablePlayerNotificationTargetIncludeAliases and assigns it to the IncludeAliases field. +func (o *NotificationWithMeta) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases) { + o.IncludeAliases.Set(&v) +} +// SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil +func (o *NotificationWithMeta) SetIncludeAliasesNil() { + o.IncludeAliases.Set(nil) +} + +// UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +func (o *NotificationWithMeta) UnsetIncludeAliases() { + o.IncludeAliases.Unset() +} + +// GetTargetChannel returns the TargetChannel field value if set, zero value otherwise. +func (o *NotificationWithMeta) GetTargetChannel() string { + if o == nil || o.TargetChannel == nil { + var ret string + return ret + } + return *o.TargetChannel +} + +// GetTargetChannelOk returns a tuple with the TargetChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationWithMeta) GetTargetChannelOk() (*string, bool) { + if o == nil || o.TargetChannel == nil { + return nil, false + } + return o.TargetChannel, true +} + +// HasTargetChannel returns a boolean if a field has been set. +func (o *NotificationWithMeta) HasTargetChannel() bool { + if o != nil && o.TargetChannel != nil { + return true + } + + return false +} + +// SetTargetChannel gets a reference to the given string and assigns it to the TargetChannel field. +func (o *NotificationWithMeta) SetTargetChannel(v string) { + o.TargetChannel = &v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *NotificationWithMeta) GetId() string { if o == nil || o.Id == nil { @@ -1254,36 +1338,46 @@ func (o *NotificationWithMeta) SetAppId(v string) { o.AppId = v } -// GetExternalId returns the ExternalId field value if set, zero value otherwise. +// GetExternalId returns the ExternalId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NotificationWithMeta) GetExternalId() string { - if o == nil || o.ExternalId == nil { + if o == nil || o.ExternalId.Get() == nil { var ret string return ret } - return *o.ExternalId + return *o.ExternalId.Get() } // GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NotificationWithMeta) GetExternalIdOk() (*string, bool) { - if o == nil || o.ExternalId == nil { + if o == nil { return nil, false } - return o.ExternalId, true + return o.ExternalId.Get(), o.ExternalId.IsSet() } // HasExternalId returns a boolean if a field has been set. func (o *NotificationWithMeta) HasExternalId() bool { - if o != nil && o.ExternalId != nil { + if o != nil && o.ExternalId.IsSet() { return true } return false } -// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +// SetExternalId gets a reference to the given NullableString and assigns it to the ExternalId field. func (o *NotificationWithMeta) SetExternalId(v string) { - o.ExternalId = &v + o.ExternalId.Set(&v) +} +// SetExternalIdNil sets the value for ExternalId to be an explicit nil +func (o *NotificationWithMeta) SetExternalIdNil() { + o.ExternalId.Set(nil) +} + +// UnsetExternalId ensures that no value is present for ExternalId, not even an explicit nil +func (o *NotificationWithMeta) UnsetExternalId() { + o.ExternalId.Unset() } // GetContents returns the Contents field value if set, zero value otherwise (both if not set or set to explicit null). @@ -4568,6 +4662,12 @@ func (o NotificationWithMeta) MarshalJSON() ([]byte, error) { if o.IncludeAndroidRegIds != nil { toSerialize["include_android_reg_ids"] = o.IncludeAndroidRegIds } + if o.IncludeAliases.IsSet() { + toSerialize["include_aliases"] = o.IncludeAliases.Get() + } + if o.TargetChannel != nil { + toSerialize["target_channel"] = o.TargetChannel + } if o.Id != nil { toSerialize["id"] = o.Id } @@ -4616,8 +4716,8 @@ func (o NotificationWithMeta) MarshalJSON() ([]byte, error) { if true { toSerialize["app_id"] = o.AppId } - if o.ExternalId != nil { - toSerialize["external_id"] = o.ExternalId + if o.ExternalId.IsSet() { + toSerialize["external_id"] = o.ExternalId.Get() } if o.Contents.IsSet() { toSerialize["contents"] = o.Contents.Get() @@ -4898,6 +4998,8 @@ func (o *NotificationWithMeta) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "include_chrome_reg_ids") delete(additionalProperties, "include_chrome_web_reg_ids") delete(additionalProperties, "include_android_reg_ids") + delete(additionalProperties, "include_aliases") + delete(additionalProperties, "target_channel") delete(additionalProperties, "id") delete(additionalProperties, "value") delete(additionalProperties, "name") diff --git a/model_notification_with_meta_all_of.go b/model_notification_with_meta_all_of.go index e81c01d..cf39cb2 100644 --- a/model_notification_with_meta_all_of.go +++ b/model_notification_with_meta_all_of.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_operator.go b/model_operator.go index 9b96087..eddd4f8 100644 --- a/model_operator.go +++ b/model_operator.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_outcome_data.go b/model_outcome_data.go index ed2a36a..83b6e40 100644 --- a/model_outcome_data.go +++ b/model_outcome_data.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_outcomes_data.go b/model_outcomes_data.go index ec55a87..d0b9c17 100644 --- a/model_outcomes_data.go +++ b/model_outcomes_data.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_platform_delivery_data.go b/model_platform_delivery_data.go index 4434568..e4be921 100644 --- a/model_platform_delivery_data.go +++ b/model_platform_delivery_data.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_platform_delivery_data_email_all_of.go b/model_platform_delivery_data_email_all_of.go index 7c25112..7749162 100644 --- a/model_platform_delivery_data_email_all_of.go +++ b/model_platform_delivery_data_email_all_of.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_platform_delivery_data_sms_all_of.go b/model_platform_delivery_data_sms_all_of.go index 6b8f80b..d8df5df 100644 --- a/model_platform_delivery_data_sms_all_of.go +++ b/model_platform_delivery_data_sms_all_of.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_player.go b/model_player.go index b32deb2..a52d1fa 100644 --- a/model_player.go +++ b/model_player.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_player_notification_target.go b/model_player_notification_target.go index a660891..c6f95ec 100644 --- a/model_player_notification_target.go +++ b/model_player_notification_target.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -18,8 +18,10 @@ import ( // PlayerNotificationTarget struct for PlayerNotificationTarget type PlayerNotificationTarget struct { // 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 + // Deprecated IncludePlayerIds []string `json:"include_player_ids,omitempty"` // 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. + // Deprecated IncludeExternalUserIds []string `json:"include_external_user_ids,omitempty"` // 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 IncludeEmailTokens []string `json:"include_email_tokens,omitempty"` @@ -37,6 +39,8 @@ type PlayerNotificationTarget struct { IncludeChromeWebRegIds []string `json:"include_chrome_web_reg_ids,omitempty"` // 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 IncludeAndroidRegIds []string `json:"include_android_reg_ids,omitempty"` + IncludeAliases NullablePlayerNotificationTargetIncludeAliases `json:"include_aliases,omitempty"` + TargetChannel *string `json:"target_channel,omitempty"` AdditionalProperties map[string]interface{} } @@ -60,6 +64,7 @@ func NewPlayerNotificationTargetWithDefaults() *PlayerNotificationTarget { } // GetIncludePlayerIds returns the IncludePlayerIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *PlayerNotificationTarget) GetIncludePlayerIds() []string { if o == nil { var ret []string @@ -71,6 +76,7 @@ func (o *PlayerNotificationTarget) GetIncludePlayerIds() []string { // GetIncludePlayerIdsOk returns a tuple with the IncludePlayerIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *PlayerNotificationTarget) GetIncludePlayerIdsOk() ([]string, bool) { if o == nil || o.IncludePlayerIds == nil { return nil, false @@ -88,11 +94,13 @@ func (o *PlayerNotificationTarget) HasIncludePlayerIds() bool { } // SetIncludePlayerIds gets a reference to the given []string and assigns it to the IncludePlayerIds field. +// Deprecated func (o *PlayerNotificationTarget) SetIncludePlayerIds(v []string) { o.IncludePlayerIds = v } // GetIncludeExternalUserIds returns the IncludeExternalUserIds field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *PlayerNotificationTarget) GetIncludeExternalUserIds() []string { if o == nil { var ret []string @@ -104,6 +112,7 @@ func (o *PlayerNotificationTarget) GetIncludeExternalUserIds() []string { // GetIncludeExternalUserIdsOk returns a tuple with the IncludeExternalUserIds field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated func (o *PlayerNotificationTarget) GetIncludeExternalUserIdsOk() ([]string, bool) { if o == nil || o.IncludeExternalUserIds == nil { return nil, false @@ -121,6 +130,7 @@ func (o *PlayerNotificationTarget) HasIncludeExternalUserIds() bool { } // SetIncludeExternalUserIds gets a reference to the given []string and assigns it to the IncludeExternalUserIds field. +// Deprecated func (o *PlayerNotificationTarget) SetIncludeExternalUserIds(v []string) { o.IncludeExternalUserIds = v } @@ -381,6 +391,80 @@ func (o *PlayerNotificationTarget) SetIncludeAndroidRegIds(v []string) { o.IncludeAndroidRegIds = v } +// GetIncludeAliases returns the IncludeAliases field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlayerNotificationTarget) GetIncludeAliases() PlayerNotificationTargetIncludeAliases { + if o == nil || o.IncludeAliases.Get() == nil { + var ret PlayerNotificationTargetIncludeAliases + return ret + } + return *o.IncludeAliases.Get() +} + +// GetIncludeAliasesOk returns a tuple with the IncludeAliases field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlayerNotificationTarget) GetIncludeAliasesOk() (*PlayerNotificationTargetIncludeAliases, bool) { + if o == nil { + return nil, false + } + return o.IncludeAliases.Get(), o.IncludeAliases.IsSet() +} + +// HasIncludeAliases returns a boolean if a field has been set. +func (o *PlayerNotificationTarget) HasIncludeAliases() bool { + if o != nil && o.IncludeAliases.IsSet() { + return true + } + + return false +} + +// SetIncludeAliases gets a reference to the given NullablePlayerNotificationTargetIncludeAliases and assigns it to the IncludeAliases field. +func (o *PlayerNotificationTarget) SetIncludeAliases(v PlayerNotificationTargetIncludeAliases) { + o.IncludeAliases.Set(&v) +} +// SetIncludeAliasesNil sets the value for IncludeAliases to be an explicit nil +func (o *PlayerNotificationTarget) SetIncludeAliasesNil() { + o.IncludeAliases.Set(nil) +} + +// UnsetIncludeAliases ensures that no value is present for IncludeAliases, not even an explicit nil +func (o *PlayerNotificationTarget) UnsetIncludeAliases() { + o.IncludeAliases.Unset() +} + +// GetTargetChannel returns the TargetChannel field value if set, zero value otherwise. +func (o *PlayerNotificationTarget) GetTargetChannel() string { + if o == nil || o.TargetChannel == nil { + var ret string + return ret + } + return *o.TargetChannel +} + +// GetTargetChannelOk returns a tuple with the TargetChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlayerNotificationTarget) GetTargetChannelOk() (*string, bool) { + if o == nil || o.TargetChannel == nil { + return nil, false + } + return o.TargetChannel, true +} + +// HasTargetChannel returns a boolean if a field has been set. +func (o *PlayerNotificationTarget) HasTargetChannel() bool { + if o != nil && o.TargetChannel != nil { + return true + } + + return false +} + +// SetTargetChannel gets a reference to the given string and assigns it to the TargetChannel field. +func (o *PlayerNotificationTarget) SetTargetChannel(v string) { + o.TargetChannel = &v +} + func (o PlayerNotificationTarget) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.IncludePlayerIds != nil { @@ -413,6 +497,12 @@ func (o PlayerNotificationTarget) MarshalJSON() ([]byte, error) { if o.IncludeAndroidRegIds != nil { toSerialize["include_android_reg_ids"] = o.IncludeAndroidRegIds } + if o.IncludeAliases.IsSet() { + toSerialize["include_aliases"] = o.IncludeAliases.Get() + } + if o.TargetChannel != nil { + toSerialize["target_channel"] = o.TargetChannel + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -441,6 +531,8 @@ func (o *PlayerNotificationTarget) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "include_chrome_reg_ids") delete(additionalProperties, "include_chrome_web_reg_ids") delete(additionalProperties, "include_android_reg_ids") + delete(additionalProperties, "include_aliases") + delete(additionalProperties, "target_channel") o.AdditionalProperties = additionalProperties } diff --git a/model_player_notification_target_include_aliases.go b/model_player_notification_target_include_aliases.go new file mode 100644 index 0000000..39a179e --- /dev/null +++ b/model_player_notification_target_include_aliases.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// PlayerNotificationTargetIncludeAliases struct for PlayerNotificationTargetIncludeAliases +type PlayerNotificationTargetIncludeAliases struct { + AliasLabel []string `json:"alias_label,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlayerNotificationTargetIncludeAliases PlayerNotificationTargetIncludeAliases + +// NewPlayerNotificationTargetIncludeAliases instantiates a new PlayerNotificationTargetIncludeAliases object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlayerNotificationTargetIncludeAliases() *PlayerNotificationTargetIncludeAliases { + this := PlayerNotificationTargetIncludeAliases{} + return &this +} + +// NewPlayerNotificationTargetIncludeAliasesWithDefaults instantiates a new PlayerNotificationTargetIncludeAliases object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlayerNotificationTargetIncludeAliasesWithDefaults() *PlayerNotificationTargetIncludeAliases { + this := PlayerNotificationTargetIncludeAliases{} + return &this +} + +// GetAliasLabel returns the AliasLabel field value if set, zero value otherwise. +func (o *PlayerNotificationTargetIncludeAliases) GetAliasLabel() []string { + if o == nil || o.AliasLabel == nil { + var ret []string + return ret + } + return o.AliasLabel +} + +// GetAliasLabelOk returns a tuple with the AliasLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlayerNotificationTargetIncludeAliases) GetAliasLabelOk() ([]string, bool) { + if o == nil || o.AliasLabel == nil { + return nil, false + } + return o.AliasLabel, true +} + +// HasAliasLabel returns a boolean if a field has been set. +func (o *PlayerNotificationTargetIncludeAliases) HasAliasLabel() bool { + if o != nil && o.AliasLabel != nil { + return true + } + + return false +} + +// SetAliasLabel gets a reference to the given []string and assigns it to the AliasLabel field. +func (o *PlayerNotificationTargetIncludeAliases) SetAliasLabel(v []string) { + o.AliasLabel = v +} + +func (o PlayerNotificationTargetIncludeAliases) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AliasLabel != nil { + toSerialize["alias_label"] = o.AliasLabel + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *PlayerNotificationTargetIncludeAliases) UnmarshalJSON(bytes []byte) (err error) { + varPlayerNotificationTargetIncludeAliases := _PlayerNotificationTargetIncludeAliases{} + + if err = json.Unmarshal(bytes, &varPlayerNotificationTargetIncludeAliases); err == nil { + *o = PlayerNotificationTargetIncludeAliases(varPlayerNotificationTargetIncludeAliases) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "alias_label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlayerNotificationTargetIncludeAliases struct { + value *PlayerNotificationTargetIncludeAliases + isSet bool +} + +func (v NullablePlayerNotificationTargetIncludeAliases) Get() *PlayerNotificationTargetIncludeAliases { + return v.value +} + +func (v *NullablePlayerNotificationTargetIncludeAliases) Set(val *PlayerNotificationTargetIncludeAliases) { + v.value = val + v.isSet = true +} + +func (v NullablePlayerNotificationTargetIncludeAliases) IsSet() bool { + return v.isSet +} + +func (v *NullablePlayerNotificationTargetIncludeAliases) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlayerNotificationTargetIncludeAliases(val *PlayerNotificationTargetIncludeAliases) *NullablePlayerNotificationTargetIncludeAliases { + return &NullablePlayerNotificationTargetIncludeAliases{value: val, isSet: true} +} + +func (v NullablePlayerNotificationTargetIncludeAliases) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlayerNotificationTargetIncludeAliases) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_player_slice.go b/model_player_slice.go index cc43d67..fa01214 100644 --- a/model_player_slice.go +++ b/model_player_slice.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_properties_deltas.go b/model_properties_deltas.go new file mode 100644 index 0000000..0820c2c --- /dev/null +++ b/model_properties_deltas.go @@ -0,0 +1,215 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// PropertiesDeltas struct for PropertiesDeltas +type PropertiesDeltas struct { + SessionTime *float32 `json:"session_time,omitempty"` + SessionCount *float32 `json:"session_count,omitempty"` + Purchases []Purchase `json:"purchases,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PropertiesDeltas PropertiesDeltas + +// NewPropertiesDeltas instantiates a new PropertiesDeltas object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertiesDeltas() *PropertiesDeltas { + this := PropertiesDeltas{} + return &this +} + +// NewPropertiesDeltasWithDefaults instantiates a new PropertiesDeltas object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertiesDeltasWithDefaults() *PropertiesDeltas { + this := PropertiesDeltas{} + return &this +} + +// GetSessionTime returns the SessionTime field value if set, zero value otherwise. +func (o *PropertiesDeltas) GetSessionTime() float32 { + if o == nil || o.SessionTime == nil { + var ret float32 + return ret + } + return *o.SessionTime +} + +// GetSessionTimeOk returns a tuple with the SessionTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesDeltas) GetSessionTimeOk() (*float32, bool) { + if o == nil || o.SessionTime == nil { + return nil, false + } + return o.SessionTime, true +} + +// HasSessionTime returns a boolean if a field has been set. +func (o *PropertiesDeltas) HasSessionTime() bool { + if o != nil && o.SessionTime != nil { + return true + } + + return false +} + +// SetSessionTime gets a reference to the given float32 and assigns it to the SessionTime field. +func (o *PropertiesDeltas) SetSessionTime(v float32) { + o.SessionTime = &v +} + +// GetSessionCount returns the SessionCount field value if set, zero value otherwise. +func (o *PropertiesDeltas) GetSessionCount() float32 { + if o == nil || o.SessionCount == nil { + var ret float32 + return ret + } + return *o.SessionCount +} + +// GetSessionCountOk returns a tuple with the SessionCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesDeltas) GetSessionCountOk() (*float32, bool) { + if o == nil || o.SessionCount == nil { + return nil, false + } + return o.SessionCount, true +} + +// HasSessionCount returns a boolean if a field has been set. +func (o *PropertiesDeltas) HasSessionCount() bool { + if o != nil && o.SessionCount != nil { + return true + } + + return false +} + +// SetSessionCount gets a reference to the given float32 and assigns it to the SessionCount field. +func (o *PropertiesDeltas) SetSessionCount(v float32) { + o.SessionCount = &v +} + +// GetPurchases returns the Purchases field value if set, zero value otherwise. +func (o *PropertiesDeltas) GetPurchases() []Purchase { + if o == nil || o.Purchases == nil { + var ret []Purchase + return ret + } + return o.Purchases +} + +// GetPurchasesOk returns a tuple with the Purchases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesDeltas) GetPurchasesOk() ([]Purchase, bool) { + if o == nil || o.Purchases == nil { + return nil, false + } + return o.Purchases, true +} + +// HasPurchases returns a boolean if a field has been set. +func (o *PropertiesDeltas) HasPurchases() bool { + if o != nil && o.Purchases != nil { + return true + } + + return false +} + +// SetPurchases gets a reference to the given []Purchase and assigns it to the Purchases field. +func (o *PropertiesDeltas) SetPurchases(v []Purchase) { + o.Purchases = v +} + +func (o PropertiesDeltas) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SessionTime != nil { + toSerialize["session_time"] = o.SessionTime + } + if o.SessionCount != nil { + toSerialize["session_count"] = o.SessionCount + } + if o.Purchases != nil { + toSerialize["purchases"] = o.Purchases + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *PropertiesDeltas) UnmarshalJSON(bytes []byte) (err error) { + varPropertiesDeltas := _PropertiesDeltas{} + + if err = json.Unmarshal(bytes, &varPropertiesDeltas); err == nil { + *o = PropertiesDeltas(varPropertiesDeltas) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "session_time") + delete(additionalProperties, "session_count") + delete(additionalProperties, "purchases") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertiesDeltas struct { + value *PropertiesDeltas + isSet bool +} + +func (v NullablePropertiesDeltas) Get() *PropertiesDeltas { + return v.value +} + +func (v *NullablePropertiesDeltas) Set(val *PropertiesDeltas) { + v.value = val + v.isSet = true +} + +func (v NullablePropertiesDeltas) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertiesDeltas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertiesDeltas(val *PropertiesDeltas) *NullablePropertiesDeltas { + return &NullablePropertiesDeltas{value: val, isSet: true} +} + +func (v NullablePropertiesDeltas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertiesDeltas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_properties_object.go b/model_properties_object.go new file mode 100644 index 0000000..8749778 --- /dev/null +++ b/model_properties_object.go @@ -0,0 +1,511 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// PropertiesObject struct for PropertiesObject +type PropertiesObject struct { + Tags map[string]interface{} `json:"tags,omitempty"` + Language *string `json:"language,omitempty"` + TimezoneId *string `json:"timezone_id,omitempty"` + Lat *float32 `json:"lat,omitempty"` + Long *float32 `json:"long,omitempty"` + Country *string `json:"country,omitempty"` + FirstActive *float32 `json:"first_active,omitempty"` + LastActive *float32 `json:"last_active,omitempty"` + AmountSpent *float32 `json:"amount_spent,omitempty"` + Purchases []Purchase `json:"purchases,omitempty"` + Ip *string `json:"ip,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PropertiesObject PropertiesObject + +// NewPropertiesObject instantiates a new PropertiesObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertiesObject() *PropertiesObject { + this := PropertiesObject{} + return &this +} + +// NewPropertiesObjectWithDefaults instantiates a new PropertiesObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertiesObjectWithDefaults() *PropertiesObject { + this := PropertiesObject{} + return &this +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *PropertiesObject) GetTags() map[string]interface{} { + if o == nil || o.Tags == nil { + var ret map[string]interface{} + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetTagsOk() (map[string]interface{}, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *PropertiesObject) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]interface{} and assigns it to the Tags field. +func (o *PropertiesObject) SetTags(v map[string]interface{}) { + o.Tags = v +} + +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *PropertiesObject) GetLanguage() string { + if o == nil || o.Language == nil { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetLanguageOk() (*string, bool) { + if o == nil || o.Language == nil { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *PropertiesObject) HasLanguage() bool { + if o != nil && o.Language != nil { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *PropertiesObject) SetLanguage(v string) { + o.Language = &v +} + +// GetTimezoneId returns the TimezoneId field value if set, zero value otherwise. +func (o *PropertiesObject) GetTimezoneId() string { + if o == nil || o.TimezoneId == nil { + var ret string + return ret + } + return *o.TimezoneId +} + +// GetTimezoneIdOk returns a tuple with the TimezoneId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetTimezoneIdOk() (*string, bool) { + if o == nil || o.TimezoneId == nil { + return nil, false + } + return o.TimezoneId, true +} + +// HasTimezoneId returns a boolean if a field has been set. +func (o *PropertiesObject) HasTimezoneId() bool { + if o != nil && o.TimezoneId != nil { + return true + } + + return false +} + +// SetTimezoneId gets a reference to the given string and assigns it to the TimezoneId field. +func (o *PropertiesObject) SetTimezoneId(v string) { + o.TimezoneId = &v +} + +// GetLat returns the Lat field value if set, zero value otherwise. +func (o *PropertiesObject) GetLat() float32 { + if o == nil || o.Lat == nil { + var ret float32 + return ret + } + return *o.Lat +} + +// GetLatOk returns a tuple with the Lat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetLatOk() (*float32, bool) { + if o == nil || o.Lat == nil { + return nil, false + } + return o.Lat, true +} + +// HasLat returns a boolean if a field has been set. +func (o *PropertiesObject) HasLat() bool { + if o != nil && o.Lat != nil { + return true + } + + return false +} + +// SetLat gets a reference to the given float32 and assigns it to the Lat field. +func (o *PropertiesObject) SetLat(v float32) { + o.Lat = &v +} + +// GetLong returns the Long field value if set, zero value otherwise. +func (o *PropertiesObject) GetLong() float32 { + if o == nil || o.Long == nil { + var ret float32 + return ret + } + return *o.Long +} + +// GetLongOk returns a tuple with the Long field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetLongOk() (*float32, bool) { + if o == nil || o.Long == nil { + return nil, false + } + return o.Long, true +} + +// HasLong returns a boolean if a field has been set. +func (o *PropertiesObject) HasLong() bool { + if o != nil && o.Long != nil { + return true + } + + return false +} + +// SetLong gets a reference to the given float32 and assigns it to the Long field. +func (o *PropertiesObject) SetLong(v float32) { + o.Long = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *PropertiesObject) GetCountry() string { + if o == nil || o.Country == nil { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetCountryOk() (*string, bool) { + if o == nil || o.Country == nil { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *PropertiesObject) HasCountry() bool { + if o != nil && o.Country != nil { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *PropertiesObject) SetCountry(v string) { + o.Country = &v +} + +// GetFirstActive returns the FirstActive field value if set, zero value otherwise. +func (o *PropertiesObject) GetFirstActive() float32 { + if o == nil || o.FirstActive == nil { + var ret float32 + return ret + } + return *o.FirstActive +} + +// GetFirstActiveOk returns a tuple with the FirstActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetFirstActiveOk() (*float32, bool) { + if o == nil || o.FirstActive == nil { + return nil, false + } + return o.FirstActive, true +} + +// HasFirstActive returns a boolean if a field has been set. +func (o *PropertiesObject) HasFirstActive() bool { + if o != nil && o.FirstActive != nil { + return true + } + + return false +} + +// SetFirstActive gets a reference to the given float32 and assigns it to the FirstActive field. +func (o *PropertiesObject) SetFirstActive(v float32) { + o.FirstActive = &v +} + +// GetLastActive returns the LastActive field value if set, zero value otherwise. +func (o *PropertiesObject) GetLastActive() float32 { + if o == nil || o.LastActive == nil { + var ret float32 + return ret + } + return *o.LastActive +} + +// GetLastActiveOk returns a tuple with the LastActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetLastActiveOk() (*float32, bool) { + if o == nil || o.LastActive == nil { + return nil, false + } + return o.LastActive, true +} + +// HasLastActive returns a boolean if a field has been set. +func (o *PropertiesObject) HasLastActive() bool { + if o != nil && o.LastActive != nil { + return true + } + + return false +} + +// SetLastActive gets a reference to the given float32 and assigns it to the LastActive field. +func (o *PropertiesObject) SetLastActive(v float32) { + o.LastActive = &v +} + +// GetAmountSpent returns the AmountSpent field value if set, zero value otherwise. +func (o *PropertiesObject) GetAmountSpent() float32 { + if o == nil || o.AmountSpent == nil { + var ret float32 + return ret + } + return *o.AmountSpent +} + +// GetAmountSpentOk returns a tuple with the AmountSpent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetAmountSpentOk() (*float32, bool) { + if o == nil || o.AmountSpent == nil { + return nil, false + } + return o.AmountSpent, true +} + +// HasAmountSpent returns a boolean if a field has been set. +func (o *PropertiesObject) HasAmountSpent() bool { + if o != nil && o.AmountSpent != nil { + return true + } + + return false +} + +// SetAmountSpent gets a reference to the given float32 and assigns it to the AmountSpent field. +func (o *PropertiesObject) SetAmountSpent(v float32) { + o.AmountSpent = &v +} + +// GetPurchases returns the Purchases field value if set, zero value otherwise. +func (o *PropertiesObject) GetPurchases() []Purchase { + if o == nil || o.Purchases == nil { + var ret []Purchase + return ret + } + return o.Purchases +} + +// GetPurchasesOk returns a tuple with the Purchases field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetPurchasesOk() ([]Purchase, bool) { + if o == nil || o.Purchases == nil { + return nil, false + } + return o.Purchases, true +} + +// HasPurchases returns a boolean if a field has been set. +func (o *PropertiesObject) HasPurchases() bool { + if o != nil && o.Purchases != nil { + return true + } + + return false +} + +// SetPurchases gets a reference to the given []Purchase and assigns it to the Purchases field. +func (o *PropertiesObject) SetPurchases(v []Purchase) { + o.Purchases = v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *PropertiesObject) GetIp() string { + if o == nil || o.Ip == nil { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertiesObject) GetIpOk() (*string, bool) { + if o == nil || o.Ip == nil { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *PropertiesObject) HasIp() bool { + if o != nil && o.Ip != nil { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *PropertiesObject) SetIp(v string) { + o.Ip = &v +} + +func (o PropertiesObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Language != nil { + toSerialize["language"] = o.Language + } + if o.TimezoneId != nil { + toSerialize["timezone_id"] = o.TimezoneId + } + if o.Lat != nil { + toSerialize["lat"] = o.Lat + } + if o.Long != nil { + toSerialize["long"] = o.Long + } + if o.Country != nil { + toSerialize["country"] = o.Country + } + if o.FirstActive != nil { + toSerialize["first_active"] = o.FirstActive + } + if o.LastActive != nil { + toSerialize["last_active"] = o.LastActive + } + if o.AmountSpent != nil { + toSerialize["amount_spent"] = o.AmountSpent + } + if o.Purchases != nil { + toSerialize["purchases"] = o.Purchases + } + if o.Ip != nil { + toSerialize["ip"] = o.Ip + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *PropertiesObject) UnmarshalJSON(bytes []byte) (err error) { + varPropertiesObject := _PropertiesObject{} + + if err = json.Unmarshal(bytes, &varPropertiesObject); err == nil { + *o = PropertiesObject(varPropertiesObject) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "tags") + delete(additionalProperties, "language") + delete(additionalProperties, "timezone_id") + delete(additionalProperties, "lat") + delete(additionalProperties, "long") + delete(additionalProperties, "country") + delete(additionalProperties, "first_active") + delete(additionalProperties, "last_active") + delete(additionalProperties, "amount_spent") + delete(additionalProperties, "purchases") + delete(additionalProperties, "ip") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertiesObject struct { + value *PropertiesObject + isSet bool +} + +func (v NullablePropertiesObject) Get() *PropertiesObject { + return v.value +} + +func (v *NullablePropertiesObject) Set(val *PropertiesObject) { + v.value = val + v.isSet = true +} + +func (v NullablePropertiesObject) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertiesObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertiesObject(val *PropertiesObject) *NullablePropertiesObject { + return &NullablePropertiesObject{value: val, isSet: true} +} + +func (v NullablePropertiesObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertiesObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_purchase.go b/model_purchase.go index 61d9dfc..adf06b6 100644 --- a/model_purchase.go +++ b/model_purchase.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ @@ -20,9 +20,10 @@ type Purchase struct { // The unique identifier of the purchased item. Sku string `json:"sku"` // The amount, in USD, spent purchasing the item. - Amount float32 `json:"amount"` + Amount string `json:"amount"` // The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. Iso string `json:"iso"` + Count *float32 `json:"count,omitempty"` AdditionalProperties map[string]interface{} } @@ -32,7 +33,7 @@ type _Purchase Purchase // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPurchase(sku string, amount float32, iso string) *Purchase { +func NewPurchase(sku string, amount string, iso string) *Purchase { this := Purchase{} this.Sku = sku this.Amount = amount @@ -73,9 +74,9 @@ func (o *Purchase) SetSku(v string) { } // GetAmount returns the Amount field value -func (o *Purchase) GetAmount() float32 { +func (o *Purchase) GetAmount() string { if o == nil { - var ret float32 + var ret string return ret } @@ -84,7 +85,7 @@ func (o *Purchase) GetAmount() float32 { // GetAmountOk returns a tuple with the Amount field value // and a boolean to check if the value has been set. -func (o *Purchase) GetAmountOk() (*float32, bool) { +func (o *Purchase) GetAmountOk() (*string, bool) { if o == nil { return nil, false } @@ -92,7 +93,7 @@ func (o *Purchase) GetAmountOk() (*float32, bool) { } // SetAmount sets field value -func (o *Purchase) SetAmount(v float32) { +func (o *Purchase) SetAmount(v string) { o.Amount = v } @@ -120,6 +121,38 @@ func (o *Purchase) SetIso(v string) { o.Iso = v } +// GetCount returns the Count field value if set, zero value otherwise. +func (o *Purchase) GetCount() float32 { + if o == nil || o.Count == nil { + var ret float32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchase) GetCountOk() (*float32, bool) { + if o == nil || o.Count == nil { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *Purchase) HasCount() bool { + if o != nil && o.Count != nil { + return true + } + + return false +} + +// SetCount gets a reference to the given float32 and assigns it to the Count field. +func (o *Purchase) SetCount(v float32) { + o.Count = &v +} + func (o Purchase) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { @@ -131,6 +164,9 @@ func (o Purchase) MarshalJSON() ([]byte, error) { if true { toSerialize["iso"] = o.Iso } + if o.Count != nil { + toSerialize["count"] = o.Count + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -152,6 +188,7 @@ func (o *Purchase) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "sku") delete(additionalProperties, "amount") delete(additionalProperties, "iso") + delete(additionalProperties, "count") o.AdditionalProperties = additionalProperties } diff --git a/model_segment.go b/model_segment.go index d0eebb7..40f243b 100644 --- a/model_segment.go +++ b/model_segment.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_segment_notification_target.go b/model_segment_notification_target.go index 6e5f321..61b2986 100644 --- a/model_segment_notification_target.go +++ b/model_segment_notification_target.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_string_map.go b/model_string_map.go index 1929762..c64a15d 100644 --- a/model_string_map.go +++ b/model_string_map.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_subscription_object.go b/model_subscription_object.go new file mode 100644 index 0000000..167040e --- /dev/null +++ b/model_subscription_object.go @@ -0,0 +1,733 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// SubscriptionObject struct for SubscriptionObject +type SubscriptionObject struct { + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Token *string `json:"token,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + NotificationTypes *float32 `json:"notification_types,omitempty"` + SessionTime *float32 `json:"session_time,omitempty"` + SessionCount *float32 `json:"session_count,omitempty"` + Sdk *string `json:"sdk,omitempty"` + DeviceModel *string `json:"device_model,omitempty"` + DeviceOs *string `json:"device_os,omitempty"` + Rooted *bool `json:"rooted,omitempty"` + TestType *float32 `json:"test_type,omitempty"` + AppVersion *string `json:"app_version,omitempty"` + NetType *float32 `json:"net_type,omitempty"` + Carrier *string `json:"carrier,omitempty"` + WebAuth *string `json:"web_auth,omitempty"` + WebP256 *string `json:"web_p256,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SubscriptionObject SubscriptionObject + +// NewSubscriptionObject instantiates a new SubscriptionObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSubscriptionObject() *SubscriptionObject { + this := SubscriptionObject{} + return &this +} + +// NewSubscriptionObjectWithDefaults instantiates a new SubscriptionObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSubscriptionObjectWithDefaults() *SubscriptionObject { + this := SubscriptionObject{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SubscriptionObject) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SubscriptionObject) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SubscriptionObject) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SubscriptionObject) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SubscriptionObject) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SubscriptionObject) SetType(v string) { + o.Type = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *SubscriptionObject) GetToken() string { + if o == nil || o.Token == nil { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetTokenOk() (*string, bool) { + if o == nil || o.Token == nil { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *SubscriptionObject) HasToken() bool { + if o != nil && o.Token != nil { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *SubscriptionObject) SetToken(v string) { + o.Token = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SubscriptionObject) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SubscriptionObject) HasEnabled() bool { + if o != nil && o.Enabled != nil { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SubscriptionObject) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetNotificationTypes returns the NotificationTypes field value if set, zero value otherwise. +func (o *SubscriptionObject) GetNotificationTypes() float32 { + if o == nil || o.NotificationTypes == nil { + var ret float32 + return ret + } + return *o.NotificationTypes +} + +// GetNotificationTypesOk returns a tuple with the NotificationTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetNotificationTypesOk() (*float32, bool) { + if o == nil || o.NotificationTypes == nil { + return nil, false + } + return o.NotificationTypes, true +} + +// HasNotificationTypes returns a boolean if a field has been set. +func (o *SubscriptionObject) HasNotificationTypes() bool { + if o != nil && o.NotificationTypes != nil { + return true + } + + return false +} + +// SetNotificationTypes gets a reference to the given float32 and assigns it to the NotificationTypes field. +func (o *SubscriptionObject) SetNotificationTypes(v float32) { + o.NotificationTypes = &v +} + +// GetSessionTime returns the SessionTime field value if set, zero value otherwise. +func (o *SubscriptionObject) GetSessionTime() float32 { + if o == nil || o.SessionTime == nil { + var ret float32 + return ret + } + return *o.SessionTime +} + +// GetSessionTimeOk returns a tuple with the SessionTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetSessionTimeOk() (*float32, bool) { + if o == nil || o.SessionTime == nil { + return nil, false + } + return o.SessionTime, true +} + +// HasSessionTime returns a boolean if a field has been set. +func (o *SubscriptionObject) HasSessionTime() bool { + if o != nil && o.SessionTime != nil { + return true + } + + return false +} + +// SetSessionTime gets a reference to the given float32 and assigns it to the SessionTime field. +func (o *SubscriptionObject) SetSessionTime(v float32) { + o.SessionTime = &v +} + +// GetSessionCount returns the SessionCount field value if set, zero value otherwise. +func (o *SubscriptionObject) GetSessionCount() float32 { + if o == nil || o.SessionCount == nil { + var ret float32 + return ret + } + return *o.SessionCount +} + +// GetSessionCountOk returns a tuple with the SessionCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetSessionCountOk() (*float32, bool) { + if o == nil || o.SessionCount == nil { + return nil, false + } + return o.SessionCount, true +} + +// HasSessionCount returns a boolean if a field has been set. +func (o *SubscriptionObject) HasSessionCount() bool { + if o != nil && o.SessionCount != nil { + return true + } + + return false +} + +// SetSessionCount gets a reference to the given float32 and assigns it to the SessionCount field. +func (o *SubscriptionObject) SetSessionCount(v float32) { + o.SessionCount = &v +} + +// GetSdk returns the Sdk field value if set, zero value otherwise. +func (o *SubscriptionObject) GetSdk() string { + if o == nil || o.Sdk == nil { + var ret string + return ret + } + return *o.Sdk +} + +// GetSdkOk returns a tuple with the Sdk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetSdkOk() (*string, bool) { + if o == nil || o.Sdk == nil { + return nil, false + } + return o.Sdk, true +} + +// HasSdk returns a boolean if a field has been set. +func (o *SubscriptionObject) HasSdk() bool { + if o != nil && o.Sdk != nil { + return true + } + + return false +} + +// SetSdk gets a reference to the given string and assigns it to the Sdk field. +func (o *SubscriptionObject) SetSdk(v string) { + o.Sdk = &v +} + +// GetDeviceModel returns the DeviceModel field value if set, zero value otherwise. +func (o *SubscriptionObject) GetDeviceModel() string { + if o == nil || o.DeviceModel == nil { + var ret string + return ret + } + return *o.DeviceModel +} + +// GetDeviceModelOk returns a tuple with the DeviceModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetDeviceModelOk() (*string, bool) { + if o == nil || o.DeviceModel == nil { + return nil, false + } + return o.DeviceModel, true +} + +// HasDeviceModel returns a boolean if a field has been set. +func (o *SubscriptionObject) HasDeviceModel() bool { + if o != nil && o.DeviceModel != nil { + return true + } + + return false +} + +// SetDeviceModel gets a reference to the given string and assigns it to the DeviceModel field. +func (o *SubscriptionObject) SetDeviceModel(v string) { + o.DeviceModel = &v +} + +// GetDeviceOs returns the DeviceOs field value if set, zero value otherwise. +func (o *SubscriptionObject) GetDeviceOs() string { + if o == nil || o.DeviceOs == nil { + var ret string + return ret + } + return *o.DeviceOs +} + +// GetDeviceOsOk returns a tuple with the DeviceOs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetDeviceOsOk() (*string, bool) { + if o == nil || o.DeviceOs == nil { + return nil, false + } + return o.DeviceOs, true +} + +// HasDeviceOs returns a boolean if a field has been set. +func (o *SubscriptionObject) HasDeviceOs() bool { + if o != nil && o.DeviceOs != nil { + return true + } + + return false +} + +// SetDeviceOs gets a reference to the given string and assigns it to the DeviceOs field. +func (o *SubscriptionObject) SetDeviceOs(v string) { + o.DeviceOs = &v +} + +// GetRooted returns the Rooted field value if set, zero value otherwise. +func (o *SubscriptionObject) GetRooted() bool { + if o == nil || o.Rooted == nil { + var ret bool + return ret + } + return *o.Rooted +} + +// GetRootedOk returns a tuple with the Rooted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetRootedOk() (*bool, bool) { + if o == nil || o.Rooted == nil { + return nil, false + } + return o.Rooted, true +} + +// HasRooted returns a boolean if a field has been set. +func (o *SubscriptionObject) HasRooted() bool { + if o != nil && o.Rooted != nil { + return true + } + + return false +} + +// SetRooted gets a reference to the given bool and assigns it to the Rooted field. +func (o *SubscriptionObject) SetRooted(v bool) { + o.Rooted = &v +} + +// GetTestType returns the TestType field value if set, zero value otherwise. +func (o *SubscriptionObject) GetTestType() float32 { + if o == nil || o.TestType == nil { + var ret float32 + return ret + } + return *o.TestType +} + +// GetTestTypeOk returns a tuple with the TestType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetTestTypeOk() (*float32, bool) { + if o == nil || o.TestType == nil { + return nil, false + } + return o.TestType, true +} + +// HasTestType returns a boolean if a field has been set. +func (o *SubscriptionObject) HasTestType() bool { + if o != nil && o.TestType != nil { + return true + } + + return false +} + +// SetTestType gets a reference to the given float32 and assigns it to the TestType field. +func (o *SubscriptionObject) SetTestType(v float32) { + o.TestType = &v +} + +// GetAppVersion returns the AppVersion field value if set, zero value otherwise. +func (o *SubscriptionObject) GetAppVersion() string { + if o == nil || o.AppVersion == nil { + var ret string + return ret + } + return *o.AppVersion +} + +// GetAppVersionOk returns a tuple with the AppVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetAppVersionOk() (*string, bool) { + if o == nil || o.AppVersion == nil { + return nil, false + } + return o.AppVersion, true +} + +// HasAppVersion returns a boolean if a field has been set. +func (o *SubscriptionObject) HasAppVersion() bool { + if o != nil && o.AppVersion != nil { + return true + } + + return false +} + +// SetAppVersion gets a reference to the given string and assigns it to the AppVersion field. +func (o *SubscriptionObject) SetAppVersion(v string) { + o.AppVersion = &v +} + +// GetNetType returns the NetType field value if set, zero value otherwise. +func (o *SubscriptionObject) GetNetType() float32 { + if o == nil || o.NetType == nil { + var ret float32 + return ret + } + return *o.NetType +} + +// GetNetTypeOk returns a tuple with the NetType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetNetTypeOk() (*float32, bool) { + if o == nil || o.NetType == nil { + return nil, false + } + return o.NetType, true +} + +// HasNetType returns a boolean if a field has been set. +func (o *SubscriptionObject) HasNetType() bool { + if o != nil && o.NetType != nil { + return true + } + + return false +} + +// SetNetType gets a reference to the given float32 and assigns it to the NetType field. +func (o *SubscriptionObject) SetNetType(v float32) { + o.NetType = &v +} + +// GetCarrier returns the Carrier field value if set, zero value otherwise. +func (o *SubscriptionObject) GetCarrier() string { + if o == nil || o.Carrier == nil { + var ret string + return ret + } + return *o.Carrier +} + +// GetCarrierOk returns a tuple with the Carrier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetCarrierOk() (*string, bool) { + if o == nil || o.Carrier == nil { + return nil, false + } + return o.Carrier, true +} + +// HasCarrier returns a boolean if a field has been set. +func (o *SubscriptionObject) HasCarrier() bool { + if o != nil && o.Carrier != nil { + return true + } + + return false +} + +// SetCarrier gets a reference to the given string and assigns it to the Carrier field. +func (o *SubscriptionObject) SetCarrier(v string) { + o.Carrier = &v +} + +// GetWebAuth returns the WebAuth field value if set, zero value otherwise. +func (o *SubscriptionObject) GetWebAuth() string { + if o == nil || o.WebAuth == nil { + var ret string + return ret + } + return *o.WebAuth +} + +// GetWebAuthOk returns a tuple with the WebAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetWebAuthOk() (*string, bool) { + if o == nil || o.WebAuth == nil { + return nil, false + } + return o.WebAuth, true +} + +// HasWebAuth returns a boolean if a field has been set. +func (o *SubscriptionObject) HasWebAuth() bool { + if o != nil && o.WebAuth != nil { + return true + } + + return false +} + +// SetWebAuth gets a reference to the given string and assigns it to the WebAuth field. +func (o *SubscriptionObject) SetWebAuth(v string) { + o.WebAuth = &v +} + +// GetWebP256 returns the WebP256 field value if set, zero value otherwise. +func (o *SubscriptionObject) GetWebP256() string { + if o == nil || o.WebP256 == nil { + var ret string + return ret + } + return *o.WebP256 +} + +// GetWebP256Ok returns a tuple with the WebP256 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubscriptionObject) GetWebP256Ok() (*string, bool) { + if o == nil || o.WebP256 == nil { + return nil, false + } + return o.WebP256, true +} + +// HasWebP256 returns a boolean if a field has been set. +func (o *SubscriptionObject) HasWebP256() bool { + if o != nil && o.WebP256 != nil { + return true + } + + return false +} + +// SetWebP256 gets a reference to the given string and assigns it to the WebP256 field. +func (o *SubscriptionObject) SetWebP256(v string) { + o.WebP256 = &v +} + +func (o SubscriptionObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Token != nil { + toSerialize["token"] = o.Token + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + if o.NotificationTypes != nil { + toSerialize["notification_types"] = o.NotificationTypes + } + if o.SessionTime != nil { + toSerialize["session_time"] = o.SessionTime + } + if o.SessionCount != nil { + toSerialize["session_count"] = o.SessionCount + } + if o.Sdk != nil { + toSerialize["sdk"] = o.Sdk + } + if o.DeviceModel != nil { + toSerialize["device_model"] = o.DeviceModel + } + if o.DeviceOs != nil { + toSerialize["device_os"] = o.DeviceOs + } + if o.Rooted != nil { + toSerialize["rooted"] = o.Rooted + } + if o.TestType != nil { + toSerialize["test_type"] = o.TestType + } + if o.AppVersion != nil { + toSerialize["app_version"] = o.AppVersion + } + if o.NetType != nil { + toSerialize["net_type"] = o.NetType + } + if o.Carrier != nil { + toSerialize["carrier"] = o.Carrier + } + if o.WebAuth != nil { + toSerialize["web_auth"] = o.WebAuth + } + if o.WebP256 != nil { + toSerialize["web_p256"] = o.WebP256 + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *SubscriptionObject) UnmarshalJSON(bytes []byte) (err error) { + varSubscriptionObject := _SubscriptionObject{} + + if err = json.Unmarshal(bytes, &varSubscriptionObject); err == nil { + *o = SubscriptionObject(varSubscriptionObject) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "type") + delete(additionalProperties, "token") + delete(additionalProperties, "enabled") + delete(additionalProperties, "notification_types") + delete(additionalProperties, "session_time") + delete(additionalProperties, "session_count") + delete(additionalProperties, "sdk") + delete(additionalProperties, "device_model") + delete(additionalProperties, "device_os") + delete(additionalProperties, "rooted") + delete(additionalProperties, "test_type") + delete(additionalProperties, "app_version") + delete(additionalProperties, "net_type") + delete(additionalProperties, "carrier") + delete(additionalProperties, "web_auth") + delete(additionalProperties, "web_p256") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSubscriptionObject struct { + value *SubscriptionObject + isSet bool +} + +func (v NullableSubscriptionObject) Get() *SubscriptionObject { + return v.value +} + +func (v *NullableSubscriptionObject) Set(val *SubscriptionObject) { + v.value = val + v.isSet = true +} + +func (v NullableSubscriptionObject) IsSet() bool { + return v.isSet +} + +func (v *NullableSubscriptionObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubscriptionObject(val *SubscriptionObject) *NullableSubscriptionObject { + return &NullableSubscriptionObject{value: val, isSet: true} +} + +func (v NullableSubscriptionObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubscriptionObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_transfer_subscription_request_body.go b/model_transfer_subscription_request_body.go new file mode 100644 index 0000000..50870c4 --- /dev/null +++ b/model_transfer_subscription_request_body.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// TransferSubscriptionRequestBody struct for TransferSubscriptionRequestBody +type TransferSubscriptionRequestBody struct { + Identity map[string]interface{} `json:"identity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransferSubscriptionRequestBody TransferSubscriptionRequestBody + +// NewTransferSubscriptionRequestBody instantiates a new TransferSubscriptionRequestBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferSubscriptionRequestBody() *TransferSubscriptionRequestBody { + this := TransferSubscriptionRequestBody{} + return &this +} + +// NewTransferSubscriptionRequestBodyWithDefaults instantiates a new TransferSubscriptionRequestBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferSubscriptionRequestBodyWithDefaults() *TransferSubscriptionRequestBody { + this := TransferSubscriptionRequestBody{} + return &this +} + +// GetIdentity returns the Identity field value if set, zero value otherwise. +func (o *TransferSubscriptionRequestBody) GetIdentity() map[string]interface{} { + if o == nil || o.Identity == nil { + var ret map[string]interface{} + return ret + } + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferSubscriptionRequestBody) GetIdentityOk() (map[string]interface{}, bool) { + if o == nil || o.Identity == nil { + return nil, false + } + return o.Identity, true +} + +// HasIdentity returns a boolean if a field has been set. +func (o *TransferSubscriptionRequestBody) HasIdentity() bool { + if o != nil && o.Identity != nil { + return true + } + + return false +} + +// SetIdentity gets a reference to the given map[string]interface{} and assigns it to the Identity field. +func (o *TransferSubscriptionRequestBody) SetIdentity(v map[string]interface{}) { + o.Identity = v +} + +func (o TransferSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Identity != nil { + toSerialize["identity"] = o.Identity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *TransferSubscriptionRequestBody) UnmarshalJSON(bytes []byte) (err error) { + varTransferSubscriptionRequestBody := _TransferSubscriptionRequestBody{} + + if err = json.Unmarshal(bytes, &varTransferSubscriptionRequestBody); err == nil { + *o = TransferSubscriptionRequestBody(varTransferSubscriptionRequestBody) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "identity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransferSubscriptionRequestBody struct { + value *TransferSubscriptionRequestBody + isSet bool +} + +func (v NullableTransferSubscriptionRequestBody) Get() *TransferSubscriptionRequestBody { + return v.value +} + +func (v *NullableTransferSubscriptionRequestBody) Set(val *TransferSubscriptionRequestBody) { + v.value = val + v.isSet = true +} + +func (v NullableTransferSubscriptionRequestBody) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferSubscriptionRequestBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferSubscriptionRequestBody(val *TransferSubscriptionRequestBody) *NullableTransferSubscriptionRequestBody { + return &NullableTransferSubscriptionRequestBody{value: val, isSet: true} +} + +func (v NullableTransferSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferSubscriptionRequestBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_live_activity_request.go b/model_update_live_activity_request.go index f62f6cc..57c48a1 100644 --- a/model_update_live_activity_request.go +++ b/model_update_live_activity_request.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_update_live_activity_success_response.go b/model_update_live_activity_success_response.go index 2a316a9..f2ad703 100644 --- a/model_update_live_activity_success_response.go +++ b/model_update_live_activity_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_update_player_success_response.go b/model_update_player_success_response.go index 428d553..093c1f2 100644 --- a/model_update_player_success_response.go +++ b/model_update_player_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_update_player_tags_request_body.go b/model_update_player_tags_request_body.go index 12d0186..978dfdf 100644 --- a/model_update_player_tags_request_body.go +++ b/model_update_player_tags_request_body.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_update_player_tags_success_response.go b/model_update_player_tags_success_response.go index 8f2eda2..51f7699 100644 --- a/model_update_player_tags_success_response.go +++ b/model_update_player_tags_success_response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/model_update_subscription_request_body.go b/model_update_subscription_request_body.go new file mode 100644 index 0000000..22fab45 --- /dev/null +++ b/model_update_subscription_request_body.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// UpdateSubscriptionRequestBody struct for UpdateSubscriptionRequestBody +type UpdateSubscriptionRequestBody struct { + Subscription *SubscriptionObject `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateSubscriptionRequestBody UpdateSubscriptionRequestBody + +// NewUpdateSubscriptionRequestBody instantiates a new UpdateSubscriptionRequestBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSubscriptionRequestBody() *UpdateSubscriptionRequestBody { + this := UpdateSubscriptionRequestBody{} + return &this +} + +// NewUpdateSubscriptionRequestBodyWithDefaults instantiates a new UpdateSubscriptionRequestBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSubscriptionRequestBodyWithDefaults() *UpdateSubscriptionRequestBody { + this := UpdateSubscriptionRequestBody{} + return &this +} + +// GetSubscription returns the Subscription field value if set, zero value otherwise. +func (o *UpdateSubscriptionRequestBody) GetSubscription() SubscriptionObject { + if o == nil || o.Subscription == nil { + var ret SubscriptionObject + return ret + } + return *o.Subscription +} + +// GetSubscriptionOk returns a tuple with the Subscription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSubscriptionRequestBody) GetSubscriptionOk() (*SubscriptionObject, bool) { + if o == nil || o.Subscription == nil { + return nil, false + } + return o.Subscription, true +} + +// HasSubscription returns a boolean if a field has been set. +func (o *UpdateSubscriptionRequestBody) HasSubscription() bool { + if o != nil && o.Subscription != nil { + return true + } + + return false +} + +// SetSubscription gets a reference to the given SubscriptionObject and assigns it to the Subscription field. +func (o *UpdateSubscriptionRequestBody) SetSubscription(v SubscriptionObject) { + o.Subscription = &v +} + +func (o UpdateSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Subscription != nil { + toSerialize["subscription"] = o.Subscription + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *UpdateSubscriptionRequestBody) UnmarshalJSON(bytes []byte) (err error) { + varUpdateSubscriptionRequestBody := _UpdateSubscriptionRequestBody{} + + if err = json.Unmarshal(bytes, &varUpdateSubscriptionRequestBody); err == nil { + *o = UpdateSubscriptionRequestBody(varUpdateSubscriptionRequestBody) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "subscription") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateSubscriptionRequestBody struct { + value *UpdateSubscriptionRequestBody + isSet bool +} + +func (v NullableUpdateSubscriptionRequestBody) Get() *UpdateSubscriptionRequestBody { + return v.value +} + +func (v *NullableUpdateSubscriptionRequestBody) Set(val *UpdateSubscriptionRequestBody) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSubscriptionRequestBody) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSubscriptionRequestBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSubscriptionRequestBody(val *UpdateSubscriptionRequestBody) *NullableUpdateSubscriptionRequestBody { + return &NullableUpdateSubscriptionRequestBody{value: val, isSet: true} +} + +func (v NullableUpdateSubscriptionRequestBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSubscriptionRequestBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_user_request.go b/model_update_user_request.go new file mode 100644 index 0000000..974b572 --- /dev/null +++ b/model_update_user_request.go @@ -0,0 +1,219 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// UpdateUserRequest struct for UpdateUserRequest +type UpdateUserRequest struct { + Properties *PropertiesObject `json:"properties,omitempty"` + RefreshDeviceMetadata *bool `json:"refresh_device_metadata,omitempty"` + Deltas *PropertiesDeltas `json:"deltas,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateUserRequest UpdateUserRequest + +// NewUpdateUserRequest instantiates a new UpdateUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserRequest() *UpdateUserRequest { + this := UpdateUserRequest{} + var refreshDeviceMetadata bool = false + this.RefreshDeviceMetadata = &refreshDeviceMetadata + return &this +} + +// NewUpdateUserRequestWithDefaults instantiates a new UpdateUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserRequestWithDefaults() *UpdateUserRequest { + this := UpdateUserRequest{} + var refreshDeviceMetadata bool = false + this.RefreshDeviceMetadata = &refreshDeviceMetadata + return &this +} + +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *UpdateUserRequest) GetProperties() PropertiesObject { + if o == nil || o.Properties == nil { + var ret PropertiesObject + return ret + } + return *o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserRequest) GetPropertiesOk() (*PropertiesObject, bool) { + if o == nil || o.Properties == nil { + return nil, false + } + return o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *UpdateUserRequest) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// SetProperties gets a reference to the given PropertiesObject and assigns it to the Properties field. +func (o *UpdateUserRequest) SetProperties(v PropertiesObject) { + o.Properties = &v +} + +// GetRefreshDeviceMetadata returns the RefreshDeviceMetadata field value if set, zero value otherwise. +func (o *UpdateUserRequest) GetRefreshDeviceMetadata() bool { + if o == nil || o.RefreshDeviceMetadata == nil { + var ret bool + return ret + } + return *o.RefreshDeviceMetadata +} + +// GetRefreshDeviceMetadataOk returns a tuple with the RefreshDeviceMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserRequest) GetRefreshDeviceMetadataOk() (*bool, bool) { + if o == nil || o.RefreshDeviceMetadata == nil { + return nil, false + } + return o.RefreshDeviceMetadata, true +} + +// HasRefreshDeviceMetadata returns a boolean if a field has been set. +func (o *UpdateUserRequest) HasRefreshDeviceMetadata() bool { + if o != nil && o.RefreshDeviceMetadata != nil { + return true + } + + return false +} + +// SetRefreshDeviceMetadata gets a reference to the given bool and assigns it to the RefreshDeviceMetadata field. +func (o *UpdateUserRequest) SetRefreshDeviceMetadata(v bool) { + o.RefreshDeviceMetadata = &v +} + +// GetDeltas returns the Deltas field value if set, zero value otherwise. +func (o *UpdateUserRequest) GetDeltas() PropertiesDeltas { + if o == nil || o.Deltas == nil { + var ret PropertiesDeltas + return ret + } + return *o.Deltas +} + +// GetDeltasOk returns a tuple with the Deltas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserRequest) GetDeltasOk() (*PropertiesDeltas, bool) { + if o == nil || o.Deltas == nil { + return nil, false + } + return o.Deltas, true +} + +// HasDeltas returns a boolean if a field has been set. +func (o *UpdateUserRequest) HasDeltas() bool { + if o != nil && o.Deltas != nil { + return true + } + + return false +} + +// SetDeltas gets a reference to the given PropertiesDeltas and assigns it to the Deltas field. +func (o *UpdateUserRequest) SetDeltas(v PropertiesDeltas) { + o.Deltas = &v +} + +func (o UpdateUserRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.RefreshDeviceMetadata != nil { + toSerialize["refresh_device_metadata"] = o.RefreshDeviceMetadata + } + if o.Deltas != nil { + toSerialize["deltas"] = o.Deltas + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *UpdateUserRequest) UnmarshalJSON(bytes []byte) (err error) { + varUpdateUserRequest := _UpdateUserRequest{} + + if err = json.Unmarshal(bytes, &varUpdateUserRequest); err == nil { + *o = UpdateUserRequest(varUpdateUserRequest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "properties") + delete(additionalProperties, "refresh_device_metadata") + delete(additionalProperties, "deltas") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateUserRequest struct { + value *UpdateUserRequest + isSet bool +} + +func (v NullableUpdateUserRequest) Get() *UpdateUserRequest { + return v.value +} + +func (v *NullableUpdateUserRequest) Set(val *UpdateUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserRequest(val *UpdateUserRequest) *NullableUpdateUserRequest { + return &NullableUpdateUserRequest{value: val, isSet: true} +} + +func (v NullableUpdateUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user.go b/model_user.go new file mode 100644 index 0000000..4451e57 --- /dev/null +++ b/model_user.go @@ -0,0 +1,252 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// User struct for User +type User struct { + Properties *PropertiesObject `json:"properties,omitempty"` + Identity map[string]interface{} `json:"identity,omitempty"` + Subscriptions []SubscriptionObject `json:"subscriptions,omitempty"` + SubscriptionOptions *UserSubscriptionOptions `json:"subscription_options,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *User) GetProperties() PropertiesObject { + if o == nil || o.Properties == nil { + var ret PropertiesObject + return ret + } + return *o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPropertiesOk() (*PropertiesObject, bool) { + if o == nil || o.Properties == nil { + return nil, false + } + return o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *User) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +// SetProperties gets a reference to the given PropertiesObject and assigns it to the Properties field. +func (o *User) SetProperties(v PropertiesObject) { + o.Properties = &v +} + +// GetIdentity returns the Identity field value if set, zero value otherwise. +func (o *User) GetIdentity() map[string]interface{} { + if o == nil || o.Identity == nil { + var ret map[string]interface{} + return ret + } + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdentityOk() (map[string]interface{}, bool) { + if o == nil || o.Identity == nil { + return nil, false + } + return o.Identity, true +} + +// HasIdentity returns a boolean if a field has been set. +func (o *User) HasIdentity() bool { + if o != nil && o.Identity != nil { + return true + } + + return false +} + +// SetIdentity gets a reference to the given map[string]interface{} and assigns it to the Identity field. +func (o *User) SetIdentity(v map[string]interface{}) { + o.Identity = v +} + +// GetSubscriptions returns the Subscriptions field value if set, zero value otherwise. +func (o *User) GetSubscriptions() []SubscriptionObject { + if o == nil || o.Subscriptions == nil { + var ret []SubscriptionObject + return ret + } + return o.Subscriptions +} + +// GetSubscriptionsOk returns a tuple with the Subscriptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetSubscriptionsOk() ([]SubscriptionObject, bool) { + if o == nil || o.Subscriptions == nil { + return nil, false + } + return o.Subscriptions, true +} + +// HasSubscriptions returns a boolean if a field has been set. +func (o *User) HasSubscriptions() bool { + if o != nil && o.Subscriptions != nil { + return true + } + + return false +} + +// SetSubscriptions gets a reference to the given []SubscriptionObject and assigns it to the Subscriptions field. +func (o *User) SetSubscriptions(v []SubscriptionObject) { + o.Subscriptions = v +} + +// GetSubscriptionOptions returns the SubscriptionOptions field value if set, zero value otherwise. +func (o *User) GetSubscriptionOptions() UserSubscriptionOptions { + if o == nil || o.SubscriptionOptions == nil { + var ret UserSubscriptionOptions + return ret + } + return *o.SubscriptionOptions +} + +// GetSubscriptionOptionsOk returns a tuple with the SubscriptionOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetSubscriptionOptionsOk() (*UserSubscriptionOptions, bool) { + if o == nil || o.SubscriptionOptions == nil { + return nil, false + } + return o.SubscriptionOptions, true +} + +// HasSubscriptionOptions returns a boolean if a field has been set. +func (o *User) HasSubscriptionOptions() bool { + if o != nil && o.SubscriptionOptions != nil { + return true + } + + return false +} + +// SetSubscriptionOptions gets a reference to the given UserSubscriptionOptions and assigns it to the SubscriptionOptions field. +func (o *User) SetSubscriptionOptions(v UserSubscriptionOptions) { + o.SubscriptionOptions = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + if o.Identity != nil { + toSerialize["identity"] = o.Identity + } + if o.Subscriptions != nil { + toSerialize["subscriptions"] = o.Subscriptions + } + if o.SubscriptionOptions != nil { + toSerialize["subscription_options"] = o.SubscriptionOptions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *User) UnmarshalJSON(bytes []byte) (err error) { + varUser := _User{} + + if err = json.Unmarshal(bytes, &varUser); err == nil { + *o = User(varUser) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "properties") + delete(additionalProperties, "identity") + delete(additionalProperties, "subscriptions") + delete(additionalProperties, "subscription_options") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user_identity_request_body.go b/model_user_identity_request_body.go new file mode 100644 index 0000000..9d9e94c --- /dev/null +++ b/model_user_identity_request_body.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// UserIdentityRequestBody struct for UserIdentityRequestBody +type UserIdentityRequestBody struct { + Identity map[string]interface{} `json:"identity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserIdentityRequestBody UserIdentityRequestBody + +// NewUserIdentityRequestBody instantiates a new UserIdentityRequestBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserIdentityRequestBody() *UserIdentityRequestBody { + this := UserIdentityRequestBody{} + return &this +} + +// NewUserIdentityRequestBodyWithDefaults instantiates a new UserIdentityRequestBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserIdentityRequestBodyWithDefaults() *UserIdentityRequestBody { + this := UserIdentityRequestBody{} + return &this +} + +// GetIdentity returns the Identity field value if set, zero value otherwise. +func (o *UserIdentityRequestBody) GetIdentity() map[string]interface{} { + if o == nil || o.Identity == nil { + var ret map[string]interface{} + return ret + } + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentityRequestBody) GetIdentityOk() (map[string]interface{}, bool) { + if o == nil || o.Identity == nil { + return nil, false + } + return o.Identity, true +} + +// HasIdentity returns a boolean if a field has been set. +func (o *UserIdentityRequestBody) HasIdentity() bool { + if o != nil && o.Identity != nil { + return true + } + + return false +} + +// SetIdentity gets a reference to the given map[string]interface{} and assigns it to the Identity field. +func (o *UserIdentityRequestBody) SetIdentity(v map[string]interface{}) { + o.Identity = v +} + +func (o UserIdentityRequestBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Identity != nil { + toSerialize["identity"] = o.Identity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *UserIdentityRequestBody) UnmarshalJSON(bytes []byte) (err error) { + varUserIdentityRequestBody := _UserIdentityRequestBody{} + + if err = json.Unmarshal(bytes, &varUserIdentityRequestBody); err == nil { + *o = UserIdentityRequestBody(varUserIdentityRequestBody) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "identity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserIdentityRequestBody struct { + value *UserIdentityRequestBody + isSet bool +} + +func (v NullableUserIdentityRequestBody) Get() *UserIdentityRequestBody { + return v.value +} + +func (v *NullableUserIdentityRequestBody) Set(val *UserIdentityRequestBody) { + v.value = val + v.isSet = true +} + +func (v NullableUserIdentityRequestBody) IsSet() bool { + return v.isSet +} + +func (v *NullableUserIdentityRequestBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserIdentityRequestBody(val *UserIdentityRequestBody) *NullableUserIdentityRequestBody { + return &NullableUserIdentityRequestBody{value: val, isSet: true} +} + +func (v NullableUserIdentityRequestBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserIdentityRequestBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user_identity_response.go b/model_user_identity_response.go new file mode 100644 index 0000000..b3926c2 --- /dev/null +++ b/model_user_identity_response.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// UserIdentityResponse struct for UserIdentityResponse +type UserIdentityResponse struct { + Identity map[string]interface{} `json:"identity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserIdentityResponse UserIdentityResponse + +// NewUserIdentityResponse instantiates a new UserIdentityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserIdentityResponse() *UserIdentityResponse { + this := UserIdentityResponse{} + return &this +} + +// NewUserIdentityResponseWithDefaults instantiates a new UserIdentityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserIdentityResponseWithDefaults() *UserIdentityResponse { + this := UserIdentityResponse{} + return &this +} + +// GetIdentity returns the Identity field value if set, zero value otherwise. +func (o *UserIdentityResponse) GetIdentity() map[string]interface{} { + if o == nil || o.Identity == nil { + var ret map[string]interface{} + return ret + } + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentityResponse) GetIdentityOk() (map[string]interface{}, bool) { + if o == nil || o.Identity == nil { + return nil, false + } + return o.Identity, true +} + +// HasIdentity returns a boolean if a field has been set. +func (o *UserIdentityResponse) HasIdentity() bool { + if o != nil && o.Identity != nil { + return true + } + + return false +} + +// SetIdentity gets a reference to the given map[string]interface{} and assigns it to the Identity field. +func (o *UserIdentityResponse) SetIdentity(v map[string]interface{}) { + o.Identity = v +} + +func (o UserIdentityResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Identity != nil { + toSerialize["identity"] = o.Identity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *UserIdentityResponse) UnmarshalJSON(bytes []byte) (err error) { + varUserIdentityResponse := _UserIdentityResponse{} + + if err = json.Unmarshal(bytes, &varUserIdentityResponse); err == nil { + *o = UserIdentityResponse(varUserIdentityResponse) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "identity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserIdentityResponse struct { + value *UserIdentityResponse + isSet bool +} + +func (v NullableUserIdentityResponse) Get() *UserIdentityResponse { + return v.value +} + +func (v *NullableUserIdentityResponse) Set(val *UserIdentityResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUserIdentityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUserIdentityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserIdentityResponse(val *UserIdentityResponse) *NullableUserIdentityResponse { + return &NullableUserIdentityResponse{value: val, isSet: true} +} + +func (v NullableUserIdentityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserIdentityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user_subscription_options.go b/model_user_subscription_options.go new file mode 100644 index 0000000..c423325 --- /dev/null +++ b/model_user_subscription_options.go @@ -0,0 +1,141 @@ +/* +OneSignal + +A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + +API version: 1.2.1 +Contact: devrel@onesignal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package onesignal + +import ( + "encoding/json" +) + +// UserSubscriptionOptions struct for UserSubscriptionOptions +type UserSubscriptionOptions struct { + RetainPreviousOwner *bool `json:"retain_previous_owner,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserSubscriptionOptions UserSubscriptionOptions + +// NewUserSubscriptionOptions instantiates a new UserSubscriptionOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSubscriptionOptions() *UserSubscriptionOptions { + this := UserSubscriptionOptions{} + return &this +} + +// NewUserSubscriptionOptionsWithDefaults instantiates a new UserSubscriptionOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSubscriptionOptionsWithDefaults() *UserSubscriptionOptions { + this := UserSubscriptionOptions{} + return &this +} + +// GetRetainPreviousOwner returns the RetainPreviousOwner field value if set, zero value otherwise. +func (o *UserSubscriptionOptions) GetRetainPreviousOwner() bool { + if o == nil || o.RetainPreviousOwner == nil { + var ret bool + return ret + } + return *o.RetainPreviousOwner +} + +// GetRetainPreviousOwnerOk returns a tuple with the RetainPreviousOwner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserSubscriptionOptions) GetRetainPreviousOwnerOk() (*bool, bool) { + if o == nil || o.RetainPreviousOwner == nil { + return nil, false + } + return o.RetainPreviousOwner, true +} + +// HasRetainPreviousOwner returns a boolean if a field has been set. +func (o *UserSubscriptionOptions) HasRetainPreviousOwner() bool { + if o != nil && o.RetainPreviousOwner != nil { + return true + } + + return false +} + +// SetRetainPreviousOwner gets a reference to the given bool and assigns it to the RetainPreviousOwner field. +func (o *UserSubscriptionOptions) SetRetainPreviousOwner(v bool) { + o.RetainPreviousOwner = &v +} + +func (o UserSubscriptionOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.RetainPreviousOwner != nil { + toSerialize["retain_previous_owner"] = o.RetainPreviousOwner + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *UserSubscriptionOptions) UnmarshalJSON(bytes []byte) (err error) { + varUserSubscriptionOptions := _UserSubscriptionOptions{} + + if err = json.Unmarshal(bytes, &varUserSubscriptionOptions); err == nil { + *o = UserSubscriptionOptions(varUserSubscriptionOptions) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "retain_previous_owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSubscriptionOptions struct { + value *UserSubscriptionOptions + isSet bool +} + +func (v NullableUserSubscriptionOptions) Get() *UserSubscriptionOptions { + return v.value +} + +func (v *NullableUserSubscriptionOptions) Set(val *UserSubscriptionOptions) { + v.value = val + v.isSet = true +} + +func (v NullableUserSubscriptionOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSubscriptionOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSubscriptionOptions(val *UserSubscriptionOptions) *NullableUserSubscriptionOptions { + return &NullableUserSubscriptionOptions{value: val, isSet: true} +} + +func (v NullableUserSubscriptionOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSubscriptionOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/response.go b/response.go index 177064e..c4a5b7c 100644 --- a/response.go +++ b/response.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */ diff --git a/utils.go b/utils.go index e2d2240..9b85bc3 100644 --- a/utils.go +++ b/utils.go @@ -3,7 +3,7 @@ OneSignal A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -API version: 1.0.2 +API version: 1.2.1 Contact: devrel@onesignal.com */