Skip to content

Commit ff72327

Browse files
author
OneSignal
committed
Update Python API
1 parent 9e7a1b1 commit ff72327

File tree

194 files changed

+11587
-944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+11587
-944
lines changed

.github/workflows/Zapier.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# Triggers the workflow on push or pull request events but only for the "main" branch
88
issues:
99
types: [closed]
10-
10+
1111
permissions:
1212
issues: read
1313

@@ -31,4 +31,4 @@ jobs:
3131
--header 'Accept: application/json' \
3232
--data-raw '{
3333
"task_name" : "$ISSUE_TITLE"
34-
}'
34+
}'

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
1818

19-
- API version: 1.0.2
20-
- Package version: 1.0.2
19+
- API version: 1.2.1
20+
- Package version: 2.0.0
2121
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
2222

2323
## Requirements.
@@ -89,22 +89,36 @@ Class | Method | HTTP request | Description
8989
*DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification
9090
*DefaultApi* | [**create_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device
9191
*DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments
92+
*DefaultApi* | [**create_subscription**](docs/DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions |
93+
*DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /apps/{app_id}/users |
94+
*DefaultApi* | [**delete_alias**](docs/DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} |
9295
*DefaultApi* | [**delete_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record
9396
*DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
97+
*DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} |
98+
*DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
9499
*DefaultApi* | [**end_live_activity**](docs/DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity
95100
*DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export
101+
*DefaultApi* | [**fetch_aliases**](docs/DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
102+
*DefaultApi* | [**fetch_user**](docs/DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
103+
*DefaultApi* | [**fetch_user_identity**](docs/DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
96104
*DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
97105
*DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps
106+
*DefaultApi* | [**get_eligible_iams**](docs/DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams |
98107
*DefaultApi* | [**get_notification**](docs/DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification
99108
*DefaultApi* | [**get_notification_history**](docs/DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History
100109
*DefaultApi* | [**get_notifications**](docs/DefaultApi.md#get_notifications) | **GET** /notifications | View notifications
101110
*DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
102111
*DefaultApi* | [**get_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device
103112
*DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices
113+
*DefaultApi* | [**identify_user_by_alias**](docs/DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity |
114+
*DefaultApi* | [**identify_user_by_subscription_id**](docs/DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity |
115+
*DefaultApi* | [**transfer_subscription**](docs/DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner |
104116
*DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
105117
*DefaultApi* | [**update_live_activity**](docs/DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
106118
*DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device
107119
*DefaultApi* | [**update_player_tags**](docs/DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id
120+
*DefaultApi* | [**update_subscription**](docs/DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} |
121+
*DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} |
108122

109123

110124
## Documentation For Models
@@ -123,6 +137,10 @@ Class | Method | HTTP request | Description
123137
- [CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md)
124138
- [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md)
125139
- [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md)
140+
- [CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md)
141+
- [CreateUserConflictResponse](docs/CreateUserConflictResponse.md)
142+
- [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md)
143+
- [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md)
126144
- [DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md)
127145
- [DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md)
128146
- [DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md)
@@ -133,6 +151,13 @@ Class | Method | HTTP request | Description
133151
- [Filter](docs/Filter.md)
134152
- [FilterExpressions](docs/FilterExpressions.md)
135153
- [GetNotificationRequestBody](docs/GetNotificationRequestBody.md)
154+
- [IdentifyUserConflictResponse](docs/IdentifyUserConflictResponse.md)
155+
- [IdentifyUserConflictResponseErrorsInner](docs/IdentifyUserConflictResponseErrorsInner.md)
156+
- [IdentityObject](docs/IdentityObject.md)
157+
- [InlineResponse200](docs/InlineResponse200.md)
158+
- [InlineResponse2003](docs/InlineResponse2003.md)
159+
- [InlineResponse201](docs/InlineResponse201.md)
160+
- [InlineResponse202](docs/InlineResponse202.md)
136161
- [InvalidIdentifierError](docs/InvalidIdentifierError.md)
137162
- [NoSubscribersError](docs/NoSubscribersError.md)
138163
- [Notification](docs/Notification.md)
@@ -151,17 +176,28 @@ Class | Method | HTTP request | Description
151176
- [PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md)
152177
- [Player](docs/Player.md)
153178
- [PlayerNotificationTarget](docs/PlayerNotificationTarget.md)
179+
- [PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md)
154180
- [PlayerSlice](docs/PlayerSlice.md)
155181
- [Players](docs/Players.md)
182+
- [PropertiesDeltas](docs/PropertiesDeltas.md)
183+
- [PropertiesObject](docs/PropertiesObject.md)
156184
- [Purchase](docs/Purchase.md)
157185
- [Segment](docs/Segment.md)
158186
- [SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
159187
- [StringMap](docs/StringMap.md)
188+
- [SubscriptionObject](docs/SubscriptionObject.md)
189+
- [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md)
160190
- [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md)
161191
- [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md)
162192
- [UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md)
163193
- [UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)
164194
- [UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md)
195+
- [UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md)
196+
- [UpdateUserRequest](docs/UpdateUserRequest.md)
197+
- [User](docs/User.md)
198+
- [UserIdentityRequestBody](docs/UserIdentityRequestBody.md)
199+
- [UserIdentityResponse](docs/UserIdentityResponse.md)
200+
- [UserSubscriptionOptions](docs/UserSubscriptionOptions.md)
165201

166202

167203
## Author

docs/App.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Name | Type | Description | Notes
2323
**safari_apns_certificates** | **str** | | [optional] [readonly]
2424
**safari_apns_p12** | **str** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional]
2525
**safari_apns_p12_password** | **str** | Safari: Password for safari_apns_p12 file | [optional]
26-
**apns_key_id** | **str** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional]
27-
**apns_team_id** | **str** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional]
28-
**apns_bundle_id** | **str** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional]
29-
**apns_p8** | **str** | iOS: Required if using p8. Base64 encoded p8 key | [optional]
26+
**apns_key_id** | **str, none_type** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional]
27+
**apns_team_id** | **str, none_type** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional]
28+
**apns_bundle_id** | **str, none_type** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional]
29+
**apns_p8** | **str, none_type** | iOS: Required if using p8. Base64 encoded p8 key | [optional]
3030
**safari_site_origin** | **str, none_type** | Safari (Recommended): The hostname to your website including http(s):// | [optional]
3131
**safari_push_id** | **str, none_type** | | [optional] [readonly]
3232
**safari_icon_16_16** | **str** | | [optional] [readonly]
@@ -35,7 +35,7 @@ Name | Type | Description | Notes
3535
**safari_icon_128_128** | **str** | | [optional] [readonly]
3636
**safari_icon_256_256** | **str** | Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide. | [optional]
3737
**site_name** | **str, none_type** | All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. | [optional]
38-
**basic_auth_key** | **str** | | [optional] [readonly]
38+
**basic_auth_key** | **str, none_type** | | [optional] [readonly]
3939
**organization_id** | **str** | The Id of the Organization you would like to add this app to. | [optional]
4040
**additional_data_is_root_payload** | **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]
4141
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

docs/BasicNotification.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Name | Type | Description | Notes
1717
**include_chrome_reg_ids** | **[str]** | 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]
1818
**include_chrome_web_reg_ids** | **[str]** | 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]
1919
**include_android_reg_ids** | **[str]** | 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]
20+
**include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional]
21+
**target_channel** | **str** | | [optional]
2022
**id** | **str** | | [optional]
2123
**value** | **int** | | [optional] [readonly]
2224
**name** | **str, none_type** | 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
3234
**is_adm** | **bool, none_type** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional]
3335
**is_chrome** | **bool, none_type** | 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]
3436
**channel_for_external_user_ids** | **str** | 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]
35-
**external_id** | **str** | 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]
37+
**external_id** | **str, none_type** | 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]
3638
**contents** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
3739
**headings** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
3840
**subtitle** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]

docs/BasicNotificationAllOf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Name | Type | Description | Notes
2020
**is_chrome** | **bool, none_type** | 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]
2121
**channel_for_external_user_ids** | **str** | 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]
2222
**app_id** | **str** | 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]
23-
**external_id** | **str** | 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]
23+
**external_id** | **str, none_type** | 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]
2424
**contents** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
2525
**headings** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
2626
**subtitle** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]

docs/CreateNotificationSuccessResponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**id** | **str** | |
8-
**recipients** | **int** | Estimated number of subscribers targetted by notification. |
7+
**id** | **str** | | [optional]
8+
**recipients** | **int** | Estimated number of subscribers targetted by notification. | [optional]
99
**external_id** | **str, none_type** | | [optional]
1010
**errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional]
1111
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

docs/CreateSubscriptionRequestBody.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CreateSubscriptionRequestBody
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional]
8+
**retain_previous_owner** | **bool** | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

docs/CreateUserConflictResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CreateUserConflictResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**errors** | [**[CreateUserConflictResponseErrorsInner]**](CreateUserConflictResponseErrorsInner.md) | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

0 commit comments

Comments
 (0)