From 36e975b24565812c72d16c80bc028a842939318a Mon Sep 17 00:00:00 2001 From: OneSignal Date: Wed, 1 Oct 2025 21:06:40 +0000 Subject: [PATCH] feat: add v5.3.0-beta1 package updates --- README.md | 33 +- docs/ApiKeyToken.md | 17 + docs/ApiKeyTokensListResponse.md | 12 + docs/BasicNotification.md | 2 +- docs/CopyTemplateRequest.md | 12 + docs/CreateApiKeyRequest.md | 14 + docs/CreateApiKeyResponse.md | 13 + docs/CreateTemplateRequest.md | 19 + docs/CustomEvent.md | 16 + docs/CustomEventsRequest.md | 12 + docs/DefaultApi.md | 1858 ++++++++-- docs/IncludeAliases.md | 12 + docs/Notification.md | 2 +- docs/NotificationTarget.md | 2 +- docs/NotificationWithMeta.md | 2 +- docs/StartLiveActivityRequest.md | 27 + docs/StartLiveActivitySuccessResponse.md | 12 + docs/SubscriptionNotificationTarget.md | 2 +- docs/TemplateResource.md | 17 + docs/TemplatesListResponse.md | 12 + docs/UpdateApiKeyRequest.md | 14 + docs/UpdateTemplateRequest.md | 18 + onesignal/__init__.py | 4 +- onesignal/api/default_api.py | 3105 ++++++++++++++--- onesignal/api_client.py | 6 +- onesignal/configuration.py | 6 +- onesignal/exceptions.py | 2 +- onesignal/model/api_key_token.py | 288 ++ .../model/api_key_tokens_list_response.py | 270 ++ onesignal/model/app.py | 2 +- onesignal/model/apps.py | 2 +- onesignal/model/basic_notification.py | 10 +- onesignal/model/basic_notification_all_of.py | 2 +- ...cation_all_of_android_background_layout.py | 2 +- onesignal/model/button.py | 2 +- onesignal/model/copy_template_request.py | 270 ++ onesignal/model/create_api_key_request.py | 276 ++ onesignal/model/create_api_key_response.py | 268 ++ .../create_notification_success_response.py | 2 +- .../model/create_segment_conflict_response.py | 2 +- .../model/create_segment_success_response.py | 2 +- onesignal/model/create_template_request.py | 308 ++ .../model/create_user_conflict_response.py | 2 +- ...ate_user_conflict_response_errors_inner.py | 2 +- ...ser_conflict_response_errors_items_meta.py | 2 +- onesignal/model/custom_event.py | 286 ++ onesignal/model/custom_events_request.py | 276 ++ onesignal/model/delivery_data.py | 2 +- .../model/export_events_success_response.py | 2 +- .../export_subscriptions_request_body.py | 2 +- .../export_subscriptions_success_response.py | 2 +- onesignal/model/filter.py | 2 +- onesignal/model/filter_expression.py | 2 +- onesignal/model/generic_error.py | 2 +- .../model/generic_success_bool_response.py | 2 +- .../get_notification_history_request_body.py | 2 +- .../model/get_segments_success_response.py | 2 +- onesignal/model/identity_object.py | 2 +- onesignal/model/include_aliases.py | 260 ++ onesignal/model/language_string_map.py | 2 +- onesignal/model/notification.py | 10 +- onesignal/model/notification_all_of.py | 2 +- .../notification_history_success_response.py | 2 +- onesignal/model/notification_slice.py | 2 +- onesignal/model/notification_target.py | 10 +- onesignal/model/notification_with_meta.py | 10 +- .../model/notification_with_meta_all_of.py | 2 +- onesignal/model/operator.py | 2 +- onesignal/model/outcome_data.py | 2 +- onesignal/model/outcomes_data.py | 2 +- onesignal/model/platform_delivery_data.py | 2 +- .../platform_delivery_data_email_all_of.py | 2 +- .../platform_delivery_data_sms_all_of.py | 2 +- onesignal/model/properties_body.py | 2 +- onesignal/model/properties_deltas.py | 2 +- onesignal/model/properties_object.py | 2 +- onesignal/model/purchase.py | 2 +- onesignal/model/rate_limit_error.py | 2 +- onesignal/model/segment.py | 2 +- onesignal/model/segment_data.py | 2 +- .../model/segment_notification_target.py | 2 +- .../model/start_live_activity_request.py | 357 ++ .../start_live_activity_success_response.py | 264 ++ onesignal/model/subscription.py | 2 +- onesignal/model/subscription_body.py | 2 +- .../model/subscription_notification_target.py | 14 +- onesignal/model/template_resource.py | 290 ++ onesignal/model/templates_list_response.py | 270 ++ .../transfer_subscription_request_body.py | 2 +- onesignal/model/update_api_key_request.py | 276 ++ .../model/update_live_activity_request.py | 2 +- .../update_live_activity_success_response.py | 2 +- onesignal/model/update_template_request.py | 294 ++ onesignal/model/update_user_request.py | 2 +- onesignal/model/user.py | 2 +- onesignal/model/user_identity_body.py | 2 +- onesignal/model/web_button.py | 2 +- onesignal/model_utils.py | 2 +- onesignal/models/__init__.py | 15 + onesignal/rest.py | 2 +- setup.py | 4 +- test/test_api_key_token.py | 36 + test/test_api_key_tokens_list_response.py | 38 + test/test_app.py | 2 +- test/test_apps.py | 2 +- test/test_basic_notification.py | 4 +- test/test_basic_notification_all_of.py | 2 +- ...cation_all_of_android_background_layout.py | 2 +- test/test_button.py | 2 +- test/test_copy_template_request.py | 36 + test/test_create_api_key_request.py | 36 + test/test_create_api_key_response.py | 36 + ...st_create_notification_success_response.py | 2 +- test/test_create_segment_conflict_response.py | 2 +- test/test_create_segment_success_response.py | 2 +- test/test_create_template_request.py | 38 + test/test_create_user_conflict_response.py | 2 +- ...ate_user_conflict_response_errors_inner.py | 2 +- ...ser_conflict_response_errors_items_meta.py | 2 +- test/test_custom_event.py | 36 + test/test_custom_events_request.py | 38 + test/test_default_api.py | 100 +- test/test_delivery_data.py | 2 +- test/test_export_events_success_response.py | 2 +- .../test_export_subscriptions_request_body.py | 2 +- ...t_export_subscriptions_success_response.py | 2 +- test/test_filter.py | 2 +- test/test_filter_expression.py | 2 +- test/test_generic_error.py | 2 +- test/test_generic_success_bool_response.py | 2 +- ...t_get_notification_history_request_body.py | 2 +- test/test_get_segments_success_response.py | 2 +- test/test_identity_object.py | 2 +- test/test_include_aliases.py | 36 + test/test_language_string_map.py | 2 +- test/test_notification.py | 4 +- test/test_notification_all_of.py | 2 +- ...t_notification_history_success_response.py | 2 +- test/test_notification_slice.py | 2 +- test/test_notification_target.py | 4 +- test/test_notification_with_meta.py | 4 +- test/test_notification_with_meta_all_of.py | 2 +- test/test_operator.py | 2 +- test/test_outcome_data.py | 2 +- test/test_outcomes_data.py | 2 +- test/test_platform_delivery_data.py | 2 +- ...est_platform_delivery_data_email_all_of.py | 2 +- .../test_platform_delivery_data_sms_all_of.py | 2 +- test/test_properties_body.py | 2 +- test/test_properties_deltas.py | 2 +- test/test_properties_object.py | 2 +- test/test_purchase.py | 2 +- test/test_rate_limit_error.py | 2 +- test/test_segment.py | 2 +- test/test_segment_data.py | 2 +- test/test_segment_notification_target.py | 2 +- test/test_start_live_activity_request.py | 42 + ...st_start_live_activity_success_response.py | 36 + test/test_subscription.py | 2 +- test/test_subscription_body.py | 2 +- test/test_subscription_notification_target.py | 4 +- test/test_template_resource.py | 36 + test/test_templates_list_response.py | 38 + ...test_transfer_subscription_request_body.py | 2 +- test/test_update_api_key_request.py | 36 + test/test_update_live_activity_request.py | 2 +- ...t_update_live_activity_success_response.py | 2 +- test/test_update_template_request.py | 38 + test/test_update_user_request.py | 2 +- test/test_user.py | 2 +- test/test_user_identity_body.py | 2 +- test/test_web_button.py | 2 +- 172 files changed, 9488 insertions(+), 969 deletions(-) create mode 100644 docs/ApiKeyToken.md create mode 100644 docs/ApiKeyTokensListResponse.md create mode 100644 docs/CopyTemplateRequest.md create mode 100644 docs/CreateApiKeyRequest.md create mode 100644 docs/CreateApiKeyResponse.md create mode 100644 docs/CreateTemplateRequest.md create mode 100644 docs/CustomEvent.md create mode 100644 docs/CustomEventsRequest.md create mode 100644 docs/IncludeAliases.md create mode 100644 docs/StartLiveActivityRequest.md create mode 100644 docs/StartLiveActivitySuccessResponse.md create mode 100644 docs/TemplateResource.md create mode 100644 docs/TemplatesListResponse.md create mode 100644 docs/UpdateApiKeyRequest.md create mode 100644 docs/UpdateTemplateRequest.md create mode 100644 onesignal/model/api_key_token.py create mode 100644 onesignal/model/api_key_tokens_list_response.py create mode 100644 onesignal/model/copy_template_request.py create mode 100644 onesignal/model/create_api_key_request.py create mode 100644 onesignal/model/create_api_key_response.py create mode 100644 onesignal/model/create_template_request.py create mode 100644 onesignal/model/custom_event.py create mode 100644 onesignal/model/custom_events_request.py create mode 100644 onesignal/model/include_aliases.py create mode 100644 onesignal/model/start_live_activity_request.py create mode 100644 onesignal/model/start_live_activity_success_response.py create mode 100644 onesignal/model/template_resource.py create mode 100644 onesignal/model/templates_list_response.py create mode 100644 onesignal/model/update_api_key_request.py create mode 100644 onesignal/model/update_template_request.py create mode 100644 test/test_api_key_token.py create mode 100644 test/test_api_key_tokens_list_response.py create mode 100644 test/test_copy_template_request.py create mode 100644 test/test_create_api_key_request.py create mode 100644 test/test_create_api_key_response.py create mode 100644 test/test_create_template_request.py create mode 100644 test/test_custom_event.py create mode 100644 test/test_custom_events_request.py create mode 100644 test/test_include_aliases.py create mode 100644 test/test_start_live_activity_request.py create mode 100644 test/test_start_live_activity_success_response.py create mode 100644 test/test_template_resource.py create mode 100644 test/test_templates_list_response.py create mode 100644 test/test_update_api_key_request.py create mode 100644 test/test_update_template_request.py diff --git a/README.md b/README.md index f099188..0ec481d 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -- API version: 5.2.1 -- Package version: 5.2.2-beta1 +- API version: 5.3.0 +- Package version: 5.3.0-beta1 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -83,16 +83,22 @@ All URIs are relative to *https://api.onesignal.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +*DefaultApi* | [**copy_template_to_app**](docs/DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app *DefaultApi* | [**create_alias**](docs/DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | *DefaultApi* | [**create_alias_by_subscription**](docs/DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*DefaultApi* | [**create_api_key**](docs/DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key *DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app +*DefaultApi* | [**create_custom_events**](docs/DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events *DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification *DefaultApi* | [**create_segment**](docs/DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment *DefaultApi* | [**create_subscription**](docs/DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +*DefaultApi* | [**create_template**](docs/DefaultApi.md#create_template) | **POST** /templates | Create template *DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | *DefaultApi* | [**delete_alias**](docs/DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | +*DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key *DefaultApi* | [**delete_segment**](docs/DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment *DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**delete_template**](docs/DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template *DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *DefaultApi* | [**export_events**](docs/DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events *DefaultApi* | [**export_subscriptions**](docs/DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions @@ -106,28 +112,44 @@ Class | Method | HTTP request | Description *DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes *DefaultApi* | [**get_segments**](docs/DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments *DefaultApi* | [**get_user**](docs/DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*DefaultApi* | [**rotate_api_key**](docs/DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key +*DefaultApi* | [**start_live_activity**](docs/DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity *DefaultApi* | [**transfer_subscription**](docs/DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | *DefaultApi* | [**unsubscribe_email_with_token**](docs/DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token +*DefaultApi* | [**update_api_key**](docs/DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key *DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app *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 *DefaultApi* | [**update_subscription**](docs/DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +*DefaultApi* | [**update_subscription_by_token**](docs/DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token +*DefaultApi* | [**update_template**](docs/DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template *DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*DefaultApi* | [**view_api_keys**](docs/DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys +*DefaultApi* | [**view_template**](docs/DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template +*DefaultApi* | [**view_templates**](docs/DefaultApi.md#view_templates) | **GET** /templates | View templates ## Documentation For Models + - [ApiKeyToken](docs/ApiKeyToken.md) + - [ApiKeyTokensListResponse](docs/ApiKeyTokensListResponse.md) - [App](docs/App.md) - [Apps](docs/Apps.md) - [BasicNotification](docs/BasicNotification.md) - [BasicNotificationAllOf](docs/BasicNotificationAllOf.md) - [BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md) - [Button](docs/Button.md) + - [CopyTemplateRequest](docs/CopyTemplateRequest.md) + - [CreateApiKeyRequest](docs/CreateApiKeyRequest.md) + - [CreateApiKeyResponse](docs/CreateApiKeyResponse.md) - [CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md) - [CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) + - [CreateTemplateRequest](docs/CreateTemplateRequest.md) - [CreateUserConflictResponse](docs/CreateUserConflictResponse.md) - [CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) - [CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) + - [CustomEvent](docs/CustomEvent.md) + - [CustomEventsRequest](docs/CustomEventsRequest.md) - [DeliveryData](docs/DeliveryData.md) - [ExportEventsSuccessResponse](docs/ExportEventsSuccessResponse.md) - [ExportSubscriptionsRequestBody](docs/ExportSubscriptionsRequestBody.md) @@ -139,6 +161,7 @@ Class | Method | HTTP request | Description - [GetNotificationHistoryRequestBody](docs/GetNotificationHistoryRequestBody.md) - [GetSegmentsSuccessResponse](docs/GetSegmentsSuccessResponse.md) - [IdentityObject](docs/IdentityObject.md) + - [IncludeAliases](docs/IncludeAliases.md) - [LanguageStringMap](docs/LanguageStringMap.md) - [Notification](docs/Notification.md) - [NotificationAllOf](docs/NotificationAllOf.md) @@ -161,12 +184,18 @@ Class | Method | HTTP request | Description - [Segment](docs/Segment.md) - [SegmentData](docs/SegmentData.md) - [SegmentNotificationTarget](docs/SegmentNotificationTarget.md) + - [StartLiveActivityRequest](docs/StartLiveActivityRequest.md) + - [StartLiveActivitySuccessResponse](docs/StartLiveActivitySuccessResponse.md) - [Subscription](docs/Subscription.md) - [SubscriptionBody](docs/SubscriptionBody.md) - [SubscriptionNotificationTarget](docs/SubscriptionNotificationTarget.md) + - [TemplateResource](docs/TemplateResource.md) + - [TemplatesListResponse](docs/TemplatesListResponse.md) - [TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) + - [UpdateApiKeyRequest](docs/UpdateApiKeyRequest.md) - [UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) + - [UpdateTemplateRequest](docs/UpdateTemplateRequest.md) - [UpdateUserRequest](docs/UpdateUserRequest.md) - [User](docs/User.md) - [UserIdentityBody](docs/UserIdentityBody.md) diff --git a/docs/ApiKeyToken.md b/docs/ApiKeyToken.md new file mode 100644 index 0000000..0d1f177 --- /dev/null +++ b/docs/ApiKeyToken.md @@ -0,0 +1,17 @@ +# ApiKeyToken + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **str** | | [optional] +**updated_at** | **str** | | [optional] +**created_at** | **str** | | [optional] +**name** | **str** | | [optional] +**ip_allowlist_mode** | **str** | | [optional] +**ip_allowlist** | **[str]** | | [optional] +**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] + +[[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/ApiKeyTokensListResponse.md b/docs/ApiKeyTokensListResponse.md new file mode 100644 index 0000000..635e8fd --- /dev/null +++ b/docs/ApiKeyTokensListResponse.md @@ -0,0 +1,12 @@ +# ApiKeyTokensListResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tokens** | [**[ApiKeyToken]**](ApiKeyToken.md) | | [optional] +**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] + +[[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/BasicNotification.md b/docs/BasicNotification.md index 9883e87..5dc7f59 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **include_chrome_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_chrome_web_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_android_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] -**include_aliases** | **{str: ([str],)}, none_type** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] **target_channel** | **str** | | [optional] **id** | **str** | | [optional] **value** | **int** | | [optional] [readonly] diff --git a/docs/CopyTemplateRequest.md b/docs/CopyTemplateRequest.md new file mode 100644 index 0000000..0b39299 --- /dev/null +++ b/docs/CopyTemplateRequest.md @@ -0,0 +1,12 @@ +# CopyTemplateRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_app_id** | **str** | Destination OneSignal App ID in UUID v4 format. | +**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] + +[[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/CreateApiKeyRequest.md b/docs/CreateApiKeyRequest.md new file mode 100644 index 0000000..e7a7775 --- /dev/null +++ b/docs/CreateApiKeyRequest.md @@ -0,0 +1,14 @@ +# CreateApiKeyRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**ip_allowlist_mode** | **str** | | [optional] +**ip_allowlist** | **[str]** | | [optional] +**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] + +[[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/CreateApiKeyResponse.md b/docs/CreateApiKeyResponse.md new file mode 100644 index 0000000..df68152 --- /dev/null +++ b/docs/CreateApiKeyResponse.md @@ -0,0 +1,13 @@ +# CreateApiKeyResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **str** | | [optional] +**formatted_token** | **str** | | [optional] +**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] + +[[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/CreateTemplateRequest.md b/docs/CreateTemplateRequest.md new file mode 100644 index 0000000..e1bba80 --- /dev/null +++ b/docs/CreateTemplateRequest.md @@ -0,0 +1,19 @@ +# CreateTemplateRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | **str** | Your OneSignal App ID in UUID v4 format. | +**name** | **str** | Name of the template. | +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | +**is_email** | **bool** | Set true for an Email template. | [optional] +**email_subject** | **str, none_type** | Subject of the email. | [optional] +**email_body** | **str, none_type** | Body of the email (HTML supported). | [optional] +**is_sms** | **bool** | Set true for an SMS template. | [optional] +**dynamic_content** | **str, none_type** | JSON string for dynamic content personalization. | [optional] +**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] + +[[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/CustomEvent.md b/docs/CustomEvent.md new file mode 100644 index 0000000..a9ad8de --- /dev/null +++ b/docs/CustomEvent.md @@ -0,0 +1,16 @@ +# CustomEvent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The identifier or name of the event. Maximum 128 characters. | +**external_id** | **str, none_type** | The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] +**onesignal_id** | **str, none_type** | The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required. | [optional] +**timestamp** | **datetime** | Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided. | [optional] +**payload** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Properties or data related to the event, like {\"geography\": \"USA\"} | [optional] +**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] + +[[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/CustomEventsRequest.md b/docs/CustomEventsRequest.md new file mode 100644 index 0000000..81fe03d --- /dev/null +++ b/docs/CustomEventsRequest.md @@ -0,0 +1,12 @@ +# CustomEventsRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**[CustomEvent]**](CustomEvent.md) | | +**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] + +[[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 8c1c0b8..17be4a3 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -5,16 +5,22 @@ All URIs are relative to *https://api.onesignal.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification +[**copy_template_to_app**](DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app [**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | [**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +[**create_api_key**](DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app +[**create_custom_events**](DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification [**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +[**create_template**](DefaultApi.md#create_template) | **POST** /templates | Create template [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | +[**delete_api_key**](DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key [**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +[**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions @@ -28,12 +34,20 @@ Method | HTTP request | Description [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**rotate_api_key**](DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key +[**start_live_activity**](DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | [**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token +[**update_api_key**](DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +[**update_subscription_by_token**](DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token +[**update_template**](DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**view_api_keys**](DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys +[**view_template**](DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template +[**view_templates**](DefaultApi.md#view_templates) | **GET** /templates | View templates # **cancel_notification** @@ -104,6 +118,76 @@ Name | Type | Description | Notes [[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) +# **copy_template_to_app** +> TemplateResource copy_template_to_app(template_id, app_id, copy_template_request) + +Copy template to another app + +Copy a template to a destination app. + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.copy_template_request import CopyTemplateRequest +from onesignal.model.template_resource import TemplateResource +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + template_id = "template_id_example" + app_id = "app_id_example" + copy_template_request = CopyTemplateRequest( + target_app_id="target_app_id_example", + ) + + # example passing only required values which don't have defaults set + try: + # Copy template to another app + api_response = api_instance.copy_template_to_app(template_id, app_id, copy_template_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->copy_template_to_app: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + **app_id** | **str**| | + **copy_template_request** | [**CopyTemplateRequest**](CopyTemplateRequest.md)| | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + # **create_alias** > UserIdentityBody create_alias(app_id, alias_label, alias_id, user_identity_body) @@ -254,6 +338,78 @@ Name | Type | Description | Notes [[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) +# **create_api_key** +> CreateApiKeyResponse create_api_key(app_id, create_api_key_request) + +Create API key + +Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.create_api_key_response import CreateApiKeyResponse +from onesignal.model.create_api_key_request import CreateApiKeyRequest +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + create_api_key_request = CreateApiKeyRequest( + name="name_example", + ip_allowlist_mode="disabled", + ip_allowlist=[ + "ip_allowlist_example", + ], + ) + + # example passing only required values which don't have defaults set + try: + # Create API key + api_response = api_instance.create_api_key(app_id, create_api_key_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->create_api_key: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| | + **create_api_key_request** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md)| | + +### Return type + +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + # **create_app** > App create_app(app) @@ -341,6 +497,84 @@ Name | Type | Description | Notes [[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) +# **create_custom_events** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} create_custom_events(app_id, custom_events_request) + +Create custom events + +The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.custom_events_request import CustomEventsRequest +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" # Your OneSignal App ID in UUID v4 format. + custom_events_request = CustomEventsRequest( + events=[ + CustomEvent( + name="name_example", + external_id="external_id_example", + onesignal_id="onesignal_id_example", + timestamp=dateutil_parser('1970-01-01T00:00:00.00Z'), + payload={}, + ), + ], + ) + + # example passing only required values which don't have defaults set + try: + # Create custom events + api_response = api_instance.create_custom_events(app_id, custom_events_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->create_custom_events: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **custom_events_request** | [**CustomEventsRequest**](CustomEventsRequest.md)| | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**429** | Rate Limit Exceeded | - | + +[[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) + # **create_notification** > CreateNotificationSuccessResponse create_notification(notification) @@ -585,12 +819,12 @@ Name | Type | Description | Notes [[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) -# **create_user** -> User create_user(app_id, user) - +# **create_template** +> TemplateResource create_template(create_template_request) +Create template -Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. +Create reusable message templates for push, email, and SMS channels. ### Example @@ -599,51 +833,169 @@ Creates a User, optionally Subscriptions owned by the User as well as Aliases. A ```python import onesignal from onesignal.api import default_api -from onesignal.model.user import User -from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.create_template_request import CreateTemplateRequest +from onesignal.model.template_resource import TemplateResource from onesignal.model.generic_error import GenericError -from onesignal.model.create_user_conflict_response import CreateUserConflictResponse from pprint import pprint # Enter a context with an instance of the API client with onesignal.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) - app_id = "app_id_example" - user = User( - properties=PropertiesObject( - tags={}, - language="language_example", - timezone_id="timezone_id_example", - lat=3.14, - long=3.14, - country="country_example", - first_active=1, - last_active=1, - amount_spent=3.14, - purchases=[ - Purchase( - sku="sku_example", - amount="amount_example", - iso="iso_example", - count=1, - ), - ], - ip="ip_example", - ), - identity=IdentityObject( - key="key_example", + create_template_request = CreateTemplateRequest( + app_id="app_id_example", + name="name_example", + contents=LanguageStringMap( + en="en_example", + ar="ar_example", + bs="bs_example", + bg="bg_example", + ca="ca_example", + zh_hans="zh_hans_example", + zh_hant="zh_hant_example", + zh="zh_example", + hr="hr_example", + cs="cs_example", + da="da_example", + nl="nl_example", + et="et_example", + fi="fi_example", + fr="fr_example", + ka="ka_example", + de="de_example", + el="el_example", + hi="hi_example", + he="he_example", + hu="hu_example", + id="id_example", + it="it_example", + ja="ja_example", + ko="ko_example", + lv="lv_example", + lt="lt_example", + ms="ms_example", + nb="nb_example", + pl="pl_example", + fa="fa_example", + pt="pt_example", + pa="pa_example", + ro="ro_example", + ru="ru_example", + sr="sr_example", + sk="sk_example", + es="es_example", + sv="sv_example", + th="th_example", + tr="tr_example", + uk="uk_example", + vi="vi_example", ), - subscriptions=[ - Subscription( - id="id_example", - type="iOSPush", - token="token_example", - enabled=True, - notification_types=1, - session_time=1, - session_count=1, - sdk="sdk_example", + is_email=True, + email_subject="email_subject_example", + email_body="email_body_example", + is_sms=True, + dynamic_content="dynamic_content_example", + ) + + # example passing only required values which don't have defaults set + try: + # Create template + api_response = api_instance.create_template(create_template_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->create_template: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_template_request** | [**CreateTemplateRequest**](CreateTemplateRequest.md)| | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**422** | Unprocessable Entity | - | + +[[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) + +# **create_user** +> User create_user(app_id, user) + + + +Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.user import User +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from onesignal.model.create_user_conflict_response import CreateUserConflictResponse +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + user = User( + properties=PropertiesObject( + tags={}, + language="language_example", + timezone_id="timezone_id_example", + lat=3.14, + long=3.14, + country="country_example", + first_active=1, + last_active=1, + amount_spent=3.14, + purchases=[ + Purchase( + sku="sku_example", + amount="amount_example", + iso="iso_example", + count=1, + ), + ], + ip="ip_example", + ), + identity=IdentityObject( + key="key_example", + ), + subscriptions=[ + Subscription( + id="id_example", + type="iOSPush", + token="token_example", + enabled=True, + notification_types=1, + session_time=1, + session_count=1, + sdk="sdk_example", device_model="device_model_example", device_os="device_os_example", rooted=True, @@ -772,6 +1124,70 @@ Name | Type | Description | Notes [[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) +# **delete_api_key** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} delete_api_key(app_id, token_id) + +Delete API key + +Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + token_id = "token_id_example" + + # example passing only required values which don't have defaults set + try: + # Delete API key + api_response = api_instance.delete_api_key(app_id, token_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->delete_api_key: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| | + **token_id** | **str**| | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + # **delete_segment** > GenericSuccessBoolResponse delete_segment(app_id, segment_id) @@ -906,6 +1322,72 @@ void (empty response body) [[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) +# **delete_template** +> GenericSuccessBoolResponse delete_template(template_id, app_id) + +Delete template + +Delete a template by id. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.generic_error import GenericError +from onesignal.model.generic_success_bool_response import GenericSuccessBoolResponse +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + template_id = "template_id_example" + app_id = "app_id_example" + + # example passing only required values which don't have defaults set + try: + # Delete template + api_response = api_instance.delete_template(template_id, app_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->delete_template: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + **app_id** | **str**| | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[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) + # **delete_user** > delete_user(app_id, alias_label, alias_id) @@ -1836,24 +2318,22 @@ Name | Type | Description | Notes [[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) -# **transfer_subscription** -> UserIdentityBody transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) - +# **rotate_api_key** +> CreateApiKeyResponse rotate_api_key(app_id, token_id) +Rotate API key -Transfers this Subscription to the User identified by the identity in the payload. +Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. ### Example -* Bearer Authentication (rest_api_key): +* Bearer Authentication (organization_api_key): ```python import onesignal from onesignal.api import default_api -from onesignal.model.transfer_subscription_request_body import TransferSubscriptionRequestBody -from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.create_api_key_response import CreateApiKeyResponse from onesignal.model.generic_error import GenericError -from onesignal.model.user_identity_body import UserIdentityBody from pprint import pprint # Enter a context with an instance of the API client @@ -1861,19 +2341,15 @@ with onesignal.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) app_id = "app_id_example" - subscription_id = "subscription_id_example" - transfer_subscription_request_body = TransferSubscriptionRequestBody( - identity={ - "key": "key_example", - }, - ) + token_id = "token_id_example" # example passing only required values which don't have defaults set try: - api_response = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) + # Rotate API key + api_response = api_instance.rotate_api_key(app_id, token_id) pprint(api_response) except onesignal.ApiException as e: - print("Exception when calling DefaultApi->transfer_subscription: %s\n" % e) + print("Exception when calling DefaultApi->rotate_api_key: %s\n" % e) ``` @@ -1882,20 +2358,19 @@ with onesignal.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| | - **subscription_id** | **str**| | - **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | + **token_id** | **str**| | ### Return type -[**UserIdentityBody**](UserIdentityBody.md) +[**CreateApiKeyResponse**](CreateApiKeyResponse.md) ### Authorization -[rest_api_key](../README.md#rest_api_key) +[organization_api_key](../README.md#organization_api_key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -1905,18 +2380,15 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | OK | - | **400** | Bad Request | - | -**404** | Not Found | - | -**409** | Conflict | - | -**429** | Rate Limit Exceeded | - | [[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) -# **unsubscribe_email_with_token** -> GenericSuccessBoolResponse unsubscribe_email_with_token(app_id, notification_id, token) +# **start_live_activity** +> StartLiveActivitySuccessResponse start_live_activity(app_id, activity_type, start_live_activity_request) -Unsubscribe with token +Start Live Activity -Unsubscribe an email with a token when using your own custom email unsubscribe landing page +Remotely start a Live Activity on iOS devices via OneSignal’s REST API. ### Example @@ -1925,179 +2397,23 @@ Unsubscribe an email with a token when using your own custom email unsubscribe l ```python import onesignal from onesignal.api import default_api +from onesignal.model.start_live_activity_success_response import StartLiveActivitySuccessResponse from onesignal.model.rate_limit_error import RateLimitError from onesignal.model.generic_error import GenericError -from onesignal.model.generic_success_bool_response import GenericSuccessBoolResponse +from onesignal.model.start_live_activity_request import StartLiveActivityRequest from pprint import pprint # Enter a context with an instance of the API client with onesignal.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) - app_id = "app_id_example" # The OneSignal App ID for your app. Available in Keys & IDs. - notification_id = "notification_id_example" # The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. - token = "token_example" # The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. - - # example passing only required values which don't have defaults set - try: - # Unsubscribe with token - api_response = api_instance.unsubscribe_email_with_token(app_id, notification_id, token) - pprint(api_response) - except onesignal.ApiException as e: - print("Exception when calling DefaultApi->unsubscribe_email_with_token: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | - **notification_id** | **str**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | - **token** | **str**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | - -### Return type - -[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) - -### Authorization - -[rest_api_key](../README.md#rest_api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**202** | OK | - | -**400** | Bad Request | - | -**429** | Rate Limit Exceeded | - | - -[[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) - -# **update_app** -> App update_app(app_id, app) - -Update an app - -Updates the name or configuration settings of an existing OneSignal app - -### Example - -* Bearer Authentication (organization_api_key): - -```python -import onesignal -from onesignal.api import default_api -from onesignal.model.app import App -from onesignal.model.rate_limit_error import RateLimitError -from onesignal.model.generic_error import GenericError -from pprint import pprint - -# Enter a context with an instance of the API client -with onesignal.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - app_id = "app_id_example" # An app id - app = App( - name="name_example", - android_gcm_sender_id="android_gcm_sender_id_example", - gcm_key="gcm_key_example", - chrome_web_origin="chrome_web_origin_example", - chrome_key="chrome_key_example", - chrome_web_default_notification_icon="chrome_web_default_notification_icon_example", - chrome_web_sub_domain="chrome_web_sub_domain_example", - apns_env="sandbox", - apns_p12="apns_p12_example", - apns_p12_password="apns_p12_password_example", - safari_apns_p12="safari_apns_p12_example", - safari_apns_p12_password="safari_apns_p12_password_example", - apns_key_id="apns_key_id_example", - apns_team_id="apns_team_id_example", - apns_bundle_id="apns_bundle_id_example", - apns_p8="apns_p8_example", - safari_site_origin="safari_site_origin_example", - safari_icon_256_256="safari_icon_256_256_example", - site_name="site_name_example", - organization_id="organization_id_example", - additional_data_is_root_payload=True, - ) - - # example passing only required values which don't have defaults set - try: - # Update an app - api_response = api_instance.update_app(app_id, app) - pprint(api_response) - except onesignal.ApiException as e: - print("Exception when calling DefaultApi->update_app: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **app_id** | **str**| An app id | - **app** | [**App**](App.md)| | - -### Return type - -[**App**](App.md) - -### Authorization - -[organization_api_key](../README.md#organization_api_key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | -**429** | Rate Limit Exceeded | - | - -[[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) - -# **update_live_activity** -> UpdateLiveActivitySuccessResponse update_live_activity(app_id, activity_id, update_live_activity_request) - -Update a Live Activity via Push - -Updates a specified live activity. - -### Example - -* Bearer Authentication (rest_api_key): - -```python -import onesignal -from onesignal.api import default_api -from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest -from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse -from onesignal.model.rate_limit_error import RateLimitError -from onesignal.model.generic_error import GenericError -from pprint import pprint - -# Enter a context with an instance of the API client -with onesignal.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = default_api.DefaultApi(api_client) - app_id = "app_id_example" # The OneSignal App ID for your app. Available in Keys & IDs. - activity_id = "activity_id_example" # Live Activity record ID - update_live_activity_request = UpdateLiveActivityRequest( + app_id = "app_id_example" # Your OneSignal App ID in UUID v4 format. + activity_type = "activity_type_example" # The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + start_live_activity_request = StartLiveActivityRequest( name="name_example", - event="update", + event="start", + activity_id="activity_id_example", + event_attributes={}, event_updates={}, contents=LanguageStringMap( en="en_example", @@ -2189,19 +2505,36 @@ with onesignal.ApiClient(configuration) as api_client: uk="uk_example", vi="vi_example", ), - sound="sound_example", stale_date=1, - dismissal_date=1, priority=1, + ios_relevance_score=3.14, + idempotency_key="idempotency_key_example", + include_aliases=IncludeAliases( + key=[ + "key_example", + ], + ), + include_subscription_ids=[ + "include_subscription_ids_example", + ], + included_segments=[ + "included_segments_example", + ], + excluded_segments=[ + "excluded_segments_example", + ], + filters=[ + FilterExpression(None), + ], ) # example passing only required values which don't have defaults set try: - # Update a Live Activity via Push - api_response = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request) + # Start Live Activity + api_response = api_instance.start_live_activity(app_id, activity_type, start_live_activity_request) pprint(api_response) except onesignal.ApiException as e: - print("Exception when calling DefaultApi->update_live_activity: %s\n" % e) + print("Exception when calling DefaultApi->start_live_activity: %s\n" % e) ``` @@ -2209,13 +2542,13 @@ with onesignal.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | - **activity_id** | **str**| Live Activity record ID | - **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md)| | + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **activity_type** | **str**| The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. | + **start_live_activity_request** | [**StartLiveActivityRequest**](StartLiveActivityRequest.md)| | ### Return type -[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md) +[**StartLiveActivitySuccessResponse**](StartLiveActivitySuccessResponse.md) ### Authorization @@ -2231,18 +2564,18 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**201** | Created | - | **400** | Bad Request | - | **429** | Rate Limit Exceeded | - | [[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) -# **update_subscription** -> update_subscription(app_id, subscription_id, subscription_body) +# **transfer_subscription** +> UserIdentityBody transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) -Updates an existing Subscription’s properties. +Transfers this Subscription to the User identified by the identity in the payload. ### Example @@ -2251,9 +2584,10 @@ Updates an existing Subscription’s properties. ```python import onesignal from onesignal.api import default_api +from onesignal.model.transfer_subscription_request_body import TransferSubscriptionRequestBody from onesignal.model.rate_limit_error import RateLimitError from onesignal.model.generic_error import GenericError -from onesignal.model.subscription_body import SubscriptionBody +from onesignal.model.user_identity_body import UserIdentityBody from pprint import pprint # Enter a context with an instance of the API client @@ -2262,33 +2596,18 @@ with onesignal.ApiClient(configuration) as api_client: api_instance = default_api.DefaultApi(api_client) app_id = "app_id_example" subscription_id = "subscription_id_example" - subscription_body = SubscriptionBody( - subscription=Subscription( - id="id_example", - type="iOSPush", - token="token_example", - enabled=True, - notification_types=1, - session_time=1, - session_count=1, - sdk="sdk_example", - device_model="device_model_example", - device_os="device_os_example", - rooted=True, - test_type=1, - app_version="app_version_example", - net_type=1, - carrier="carrier_example", - web_auth="web_auth_example", - web_p256="web_p256_example", - ), + transfer_subscription_request_body = TransferSubscriptionRequestBody( + identity={ + "key": "key_example", + }, ) # example passing only required values which don't have defaults set try: - api_instance.update_subscription(app_id, subscription_id, subscription_body) + api_response = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) + pprint(api_response) except onesignal.ApiException as e: - print("Exception when calling DefaultApi->update_subscription: %s\n" % e) + print("Exception when calling DefaultApi->transfer_subscription: %s\n" % e) ``` @@ -2298,11 +2617,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| | **subscription_id** | **str**| | - **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md)| | + **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md)| | ### Return type -void (empty response body) +[**UserIdentityBody**](UserIdentityBody.md) ### Authorization @@ -2326,12 +2645,12 @@ void (empty response body) [[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) -# **update_user** -> PropertiesBody update_user(app_id, alias_label, alias_id, update_user_request) - +# **unsubscribe_email_with_token** +> GenericSuccessBoolResponse unsubscribe_email_with_token(app_id, notification_id, token) +Unsubscribe with token -Updates an existing User’s properties. +Unsubscribe an email with a token when using your own custom email unsubscribe landing page ### Example @@ -2340,55 +2659,753 @@ Updates an existing User’s properties. ```python import onesignal from onesignal.api import default_api -from onesignal.model.update_user_request import UpdateUserRequest -from onesignal.model.properties_body import PropertiesBody from onesignal.model.rate_limit_error import RateLimitError from onesignal.model.generic_error import GenericError +from onesignal.model.generic_success_bool_response import GenericSuccessBoolResponse from pprint import pprint # Enter a context with an instance of the API client with onesignal.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) - app_id = "app_id_example" - alias_label = "alias_label_example" - alias_id = "alias_id_example" - update_user_request = UpdateUserRequest( - properties=PropertiesObject( - tags={}, - language="language_example", - timezone_id="timezone_id_example", - lat=3.14, - long=3.14, - country="country_example", - first_active=1, - last_active=1, - amount_spent=3.14, - purchases=[ - Purchase( - sku="sku_example", - amount="amount_example", - iso="iso_example", - count=1, - ), - ], - ip="ip_example", - ), - refresh_device_metadata=False, - deltas=PropertiesDeltas( - session_time=1, - session_count=1, - purchases=[ - Purchase( - sku="sku_example", - amount="amount_example", - iso="iso_example", - count=1, - ), - ], - ), - ) - + app_id = "app_id_example" # The OneSignal App ID for your app. Available in Keys & IDs. + notification_id = "notification_id_example" # The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + token = "token_example" # The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. + + # example passing only required values which don't have defaults set + try: + # Unsubscribe with token + api_response = api_instance.unsubscribe_email_with_token(app_id, notification_id, token) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->unsubscribe_email_with_token: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | + **notification_id** | **str**| The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | + **token** | **str**| The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | OK | - | +**400** | Bad Request | - | +**429** | Rate Limit Exceeded | - | + +[[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) + +# **update_api_key** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} update_api_key(app_id, token_id, update_api_key_request) + +Update API key + +Update a Rich Authentication Token (App API Key) for a OneSignal app. + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.update_api_key_request import UpdateApiKeyRequest +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + token_id = "token_id_example" + update_api_key_request = UpdateApiKeyRequest( + name="name_example", + ip_allowlist_mode="disabled", + ip_allowlist=[ + "ip_allowlist_example", + ], + ) + + # example passing only required values which don't have defaults set + try: + # Update API key + api_response = api_instance.update_api_key(app_id, token_id, update_api_key_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_api_key: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| | + **token_id** | **str**| | + **update_api_key_request** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md)| | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + +# **update_app** +> App update_app(app_id, app) + +Update an app + +Updates the name or configuration settings of an existing OneSignal app + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.app import App +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" # An app id + app = App( + name="name_example", + android_gcm_sender_id="android_gcm_sender_id_example", + gcm_key="gcm_key_example", + chrome_web_origin="chrome_web_origin_example", + chrome_key="chrome_key_example", + chrome_web_default_notification_icon="chrome_web_default_notification_icon_example", + chrome_web_sub_domain="chrome_web_sub_domain_example", + apns_env="sandbox", + apns_p12="apns_p12_example", + apns_p12_password="apns_p12_password_example", + safari_apns_p12="safari_apns_p12_example", + safari_apns_p12_password="safari_apns_p12_password_example", + apns_key_id="apns_key_id_example", + apns_team_id="apns_team_id_example", + apns_bundle_id="apns_bundle_id_example", + apns_p8="apns_p8_example", + safari_site_origin="safari_site_origin_example", + safari_icon_256_256="safari_icon_256_256_example", + site_name="site_name_example", + organization_id="organization_id_example", + additional_data_is_root_payload=True, + ) + + # example passing only required values which don't have defaults set + try: + # Update an app + api_response = api_instance.update_app(app_id, app) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_app: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| An app id | + **app** | [**App**](App.md)| | + +### Return type + +[**App**](App.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**429** | Rate Limit Exceeded | - | + +[[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) + +# **update_live_activity** +> UpdateLiveActivitySuccessResponse update_live_activity(app_id, activity_id, update_live_activity_request) + +Update a Live Activity via Push + +Updates a specified live activity. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest +from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" # The OneSignal App ID for your app. Available in Keys & IDs. + activity_id = "activity_id_example" # Live Activity record ID + update_live_activity_request = UpdateLiveActivityRequest( + name="name_example", + event="update", + event_updates={}, + contents=LanguageStringMap( + en="en_example", + ar="ar_example", + bs="bs_example", + bg="bg_example", + ca="ca_example", + zh_hans="zh_hans_example", + zh_hant="zh_hant_example", + zh="zh_example", + hr="hr_example", + cs="cs_example", + da="da_example", + nl="nl_example", + et="et_example", + fi="fi_example", + fr="fr_example", + ka="ka_example", + de="de_example", + el="el_example", + hi="hi_example", + he="he_example", + hu="hu_example", + id="id_example", + it="it_example", + ja="ja_example", + ko="ko_example", + lv="lv_example", + lt="lt_example", + ms="ms_example", + nb="nb_example", + pl="pl_example", + fa="fa_example", + pt="pt_example", + pa="pa_example", + ro="ro_example", + ru="ru_example", + sr="sr_example", + sk="sk_example", + es="es_example", + sv="sv_example", + th="th_example", + tr="tr_example", + uk="uk_example", + vi="vi_example", + ), + headings=LanguageStringMap( + en="en_example", + ar="ar_example", + bs="bs_example", + bg="bg_example", + ca="ca_example", + zh_hans="zh_hans_example", + zh_hant="zh_hant_example", + zh="zh_example", + hr="hr_example", + cs="cs_example", + da="da_example", + nl="nl_example", + et="et_example", + fi="fi_example", + fr="fr_example", + ka="ka_example", + de="de_example", + el="el_example", + hi="hi_example", + he="he_example", + hu="hu_example", + id="id_example", + it="it_example", + ja="ja_example", + ko="ko_example", + lv="lv_example", + lt="lt_example", + ms="ms_example", + nb="nb_example", + pl="pl_example", + fa="fa_example", + pt="pt_example", + pa="pa_example", + ro="ro_example", + ru="ru_example", + sr="sr_example", + sk="sk_example", + es="es_example", + sv="sv_example", + th="th_example", + tr="tr_example", + uk="uk_example", + vi="vi_example", + ), + sound="sound_example", + stale_date=1, + dismissal_date=1, + priority=1, + ) + + # example passing only required values which don't have defaults set + try: + # Update a Live Activity via Push + api_response = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_live_activity: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | + **activity_id** | **str**| Live Activity record ID | + **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md)| | + +### Return type + +[**UpdateLiveActivitySuccessResponse**](UpdateLiveActivitySuccessResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**429** | Rate Limit Exceeded | - | + +[[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) + +# **update_subscription** +> update_subscription(app_id, subscription_id, subscription_body) + + + +Updates an existing Subscription’s properties. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from onesignal.model.subscription_body import SubscriptionBody +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + subscription_id = "subscription_id_example" + subscription_body = SubscriptionBody( + subscription=Subscription( + id="id_example", + type="iOSPush", + token="token_example", + enabled=True, + notification_types=1, + session_time=1, + session_count=1, + sdk="sdk_example", + device_model="device_model_example", + device_os="device_os_example", + rooted=True, + test_type=1, + app_version="app_version_example", + net_type=1, + carrier="carrier_example", + web_auth="web_auth_example", + web_p256="web_p256_example", + ), + ) + + # example passing only required values which don't have defaults set + try: + api_instance.update_subscription(app_id, subscription_id, subscription_body) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_subscription: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| | + **subscription_id** | **str**| | + **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Rate Limit Exceeded | - | + +[[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) + +# **update_subscription_by_token** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} update_subscription_by_token(app_id, token_type, token, subscription_body) + +Update subscription by token + +Update properties on an existing OneSignal subscription using its token. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.generic_error import GenericError +from onesignal.model.subscription_body import SubscriptionBody +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" # Your OneSignal App ID in UUID v4 format. + token_type = "token_type_example" # The type of token to use when looking up the subscription. See Subscription Types. + token = "token_example" # The value of the token to lookup by (e.g., email address, phone number). + subscription_body = SubscriptionBody( + subscription=Subscription( + id="id_example", + type="iOSPush", + token="token_example", + enabled=True, + notification_types=1, + session_time=1, + session_count=1, + sdk="sdk_example", + device_model="device_model_example", + device_os="device_os_example", + rooted=True, + test_type=1, + app_version="app_version_example", + net_type=1, + carrier="carrier_example", + web_auth="web_auth_example", + web_p256="web_p256_example", + ), + ) + + # example passing only required values which don't have defaults set + try: + # Update subscription by token + api_response = api_instance.update_subscription_by_token(app_id, token_type, token, subscription_body) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_subscription_by_token: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **token_type** | **str**| The type of token to use when looking up the subscription. See Subscription Types. | + **token** | **str**| The value of the token to lookup by (e.g., email address, phone number). | + **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md)| | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | ACCEPTED | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[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) + +# **update_template** +> TemplateResource update_template(template_id, app_id, update_template_request) + +Update template + +Update an existing template. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.update_template_request import UpdateTemplateRequest +from onesignal.model.template_resource import TemplateResource +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + template_id = "template_id_example" + app_id = "app_id_example" + update_template_request = UpdateTemplateRequest( + name="name_example", + contents=LanguageStringMap( + en="en_example", + ar="ar_example", + bs="bs_example", + bg="bg_example", + ca="ca_example", + zh_hans="zh_hans_example", + zh_hant="zh_hant_example", + zh="zh_example", + hr="hr_example", + cs="cs_example", + da="da_example", + nl="nl_example", + et="et_example", + fi="fi_example", + fr="fr_example", + ka="ka_example", + de="de_example", + el="el_example", + hi="hi_example", + he="he_example", + hu="hu_example", + id="id_example", + it="it_example", + ja="ja_example", + ko="ko_example", + lv="lv_example", + lt="lt_example", + ms="ms_example", + nb="nb_example", + pl="pl_example", + fa="fa_example", + pt="pt_example", + pa="pa_example", + ro="ro_example", + ru="ru_example", + sr="sr_example", + sk="sk_example", + es="es_example", + sv="sv_example", + th="th_example", + tr="tr_example", + uk="uk_example", + vi="vi_example", + ), + is_email=True, + email_subject="email_subject_example", + email_body="email_body_example", + is_sms=True, + dynamic_content="dynamic_content_example", + ) + + # example passing only required values which don't have defaults set + try: + # Update template + api_response = api_instance.update_template(template_id, app_id, update_template_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_template: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + **app_id** | **str**| | + **update_template_request** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md)| | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + +# **update_user** +> PropertiesBody update_user(app_id, alias_label, alias_id, update_user_request) + + + +Updates an existing User’s properties. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.update_user_request import UpdateUserRequest +from onesignal.model.properties_body import PropertiesBody +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + alias_label = "alias_label_example" + alias_id = "alias_id_example" + update_user_request = UpdateUserRequest( + properties=PropertiesObject( + tags={}, + language="language_example", + timezone_id="timezone_id_example", + lat=3.14, + long=3.14, + country="country_example", + first_active=1, + last_active=1, + amount_spent=3.14, + purchases=[ + Purchase( + sku="sku_example", + amount="amount_example", + iso="iso_example", + count=1, + ), + ], + ip="ip_example", + ), + refresh_device_metadata=False, + deltas=PropertiesDeltas( + session_time=1, + session_count=1, + purchases=[ + Purchase( + sku="sku_example", + amount="amount_example", + iso="iso_example", + count=1, + ), + ], + ), + ) + # example passing only required values which don't have defaults set try: api_response = api_instance.update_user(app_id, alias_label, alias_id, update_user_request) @@ -2432,3 +3449,212 @@ Name | Type | Description | Notes [[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) +# **view_api_keys** +> ApiKeyTokensListResponse view_api_keys(app_id) + +View API keys + +View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. + +### Example + +* Bearer Authentication (organization_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.api_key_tokens_list_response import ApiKeyTokensListResponse +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" + + # example passing only required values which don't have defaults set + try: + # View API keys + api_response = api_instance.view_api_keys(app_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_api_keys: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| | + +### Return type + +[**ApiKeyTokensListResponse**](ApiKeyTokensListResponse.md) + +### Authorization + +[organization_api_key](../README.md#organization_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | + +[[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) + +# **view_template** +> TemplateResource view_template(template_id, app_id) + +View template + +Fetch a single template by id. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.template_resource import TemplateResource +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + template_id = "template_id_example" + app_id = "app_id_example" + + # example passing only required values which don't have defaults set + try: + # View template + api_response = api_instance.view_template(template_id, app_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_template: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + **app_id** | **str**| | + +### Return type + +[**TemplateResource**](TemplateResource.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[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) + +# **view_templates** +> TemplatesListResponse view_templates(app_id) + +View templates + +List templates for an app. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.model.templates_list_response import TemplatesListResponse +from onesignal.model.rate_limit_error import RateLimitError +from onesignal.model.generic_error import GenericError +from pprint import pprint + +# Enter a context with an instance of the API client +with onesignal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = default_api.DefaultApi(api_client) + app_id = "app_id_example" # Your OneSignal App ID in UUID v4 format. + limit = 50 # Maximum number of templates. Default and max is 50. (optional) + offset = 0 # Pagination offset. (optional) + channel = "push" # Filter by delivery channel. (optional) + + # example passing only required values which don't have defaults set + try: + # View templates + api_response = api_instance.view_templates(app_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_templates: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # View templates + api_response = api_instance.view_templates(app_id, limit=limit, offset=offset, channel=channel) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_templates: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **limit** | **int**| Maximum number of templates. Default and max is 50. | [optional] if omitted the server will use the default value of 50 + **offset** | **int**| Pagination offset. | [optional] if omitted the server will use the default value of 0 + **channel** | **str**| Filter by delivery channel. | [optional] + +### Return type + +[**TemplatesListResponse**](TemplatesListResponse.md) + +### Authorization + +[rest_api_key](../README.md#rest_api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**429** | Rate Limit Exceeded | - | + +[[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/IncludeAliases.md b/docs/IncludeAliases.md new file mode 100644 index 0000000..0e92e9e --- /dev/null +++ b/docs/IncludeAliases.md @@ -0,0 +1,12 @@ +# IncludeAliases + +Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **[str]** | any string name can be used but the value must be the correct type | [optional] + +[[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 e8e67a2..0a6bc72 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **include_chrome_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_chrome_web_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_android_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] -**include_aliases** | **{str: ([str],)}, none_type** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] **target_channel** | **str** | | [optional] **id** | **str** | | [optional] **value** | **int** | | [optional] [readonly] diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index 7ffaa4e..1e31ded 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **include_chrome_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_chrome_web_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_android_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] -**include_aliases** | **{str: ([str],)}, none_type** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] **target_channel** | **str** | | [optional] **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] diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index 3e3c993..0d7c843 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **include_chrome_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_chrome_web_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_android_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] -**include_aliases** | **{str: ([str],)}, none_type** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] **target_channel** | **str** | | [optional] **id** | **str** | | [optional] **value** | **int** | | [optional] [readonly] diff --git a/docs/StartLiveActivityRequest.md b/docs/StartLiveActivityRequest.md new file mode 100644 index 0000000..60bfdc4 --- /dev/null +++ b/docs/StartLiveActivityRequest.md @@ -0,0 +1,27 @@ +# StartLiveActivityRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | An internal name to assist with your campaign organization. This does not get displayed in the message itself. | +**activity_id** | **str** | Set a unique activity_id to track and manage the Live Activity. | +**event_attributes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Default/static data to initialize the Live Activity upon start. | +**event_updates** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. | +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | +**headings** | [**LanguageStringMap**](LanguageStringMap.md) | | +**event** | **str** | | defaults to "start" +**stale_date** | **int** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] +**priority** | **int** | Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. | [optional] +**ios_relevance_score** | **float, none_type** | iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. | [optional] +**idempotency_key** | **str, none_type** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] +**include_subscription_ids** | **[str], none_type** | Specific subscription ids to target. Not compatible with other targeting parameters. | [optional] +**included_segments** | **[str], none_type** | Segment names to include. Only compatible with excluded_segments. | [optional] +**excluded_segments** | **[str], none_type** | Segment names to exclude. Only compatible with included_segments. | [optional] +**filters** | [**[FilterExpression], none_type**](FilterExpression.md) | | [optional] +**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] + +[[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/StartLiveActivitySuccessResponse.md b/docs/StartLiveActivitySuccessResponse.md new file mode 100644 index 0000000..8bee77d --- /dev/null +++ b/docs/StartLiveActivitySuccessResponse.md @@ -0,0 +1,12 @@ +# StartLiveActivitySuccessResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notification_id** | **str** | | [optional] +**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] + +[[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/SubscriptionNotificationTarget.md b/docs/SubscriptionNotificationTarget.md index f9e18ce..401cc75 100644 --- a/docs/SubscriptionNotificationTarget.md +++ b/docs/SubscriptionNotificationTarget.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **include_chrome_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_chrome_web_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] **include_android_reg_ids** | **[str]** | Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] -**include_aliases** | **{str: ([str],)}, none_type** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] +**include_aliases** | [**IncludeAliases**](IncludeAliases.md) | | [optional] **target_channel** | **str** | | [optional] **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] diff --git a/docs/TemplateResource.md b/docs/TemplateResource.md new file mode 100644 index 0000000..840970a --- /dev/null +++ b/docs/TemplateResource.md @@ -0,0 +1,17 @@ +# TemplateResource + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**updated_at** | **datetime** | | [optional] +**channel** | **str, none_type** | | [optional] +**content** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Rendered content and channel/platform flags for the template. | [optional] +**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] + +[[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/TemplatesListResponse.md b/docs/TemplatesListResponse.md new file mode 100644 index 0000000..3cb828d --- /dev/null +++ b/docs/TemplatesListResponse.md @@ -0,0 +1,12 @@ +# TemplatesListResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templates** | [**[TemplateResource]**](TemplateResource.md) | | [optional] +**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] + +[[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/UpdateApiKeyRequest.md b/docs/UpdateApiKeyRequest.md new file mode 100644 index 0000000..70ad092 --- /dev/null +++ b/docs/UpdateApiKeyRequest.md @@ -0,0 +1,14 @@ +# UpdateApiKeyRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**ip_allowlist_mode** | **str** | | [optional] +**ip_allowlist** | **[str]** | | [optional] +**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] + +[[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/UpdateTemplateRequest.md b/docs/UpdateTemplateRequest.md new file mode 100644 index 0000000..9c9875f --- /dev/null +++ b/docs/UpdateTemplateRequest.md @@ -0,0 +1,18 @@ +# UpdateTemplateRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the template. | [optional] +**contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] +**is_email** | **bool** | Set true for an Email template. | [optional] +**email_subject** | **str, none_type** | Subject of the email. | [optional] +**email_body** | **str, none_type** | Body of the email (HTML supported). | [optional] +**is_sms** | **bool** | Set true for an SMS template. | [optional] +**dynamic_content** | **str, none_type** | JSON string for dynamic content personalization. | [optional] +**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] + +[[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/onesignal/__init__.py b/onesignal/__init__.py index 2e2e3e8..3ddf2d5 100644 --- a/onesignal/__init__.py +++ b/onesignal/__init__.py @@ -5,13 +5,13 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ -__version__ = "5.2.2-beta1" +__version__ = "5.3.0-beta1" # import ApiClient from onesignal.api_client import ApiClient diff --git a/onesignal/api/default_api.py b/onesignal/api/default_api.py index d2871cb..4c39b5e 100644 --- a/onesignal/api/default_api.py +++ b/onesignal/api/default_api.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -22,12 +22,18 @@ none_type, validate_and_convert_types ) +from onesignal.model.api_key_tokens_list_response import ApiKeyTokensListResponse from onesignal.model.app import App from onesignal.model.apps import Apps +from onesignal.model.copy_template_request import CopyTemplateRequest +from onesignal.model.create_api_key_request import CreateApiKeyRequest +from onesignal.model.create_api_key_response import CreateApiKeyResponse from onesignal.model.create_notification_success_response import CreateNotificationSuccessResponse from onesignal.model.create_segment_conflict_response import CreateSegmentConflictResponse from onesignal.model.create_segment_success_response import CreateSegmentSuccessResponse +from onesignal.model.create_template_request import CreateTemplateRequest from onesignal.model.create_user_conflict_response import CreateUserConflictResponse +from onesignal.model.custom_events_request import CustomEventsRequest from onesignal.model.export_events_success_response import ExportEventsSuccessResponse from onesignal.model.export_subscriptions_request_body import ExportSubscriptionsRequestBody from onesignal.model.export_subscriptions_success_response import ExportSubscriptionsSuccessResponse @@ -43,10 +49,16 @@ from onesignal.model.properties_body import PropertiesBody from onesignal.model.rate_limit_error import RateLimitError from onesignal.model.segment import Segment +from onesignal.model.start_live_activity_request import StartLiveActivityRequest +from onesignal.model.start_live_activity_success_response import StartLiveActivitySuccessResponse from onesignal.model.subscription_body import SubscriptionBody +from onesignal.model.template_resource import TemplateResource +from onesignal.model.templates_list_response import TemplatesListResponse from onesignal.model.transfer_subscription_request_body import TransferSubscriptionRequestBody +from onesignal.model.update_api_key_request import UpdateApiKeyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse +from onesignal.model.update_template_request import UpdateTemplateRequest from onesignal.model.update_user_request import UpdateUserRequest from onesignal.model.user import User from onesignal.model.user_identity_body import UserIdentityBody @@ -120,6 +132,70 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.copy_template_to_app_endpoint = _Endpoint( + settings={ + 'response_type': (TemplateResource,), + 'auth': [ + 'organization_api_key' + ], + 'endpoint_path': '/templates/{template_id}/copy_to_app', + 'operation_id': 'copy_template_to_app', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'template_id', + 'app_id', + 'copy_template_request', + ], + 'required': [ + 'template_id', + 'app_id', + 'copy_template_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'template_id': + (str,), + 'app_id': + (str,), + 'copy_template_request': + (CopyTemplateRequest,), + }, + 'attribute_map': { + 'template_id': 'template_id', + 'app_id': 'app_id', + }, + 'location_map': { + 'template_id': 'path', + 'app_id': 'query', + 'copy_template_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.create_alias_endpoint = _Endpoint( settings={ 'response_type': (UserIdentityBody,), @@ -254,6 +330,64 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_api_key_endpoint = _Endpoint( + settings={ + 'response_type': (CreateApiKeyResponse,), + 'auth': [ + 'organization_api_key' + ], + 'endpoint_path': '/apps/{app_id}/auth/tokens', + 'operation_id': 'create_api_key', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'create_api_key_request', + ], + 'required': [ + 'app_id', + 'create_api_key_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'create_api_key_request': + (CreateApiKeyRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + }, + 'location_map': { + 'app_id': 'path', + 'create_api_key_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.create_app_endpoint = _Endpoint( settings={ 'response_type': (App,), @@ -306,6 +440,64 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_custom_events_endpoint = _Endpoint( + settings={ + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/integrations/custom_events', + 'operation_id': 'create_custom_events', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'custom_events_request', + ], + 'required': [ + 'app_id', + 'custom_events_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'custom_events_request': + (CustomEventsRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + }, + 'location_map': { + 'app_id': 'path', + 'custom_events_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.create_notification_endpoint = _Endpoint( settings={ 'response_type': (CreateNotificationSuccessResponse,), @@ -485,6 +677,58 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_template_endpoint = _Endpoint( + settings={ + 'response_type': (TemplateResource,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/templates', + 'operation_id': 'create_template', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'create_template_request', + ], + 'required': [ + 'create_template_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'create_template_request': + (CreateTemplateRequest,), + }, + 'attribute_map': { + }, + 'location_map': { + 'create_template_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.create_user_endpoint = _Endpoint( settings={ 'response_type': (User,), @@ -612,25 +856,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.delete_segment_endpoint = _Endpoint( + self.delete_api_key_endpoint = _Endpoint( settings={ - 'response_type': (GenericSuccessBoolResponse,), + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ - 'rest_api_key' + 'organization_api_key' ], - 'endpoint_path': '/apps/{app_id}/segments/{segment_id}', - 'operation_id': 'delete_segment', + 'endpoint_path': '/apps/{app_id}/auth/tokens/{token_id}', + 'operation_id': 'delete_api_key', 'http_method': 'DELETE', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'segment_id', + 'token_id', ], 'required': [ 'app_id', - 'segment_id', + 'token_id', ], 'nullable': [ ], @@ -647,16 +891,16 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'segment_id': + 'token_id': (str,), }, 'attribute_map': { 'app_id': 'app_id', - 'segment_id': 'segment_id', + 'token_id': 'token_id', }, 'location_map': { 'app_id': 'path', - 'segment_id': 'path', + 'token_id': 'path', }, 'collection_format_map': { } @@ -669,25 +913,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.delete_subscription_endpoint = _Endpoint( + self.delete_segment_endpoint = _Endpoint( settings={ - 'response_type': None, + 'response_type': (GenericSuccessBoolResponse,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}', - 'operation_id': 'delete_subscription', + 'endpoint_path': '/apps/{app_id}/segments/{segment_id}', + 'operation_id': 'delete_segment', 'http_method': 'DELETE', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'subscription_id', + 'segment_id', ], 'required': [ 'app_id', - 'subscription_id', + 'segment_id', ], 'nullable': [ ], @@ -704,16 +948,16 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'subscription_id': + 'segment_id': (str,), }, 'attribute_map': { 'app_id': 'app_id', - 'subscription_id': 'subscription_id', + 'segment_id': 'segment_id', }, 'location_map': { 'app_id': 'path', - 'subscription_id': 'path', + 'segment_id': 'path', }, 'collection_format_map': { } @@ -726,27 +970,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.delete_user_endpoint = _Endpoint( + self.delete_subscription_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/apps/{app_id}/users/by/{alias_label}/{alias_id}', - 'operation_id': 'delete_user', + 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}', + 'operation_id': 'delete_subscription', 'http_method': 'DELETE', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'alias_label', - 'alias_id', + 'subscription_id', ], 'required': [ 'app_id', - 'alias_label', - 'alias_id', + 'subscription_id', ], 'nullable': [ ], @@ -763,20 +1005,16 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'alias_label': - (str,), - 'alias_id': + 'subscription_id': (str,), }, 'attribute_map': { 'app_id': 'app_id', - 'alias_label': 'alias_label', - 'alias_id': 'alias_id', + 'subscription_id': 'subscription_id', }, 'location_map': { 'app_id': 'path', - 'alias_label': 'path', - 'alias_id': 'path', + 'subscription_id': 'path', }, 'collection_format_map': { } @@ -789,24 +1027,24 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.export_events_endpoint = _Endpoint( + self.delete_template_endpoint = _Endpoint( settings={ - 'response_type': (ExportEventsSuccessResponse,), + 'response_type': (GenericSuccessBoolResponse,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/notifications/{notification_id}/export_events?app_id={app_id}', - 'operation_id': 'export_events', - 'http_method': 'POST', + 'endpoint_path': '/templates/{template_id}', + 'operation_id': 'delete_template', + 'http_method': 'DELETE', 'servers': None, }, params_map={ 'all': [ - 'notification_id', + 'template_id', 'app_id', ], 'required': [ - 'notification_id', + 'template_id', 'app_id', ], 'nullable': [ @@ -822,17 +1060,17 @@ def __init__(self, api_client=None): 'allowed_values': { }, 'openapi_types': { - 'notification_id': + 'template_id': (str,), 'app_id': (str,), }, 'attribute_map': { - 'notification_id': 'notification_id', + 'template_id': 'template_id', 'app_id': 'app_id', }, 'location_map': { - 'notification_id': 'path', + 'template_id': 'path', 'app_id': 'query', }, 'collection_format_map': { @@ -846,7 +1084,127 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.export_subscriptions_endpoint = _Endpoint( + self.delete_user_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/users/by/{alias_label}/{alias_id}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'alias_label', + 'alias_id', + ], + 'required': [ + 'app_id', + 'alias_label', + 'alias_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'alias_label': + (str,), + 'alias_id': + (str,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'alias_label': 'alias_label', + 'alias_id': 'alias_id', + }, + 'location_map': { + 'app_id': 'path', + 'alias_label': 'path', + 'alias_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.export_events_endpoint = _Endpoint( + settings={ + 'response_type': (ExportEventsSuccessResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/notifications/{notification_id}/export_events?app_id={app_id}', + 'operation_id': 'export_events', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'notification_id', + 'app_id', + ], + 'required': [ + 'notification_id', + 'app_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'notification_id': + (str,), + 'app_id': + (str,), + }, + 'attribute_map': { + 'notification_id': 'notification_id', + 'app_id': 'app_id', + }, + 'location_map': { + 'notification_id': 'path', + 'app_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.export_subscriptions_endpoint = _Endpoint( settings={ 'response_type': (ExportSubscriptionsSuccessResponse,), 'auth': [ @@ -1507,27 +1865,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.transfer_subscription_endpoint = _Endpoint( + self.rotate_api_key_endpoint = _Endpoint( settings={ - 'response_type': (UserIdentityBody,), + 'response_type': (CreateApiKeyResponse,), 'auth': [ - 'rest_api_key' + 'organization_api_key' ], - 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}/owner', - 'operation_id': 'transfer_subscription', - 'http_method': 'PATCH', + 'endpoint_path': '/apps/{app_id}/auth/tokens/{token_id}/rotate', + 'operation_id': 'rotate_api_key', + 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'subscription_id', - 'transfer_subscription_request_body', + 'token_id', ], 'required': [ 'app_id', - 'subscription_id', - 'transfer_subscription_request_body', + 'token_id', ], 'nullable': [ ], @@ -1544,19 +1900,16 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'subscription_id': + 'token_id': (str,), - 'transfer_subscription_request_body': - (TransferSubscriptionRequestBody,), }, 'attribute_map': { 'app_id': 'app_id', - 'subscription_id': 'subscription_id', + 'token_id': 'token_id', }, 'location_map': { 'app_id': 'path', - 'subscription_id': 'path', - 'transfer_subscription_request_body': 'body', + 'token_id': 'path', }, 'collection_format_map': { } @@ -1565,33 +1918,31 @@ def __init__(self, api_client=None): 'accept': [ 'application/json' ], - 'content_type': [ - 'application/json' - ] + 'content_type': [], }, api_client=api_client ) - self.unsubscribe_email_with_token_endpoint = _Endpoint( + self.start_live_activity_endpoint = _Endpoint( settings={ - 'response_type': (GenericSuccessBoolResponse,), + 'response_type': (StartLiveActivitySuccessResponse,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/apps/{app_id}/notifications/{notification_id}/unsubscribe', - 'operation_id': 'unsubscribe_email_with_token', + 'endpoint_path': '/apps/{app_id}/activities/activity/{activity_type}', + 'operation_id': 'start_live_activity', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'notification_id', - 'token', + 'activity_type', + 'start_live_activity_request', ], 'required': [ 'app_id', - 'notification_id', - 'token', + 'activity_type', + 'start_live_activity_request', ], 'nullable': [ ], @@ -1608,20 +1959,19 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'notification_id': - (str,), - 'token': + 'activity_type': (str,), + 'start_live_activity_request': + (StartLiveActivityRequest,), }, 'attribute_map': { 'app_id': 'app_id', - 'notification_id': 'notification_id', - 'token': 'token', + 'activity_type': 'activity_type', }, 'location_map': { 'app_id': 'path', - 'notification_id': 'path', - 'token': 'query', + 'activity_type': 'path', + 'start_live_activity_request': 'body', }, 'collection_format_map': { } @@ -1630,29 +1980,33 @@ def __init__(self, api_client=None): 'accept': [ 'application/json' ], - 'content_type': [], + 'content_type': [ + 'application/json' + ] }, api_client=api_client ) - self.update_app_endpoint = _Endpoint( + self.transfer_subscription_endpoint = _Endpoint( settings={ - 'response_type': (App,), + 'response_type': (UserIdentityBody,), 'auth': [ - 'organization_api_key' + 'rest_api_key' ], - 'endpoint_path': '/apps/{app_id}', - 'operation_id': 'update_app', - 'http_method': 'PUT', + 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}/owner', + 'operation_id': 'transfer_subscription', + 'http_method': 'PATCH', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'app', + 'subscription_id', + 'transfer_subscription_request_body', ], 'required': [ 'app_id', - 'app', + 'subscription_id', + 'transfer_subscription_request_body', ], 'nullable': [ ], @@ -1669,15 +2023,19 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'app': - (App,), + 'subscription_id': + (str,), + 'transfer_subscription_request_body': + (TransferSubscriptionRequestBody,), }, 'attribute_map': { 'app_id': 'app_id', + 'subscription_id': 'subscription_id', }, 'location_map': { 'app_id': 'path', - 'app': 'body', + 'subscription_id': 'path', + 'transfer_subscription_request_body': 'body', }, 'collection_format_map': { } @@ -1692,27 +2050,27 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.update_live_activity_endpoint = _Endpoint( + self.unsubscribe_email_with_token_endpoint = _Endpoint( settings={ - 'response_type': (UpdateLiveActivitySuccessResponse,), + 'response_type': (GenericSuccessBoolResponse,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/apps/{app_id}/live_activities/{activity_id}/notifications', - 'operation_id': 'update_live_activity', + 'endpoint_path': '/apps/{app_id}/notifications/{notification_id}/unsubscribe', + 'operation_id': 'unsubscribe_email_with_token', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'activity_id', - 'update_live_activity_request', + 'notification_id', + 'token', ], 'required': [ 'app_id', - 'activity_id', - 'update_live_activity_request', + 'notification_id', + 'token', ], 'nullable': [ ], @@ -1729,19 +2087,20 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'activity_id': + 'notification_id': + (str,), + 'token': (str,), - 'update_live_activity_request': - (UpdateLiveActivityRequest,), }, 'attribute_map': { 'app_id': 'app_id', - 'activity_id': 'activity_id', + 'notification_id': 'notification_id', + 'token': 'token', }, 'location_map': { 'app_id': 'path', - 'activity_id': 'path', - 'update_live_activity_request': 'body', + 'notification_id': 'path', + 'token': 'query', }, 'collection_format_map': { } @@ -1750,33 +2109,31 @@ def __init__(self, api_client=None): 'accept': [ 'application/json' ], - 'content_type': [ - 'application/json' - ] + 'content_type': [], }, api_client=api_client ) - self.update_subscription_endpoint = _Endpoint( + self.update_api_key_endpoint = _Endpoint( settings={ - 'response_type': None, + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ - 'rest_api_key' + 'organization_api_key' ], - 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}', - 'operation_id': 'update_subscription', + 'endpoint_path': '/apps/{app_id}/auth/tokens/{token_id}', + 'operation_id': 'update_api_key', 'http_method': 'PATCH', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'subscription_id', - 'subscription_body', + 'token_id', + 'update_api_key_request', ], 'required': [ 'app_id', - 'subscription_id', - 'subscription_body', + 'token_id', + 'update_api_key_request', ], 'nullable': [ ], @@ -1793,19 +2150,19 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'subscription_id': + 'token_id': (str,), - 'subscription_body': - (SubscriptionBody,), + 'update_api_key_request': + (UpdateApiKeyRequest,), }, 'attribute_map': { 'app_id': 'app_id', - 'subscription_id': 'subscription_id', + 'token_id': 'token_id', }, 'location_map': { 'app_id': 'path', - 'subscription_id': 'path', - 'subscription_body': 'body', + 'token_id': 'path', + 'update_api_key_request': 'body', }, 'collection_format_map': { } @@ -1820,29 +2177,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.update_user_endpoint = _Endpoint( + self.update_app_endpoint = _Endpoint( settings={ - 'response_type': (PropertiesBody,), + 'response_type': (App,), 'auth': [ - 'rest_api_key' + 'organization_api_key' ], - 'endpoint_path': '/apps/{app_id}/users/by/{alias_label}/{alias_id}', - 'operation_id': 'update_user', - 'http_method': 'PATCH', + 'endpoint_path': '/apps/{app_id}', + 'operation_id': 'update_app', + 'http_method': 'PUT', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'alias_label', - 'alias_id', - 'update_user_request', + 'app', ], 'required': [ 'app_id', - 'alias_label', - 'alias_id', - 'update_user_request', + 'app', ], 'nullable': [ ], @@ -1859,23 +2212,277 @@ def __init__(self, api_client=None): 'openapi_types': { 'app_id': (str,), - 'alias_label': + 'app': + (App,), + }, + 'attribute_map': { + 'app_id': 'app_id', + }, + 'location_map': { + 'app_id': 'path', + 'app': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_live_activity_endpoint = _Endpoint( + settings={ + 'response_type': (UpdateLiveActivitySuccessResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/live_activities/{activity_id}/notifications', + 'operation_id': 'update_live_activity', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'activity_id', + 'update_live_activity_request', + ], + 'required': [ + 'app_id', + 'activity_id', + 'update_live_activity_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': (str,), - 'alias_id': + 'activity_id': (str,), - 'update_user_request': - (UpdateUserRequest,), + 'update_live_activity_request': + (UpdateLiveActivityRequest,), }, 'attribute_map': { 'app_id': 'app_id', - 'alias_label': 'alias_label', - 'alias_id': 'alias_id', + 'activity_id': 'activity_id', }, 'location_map': { 'app_id': 'path', - 'alias_label': 'path', - 'alias_id': 'path', - 'update_user_request': 'body', + 'activity_id': 'path', + 'update_live_activity_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_subscription_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/subscriptions/{subscription_id}', + 'operation_id': 'update_subscription', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'subscription_id', + 'subscription_body', + ], + 'required': [ + 'app_id', + 'subscription_id', + 'subscription_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'subscription_id': + (str,), + 'subscription_body': + (SubscriptionBody,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'subscription_id': 'subscription_id', + }, + 'location_map': { + 'app_id': 'path', + 'subscription_id': 'path', + 'subscription_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_subscription_by_token_endpoint = _Endpoint( + settings={ + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/subscriptions_by_token/{token_type}/{token}', + 'operation_id': 'update_subscription_by_token', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'token_type', + 'token', + 'subscription_body', + ], + 'required': [ + 'app_id', + 'token_type', + 'token', + 'subscription_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'token_type': + (str,), + 'token': + (str,), + 'subscription_body': + (SubscriptionBody,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'token_type': 'token_type', + 'token': 'token', + }, + 'location_map': { + 'app_id': 'path', + 'token_type': 'path', + 'token': 'path', + 'subscription_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_template_endpoint = _Endpoint( + settings={ + 'response_type': (TemplateResource,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/templates/{template_id}', + 'operation_id': 'update_template', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'template_id', + 'app_id', + 'update_template_request', + ], + 'required': [ + 'template_id', + 'app_id', + 'update_template_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'template_id': + (str,), + 'app_id': + (str,), + 'update_template_request': + (UpdateTemplateRequest,), + }, + 'attribute_map': { + 'template_id': 'template_id', + 'app_id': 'app_id', + }, + 'location_map': { + 'template_id': 'path', + 'app_id': 'query', + 'update_template_request': 'body', }, 'collection_format_map': { } @@ -1890,25 +2497,1424 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.update_user_endpoint = _Endpoint( + settings={ + 'response_type': (PropertiesBody,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/users/by/{alias_label}/{alias_id}', + 'operation_id': 'update_user', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'alias_label', + 'alias_id', + 'update_user_request', + ], + 'required': [ + 'app_id', + 'alias_label', + 'alias_id', + 'update_user_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'alias_label': + (str,), + 'alias_id': + (str,), + 'update_user_request': + (UpdateUserRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'alias_label': 'alias_label', + 'alias_id': 'alias_id', + }, + 'location_map': { + 'app_id': 'path', + 'alias_label': 'path', + 'alias_id': 'path', + 'update_user_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.view_api_keys_endpoint = _Endpoint( + settings={ + 'response_type': (ApiKeyTokensListResponse,), + 'auth': [ + 'organization_api_key' + ], + 'endpoint_path': '/apps/{app_id}/auth/tokens', + 'operation_id': 'view_api_keys', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + ], + 'required': [ + 'app_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + }, + 'attribute_map': { + 'app_id': 'app_id', + }, + 'location_map': { + 'app_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.view_template_endpoint = _Endpoint( + settings={ + 'response_type': (TemplateResource,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/templates/{template_id}', + 'operation_id': 'view_template', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'template_id', + 'app_id', + ], + 'required': [ + 'template_id', + 'app_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'template_id': + (str,), + 'app_id': + (str,), + }, + 'attribute_map': { + 'template_id': 'template_id', + 'app_id': 'app_id', + }, + 'location_map': { + 'template_id': 'path', + 'app_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.view_templates_endpoint = _Endpoint( + settings={ + 'response_type': (TemplatesListResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/templates', + 'operation_id': 'view_templates', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'limit', + 'offset', + 'channel', + ], + 'required': [ + 'app_id', + ], + 'nullable': [ + ], + 'enum': [ + 'channel', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('channel',): { + + "PUSH": "push", + "EMAIL": "email", + "SMS": "sms" + }, + }, + 'openapi_types': { + 'app_id': + (str,), + 'limit': + (int,), + 'offset': + (int,), + 'channel': + (str,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'limit': 'limit', + 'offset': 'offset', + 'channel': 'channel', + }, + 'location_map': { + 'app_id': 'query', + 'limit': 'query', + 'offset': 'query', + 'channel': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def cancel_notification( + self, + app_id, + notification_id, + **kwargs + ): + """Stop a scheduled or currently outgoing notification # noqa: E501 + + Used to stop a scheduled or currently outgoing notification # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.cancel_notification(app_id, notification_id, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + notification_id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GenericSuccessBoolResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['notification_id'] = \ + notification_id + return self.cancel_notification_endpoint.call_with_http_info(**kwargs) + + def copy_template_to_app( + self, + template_id, + app_id, + copy_template_request, + **kwargs + ): + """Copy template to another app # noqa: E501 + + Copy a template to a destination app. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.copy_template_to_app(template_id, app_id, copy_template_request, async_req=True) + >>> result = thread.get() + + Args: + template_id (str): + app_id (str): + copy_template_request (CopyTemplateRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + TemplateResource + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['template_id'] = \ + template_id + kwargs['app_id'] = \ + app_id + kwargs['copy_template_request'] = \ + copy_template_request + return self.copy_template_to_app_endpoint.call_with_http_info(**kwargs) + + def create_alias( + self, + app_id, + alias_label, + alias_id, + user_identity_body, + **kwargs + ): + """create_alias # noqa: E501 + + Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_alias(app_id, alias_label, alias_id, user_identity_body, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + alias_label (str): + alias_id (str): + user_identity_body (UserIdentityBody): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + UserIdentityBody + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + kwargs['user_identity_body'] = \ + user_identity_body + return self.create_alias_endpoint.call_with_http_info(**kwargs) + + def create_alias_by_subscription( + self, + app_id, + subscription_id, + user_identity_body, + **kwargs + ): + """create_alias_by_subscription # noqa: E501 + + Upserts one or more Aliases for the User identified by :subscription_id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_alias_by_subscription(app_id, subscription_id, user_identity_body, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + subscription_id (str): + user_identity_body (UserIdentityBody): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + UserIdentityBody + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['subscription_id'] = \ + subscription_id + kwargs['user_identity_body'] = \ + user_identity_body + return self.create_alias_by_subscription_endpoint.call_with_http_info(**kwargs) + + def create_api_key( + self, + app_id, + create_api_key_request, + **kwargs + ): + """Create API key # noqa: E501 + + Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_api_key(app_id, create_api_key_request, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + create_api_key_request (CreateApiKeyRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CreateApiKeyResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['create_api_key_request'] = \ + create_api_key_request + return self.create_api_key_endpoint.call_with_http_info(**kwargs) + + def create_app( + self, + app, + **kwargs + ): + """Create an app # noqa: E501 + + Creates a new OneSignal app # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_app(app, async_req=True) + >>> result = thread.get() + + Args: + app (App): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + App + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app'] = \ + app + return self.create_app_endpoint.call_with_http_info(**kwargs) + + def create_custom_events( + self, + app_id, + custom_events_request, + **kwargs + ): + """Create custom events # noqa: E501 + + The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_custom_events(app_id, custom_events_request, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + custom_events_request (CustomEventsRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['custom_events_request'] = \ + custom_events_request + return self.create_custom_events_endpoint.call_with_http_info(**kwargs) + + def create_notification( + self, + notification, + **kwargs + ): + """Create notification # noqa: E501 + + Sends notifications to your users # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_notification(notification, async_req=True) + >>> result = thread.get() + + Args: + notification (Notification): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CreateNotificationSuccessResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['notification'] = \ + notification + return self.create_notification_endpoint.call_with_http_info(**kwargs) + + def create_segment( + self, + app_id, + **kwargs + ): + """Create Segment # noqa: E501 + + Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_segment(app_id, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + + Keyword Args: + segment (Segment): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CreateSegmentSuccessResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + return self.create_segment_endpoint.call_with_http_info(**kwargs) + + def create_subscription( + self, + app_id, + alias_label, + alias_id, + subscription_body, + **kwargs + ): + """create_subscription # noqa: E501 + + Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_subscription(app_id, alias_label, alias_id, subscription_body, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + alias_label (str): + alias_id (str): + subscription_body (SubscriptionBody): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + SubscriptionBody + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + kwargs['subscription_body'] = \ + subscription_body + return self.create_subscription_endpoint.call_with_http_info(**kwargs) + + def create_template( + self, + create_template_request, + **kwargs + ): + """Create template # noqa: E501 + + Create reusable message templates for push, email, and SMS channels. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_template(create_template_request, async_req=True) + >>> result = thread.get() + + Args: + create_template_request (CreateTemplateRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + TemplateResource + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['create_template_request'] = \ + create_template_request + return self.create_template_endpoint.call_with_http_info(**kwargs) + + def create_user( + self, + app_id, + user, + **kwargs + ): + """create_user # noqa: E501 + + 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. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(app_id, user, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + user (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['user'] = \ + user + return self.create_user_endpoint.call_with_http_info(**kwargs) + + def delete_alias( + self, + app_id, + alias_label, + alias_id, + alias_label_to_delete, + **kwargs + ): + """delete_alias # noqa: E501 + + Deletes an alias by alias label # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + alias_label (str): + alias_id (str): + alias_label_to_delete (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + UserIdentityBody + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + kwargs['alias_label_to_delete'] = \ + alias_label_to_delete + return self.delete_alias_endpoint.call_with_http_info(**kwargs) - def cancel_notification( + def delete_api_key( self, app_id, - notification_id, + token_id, **kwargs ): - """Stop a scheduled or currently outgoing notification # noqa: E501 + """Delete API key # noqa: E501 - Used to stop a scheduled or currently outgoing notification # noqa: E501 + Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_notification(app_id, notification_id, async_req=True) + >>> thread = api.delete_api_key(app_id, token_id, async_req=True) >>> result = thread.get() Args: app_id (str): - notification_id (str): + token_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1943,7 +3949,7 @@ def cancel_notification( async_req (bool): execute request asynchronously Returns: - GenericSuccessBoolResponse + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} If the method is called asynchronously, returns the request thread. """ @@ -1974,32 +3980,28 @@ def cancel_notification( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['notification_id'] = \ - notification_id - return self.cancel_notification_endpoint.call_with_http_info(**kwargs) + kwargs['token_id'] = \ + token_id + return self.delete_api_key_endpoint.call_with_http_info(**kwargs) - def create_alias( + def delete_segment( self, app_id, - alias_label, - alias_id, - user_identity_body, + segment_id, **kwargs ): - """create_alias # noqa: E501 + """Delete Segment # noqa: E501 - Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). # noqa: E501 + Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_alias(app_id, alias_label, alias_id, user_identity_body, async_req=True) + >>> thread = api.delete_segment(app_id, segment_id, async_req=True) >>> result = thread.get() Args: - app_id (str): - alias_label (str): - alias_id (str): - user_identity_body (UserIdentityBody): + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + segment_id (str): The segment_id can be found in the URL of the segment when viewing it in the dashboard. Keyword Args: _return_http_data_only (bool): response data without head status @@ -2034,7 +4036,7 @@ def create_alias( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + GenericSuccessBoolResponse If the method is called asynchronously, returns the request thread. """ @@ -2065,34 +4067,28 @@ def create_alias( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - kwargs['user_identity_body'] = \ - user_identity_body - return self.create_alias_endpoint.call_with_http_info(**kwargs) + kwargs['segment_id'] = \ + segment_id + return self.delete_segment_endpoint.call_with_http_info(**kwargs) - def create_alias_by_subscription( + def delete_subscription( self, app_id, subscription_id, - user_identity_body, **kwargs ): - """create_alias_by_subscription # noqa: E501 + """delete_subscription # noqa: E501 - Upserts one or more Aliases for the User identified by :subscription_id. # noqa: E501 + Deletes the Subscription. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_alias_by_subscription(app_id, subscription_id, user_identity_body, async_req=True) + >>> thread = api.delete_subscription(app_id, subscription_id, async_req=True) >>> result = thread.get() Args: app_id (str): subscription_id (str): - user_identity_body (UserIdentityBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2127,7 +4123,7 @@ def create_alias_by_subscription( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + None If the method is called asynchronously, returns the request thread. """ @@ -2160,26 +4156,26 @@ def create_alias_by_subscription( app_id kwargs['subscription_id'] = \ subscription_id - kwargs['user_identity_body'] = \ - user_identity_body - return self.create_alias_by_subscription_endpoint.call_with_http_info(**kwargs) + return self.delete_subscription_endpoint.call_with_http_info(**kwargs) - def create_app( + def delete_template( self, - app, + template_id, + app_id, **kwargs ): - """Create an app # noqa: E501 + """Delete template # noqa: E501 - Creates a new OneSignal app # noqa: E501 + Delete a template by id. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_app(app, async_req=True) + >>> thread = api.delete_template(template_id, app_id, async_req=True) >>> result = thread.get() Args: - app (App): + template_id (str): + app_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2214,7 +4210,7 @@ def create_app( async_req (bool): execute request asynchronously Returns: - App + GenericSuccessBoolResponse If the method is called asynchronously, returns the request thread. """ @@ -2243,26 +4239,32 @@ def create_app( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['app'] = \ - app - return self.create_app_endpoint.call_with_http_info(**kwargs) + kwargs['template_id'] = \ + template_id + kwargs['app_id'] = \ + app_id + return self.delete_template_endpoint.call_with_http_info(**kwargs) - def create_notification( + def delete_user( self, - notification, + app_id, + alias_label, + alias_id, **kwargs ): - """Create notification # noqa: E501 + """delete_user # noqa: E501 - Sends notifications to your users # noqa: E501 + Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_notification(notification, async_req=True) + >>> thread = api.delete_user(app_id, alias_label, alias_id, async_req=True) >>> result = thread.get() Args: - notification (Notification): + app_id (str): + alias_label (str): + alias_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2297,7 +4299,7 @@ def create_notification( async_req (bool): execute request asynchronously Returns: - CreateNotificationSuccessResponse + None If the method is called asynchronously, returns the request thread. """ @@ -2326,29 +4328,120 @@ def create_notification( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['notification'] = \ - notification - return self.create_notification_endpoint.call_with_http_info(**kwargs) + kwargs['app_id'] = \ + app_id + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + return self.delete_user_endpoint.call_with_http_info(**kwargs) - def create_segment( + def export_events( self, + notification_id, app_id, **kwargs ): - """Create Segment # noqa: E501 + """Export CSV of Events # noqa: E501 + + Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.export_events(notification_id, app_id, async_req=True) + >>> result = thread.get() + + Args: + notification_id (str): The ID of the notification to export events from. + app_id (str): The ID of the app that the notification belongs to. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + ExportEventsSuccessResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['notification_id'] = \ + notification_id + kwargs['app_id'] = \ + app_id + return self.export_events_endpoint.call_with_http_info(**kwargs) + + def export_subscriptions( + self, + app_id, + **kwargs + ): + """Export CSV of Subscriptions # noqa: E501 - Create a segment visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segment endpoint and re-create it with this endpoint to edit. # noqa: E501 + 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. | # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_segment(app_id, async_req=True) + >>> thread = api.export_subscriptions(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + app_id (str): The app ID that you want to export devices from Keyword Args: - segment (Segment): [optional] + export_subscriptions_request_body (ExportSubscriptionsRequestBody): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -2381,7 +4474,7 @@ def create_segment( async_req (bool): execute request asynchronously Returns: - CreateSegmentSuccessResponse + ExportSubscriptionsSuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -2412,30 +4505,28 @@ def create_segment( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.create_segment_endpoint.call_with_http_info(**kwargs) + return self.export_subscriptions_endpoint.call_with_http_info(**kwargs) - def create_subscription( + def get_aliases( self, app_id, alias_label, alias_id, - subscription_body, **kwargs ): - """create_subscription # noqa: E501 + """get_aliases # noqa: E501 - Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. # noqa: E501 + Lists all Aliases for the User identified by (:alias_label, :alias_id). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_subscription(app_id, alias_label, alias_id, subscription_body, async_req=True) + >>> thread = api.get_aliases(app_id, alias_label, alias_id, async_req=True) >>> result = thread.get() Args: app_id (str): alias_label (str): alias_id (str): - subscription_body (SubscriptionBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2470,7 +4561,7 @@ def create_subscription( async_req (bool): execute request asynchronously Returns: - SubscriptionBody + UserIdentityBody If the method is called asynchronously, returns the request thread. """ @@ -2505,28 +4596,26 @@ def create_subscription( alias_label kwargs['alias_id'] = \ alias_id - kwargs['subscription_body'] = \ - subscription_body - return self.create_subscription_endpoint.call_with_http_info(**kwargs) + return self.get_aliases_endpoint.call_with_http_info(**kwargs) - def create_user( + def get_aliases_by_subscription( self, app_id, - user, + subscription_id, **kwargs ): - """create_user # noqa: E501 + """get_aliases_by_subscription # noqa: E501 - 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. # noqa: E501 + Lists all Aliases for the User identified by :subscription_id. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user(app_id, user, async_req=True) + >>> thread = api.get_aliases_by_subscription(app_id, subscription_id, async_req=True) >>> result = thread.get() Args: app_id (str): - user (User): + subscription_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2561,7 +4650,7 @@ def create_user( async_req (bool): execute request asynchronously Returns: - User + UserIdentityBody If the method is called asynchronously, returns the request thread. """ @@ -2592,32 +4681,26 @@ def create_user( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['user'] = \ - user - return self.create_user_endpoint.call_with_http_info(**kwargs) + kwargs['subscription_id'] = \ + subscription_id + return self.get_aliases_by_subscription_endpoint.call_with_http_info(**kwargs) - def delete_alias( + def get_app( self, app_id, - alias_label, - alias_id, - alias_label_to_delete, **kwargs ): - """delete_alias # noqa: E501 + """View an app # noqa: E501 - Deletes an alias by alias label # noqa: E501 + View the details of a single OneSignal app # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, async_req=True) + >>> thread = api.get_app(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): - alias_label (str): - alias_id (str): - alias_label_to_delete (str): + app_id (str): An app id Keyword Args: _return_http_data_only (bool): response data without head status @@ -2652,7 +4735,7 @@ def delete_alias( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + App If the method is called asynchronously, returns the request thread. """ @@ -2683,32 +4766,21 @@ def delete_alias( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - kwargs['alias_label_to_delete'] = \ - alias_label_to_delete - return self.delete_alias_endpoint.call_with_http_info(**kwargs) + return self.get_app_endpoint.call_with_http_info(**kwargs) - def delete_segment( + def get_apps( self, - app_id, - segment_id, **kwargs ): - """Delete Segment # noqa: E501 + """View apps # noqa: E501 - Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. # noqa: E501 + View the details of all of your current OneSignal apps # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_segment(app_id, segment_id, async_req=True) + >>> thread = api.get_apps(async_req=True) >>> result = thread.get() - Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. - segment_id (str): The segment_id can be found in the URL of the segment when viewing it in the dashboard. Keyword Args: _return_http_data_only (bool): response data without head status @@ -2743,7 +4815,7 @@ def delete_segment( async_req (bool): execute request asynchronously Returns: - GenericSuccessBoolResponse + Apps If the method is called asynchronously, returns the request thread. """ @@ -2772,30 +4844,26 @@ def delete_segment( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['app_id'] = \ - app_id - kwargs['segment_id'] = \ - segment_id - return self.delete_segment_endpoint.call_with_http_info(**kwargs) + return self.get_apps_endpoint.call_with_http_info(**kwargs) - def delete_subscription( + def get_notification( self, app_id, - subscription_id, + notification_id, **kwargs ): - """delete_subscription # noqa: E501 + """View notification # noqa: E501 - Deletes the Subscription. # noqa: E501 + View the details of a single notification and outcomes associated with it # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_subscription(app_id, subscription_id, async_req=True) + >>> thread = api.get_notification(app_id, notification_id, async_req=True) >>> result = thread.get() Args: app_id (str): - subscription_id (str): + notification_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2830,7 +4898,7 @@ def delete_subscription( async_req (bool): execute request asynchronously Returns: - None + NotificationWithMeta If the method is called asynchronously, returns the request thread. """ @@ -2861,30 +4929,28 @@ def delete_subscription( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['subscription_id'] = \ - subscription_id - return self.delete_subscription_endpoint.call_with_http_info(**kwargs) + kwargs['notification_id'] = \ + notification_id + return self.get_notification_endpoint.call_with_http_info(**kwargs) - def delete_user( + def get_notification_history( self, - app_id, - alias_label, - alias_id, + notification_id, + get_notification_history_request_body, **kwargs ): - """delete_user # noqa: E501 + """Notification History # noqa: E501 - Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases # noqa: E501 + -> 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. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user(app_id, alias_label, alias_id, async_req=True) + >>> thread = api.get_notification_history(notification_id, get_notification_history_request_body, async_req=True) >>> result = thread.get() Args: - app_id (str): - alias_label (str): - alias_id (str): + notification_id (str): The \"id\" of the message found in the Notification object + get_notification_history_request_body (GetNotificationHistoryRequestBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -2919,7 +4985,7 @@ def delete_user( async_req (bool): execute request asynchronously Returns: - None + NotificationHistorySuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -2948,34 +5014,33 @@ def delete_user( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['app_id'] = \ - app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - return self.delete_user_endpoint.call_with_http_info(**kwargs) + kwargs['notification_id'] = \ + notification_id + kwargs['get_notification_history_request_body'] = \ + get_notification_history_request_body + return self.get_notification_history_endpoint.call_with_http_info(**kwargs) - def export_events( + def get_notifications( self, - notification_id, app_id, **kwargs ): - """Export CSV of Events # noqa: E501 + """View notifications # noqa: E501 - Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time. # noqa: E501 + View the details of multiple notifications # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.export_events(notification_id, app_id, async_req=True) + >>> thread = api.get_notifications(app_id, async_req=True) >>> result = thread.get() Args: - notification_id (str): The ID of the notification to export events from. - app_id (str): The ID of the app that the notification belongs to. + app_id (str): The app ID that you want to view notifications from Keyword Args: + limit (int): How many notifications to return. Max is 50. Default is 50.. [optional] + offset (int): 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 (int): Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3008,7 +5073,7 @@ def export_events( async_req (bool): execute request asynchronously Returns: - ExportEventsSuccessResponse + NotificationSlice If the method is called asynchronously, returns the request thread. """ @@ -3037,31 +5102,34 @@ def export_events( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['notification_id'] = \ - notification_id kwargs['app_id'] = \ app_id - return self.export_events_endpoint.call_with_http_info(**kwargs) + return self.get_notifications_endpoint.call_with_http_info(**kwargs) - def export_subscriptions( + def get_outcomes( self, app_id, + outcome_names, **kwargs ): - """Export CSV of Subscriptions # noqa: E501 + """View Outcomes # noqa: E501 - 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. | # noqa: E501 + 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. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.export_subscriptions(app_id, async_req=True) + >>> thread = api.get_outcomes(app_id, outcome_names, async_req=True) >>> result = thread.get() Args: - app_id (str): The app ID that you want to export devices from + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + outcome_names (str): 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 Keyword Args: - export_subscriptions_request_body (ExportSubscriptionsRequestBody): [optional] + outcome_names2 (str): 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] + outcome_time_range (str): 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] + outcome_platforms (str): 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] + outcome_attribution (str): Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3094,7 +5162,7 @@ def export_subscriptions( async_req (bool): execute request asynchronously Returns: - ExportSubscriptionsSuccessResponse + OutcomesData If the method is called asynchronously, returns the request thread. """ @@ -3125,30 +5193,30 @@ def export_subscriptions( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.export_subscriptions_endpoint.call_with_http_info(**kwargs) + kwargs['outcome_names'] = \ + outcome_names + return self.get_outcomes_endpoint.call_with_http_info(**kwargs) - def get_aliases( + def get_segments( self, app_id, - alias_label, - alias_id, **kwargs ): - """get_aliases # noqa: E501 + """Get Segments # noqa: E501 - Lists all Aliases for the User identified by (:alias_label, :alias_id). # noqa: E501 + Returns an array of segments from an app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_aliases(app_id, alias_label, alias_id, async_req=True) + >>> thread = api.get_segments(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): - alias_label (str): - alias_id (str): + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. Keyword Args: + offset (int): Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.. [optional] + limit (int): The amount of Segments in the response. Maximum 300.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3181,7 +5249,7 @@ def get_aliases( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + GetSegmentsSuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -3212,30 +5280,28 @@ def get_aliases( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - return self.get_aliases_endpoint.call_with_http_info(**kwargs) + return self.get_segments_endpoint.call_with_http_info(**kwargs) - def get_aliases_by_subscription( + def get_user( self, app_id, - subscription_id, + alias_label, + alias_id, **kwargs ): - """get_aliases_by_subscription # noqa: E501 + """get_user # noqa: E501 - Lists all Aliases for the User identified by :subscription_id. # noqa: E501 + Returns the User’s properties, Aliases, and Subscriptions. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_aliases_by_subscription(app_id, subscription_id, async_req=True) + >>> thread = api.get_user(app_id, alias_label, alias_id, async_req=True) >>> result = thread.get() Args: app_id (str): - subscription_id (str): + alias_label (str): + alias_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3270,7 +5336,7 @@ def get_aliases_by_subscription( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + User If the method is called asynchronously, returns the request thread. """ @@ -3301,26 +5367,30 @@ def get_aliases_by_subscription( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['subscription_id'] = \ - subscription_id - return self.get_aliases_by_subscription_endpoint.call_with_http_info(**kwargs) + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + return self.get_user_endpoint.call_with_http_info(**kwargs) - def get_app( + def rotate_api_key( self, app_id, + token_id, **kwargs ): - """View an app # noqa: E501 + """Rotate API key # noqa: E501 - View the details of a single OneSignal app # noqa: E501 + Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_app(app_id, async_req=True) + >>> thread = api.rotate_api_key(app_id, token_id, async_req=True) >>> result = thread.get() Args: - app_id (str): An app id + app_id (str): + token_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3355,7 +5425,7 @@ def get_app( async_req (bool): execute request asynchronously Returns: - App + CreateApiKeyResponse If the method is called asynchronously, returns the request thread. """ @@ -3386,21 +5456,30 @@ def get_app( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.get_app_endpoint.call_with_http_info(**kwargs) + kwargs['token_id'] = \ + token_id + return self.rotate_api_key_endpoint.call_with_http_info(**kwargs) - def get_apps( + def start_live_activity( self, + app_id, + activity_type, + start_live_activity_request, **kwargs ): - """View apps # noqa: E501 + """Start Live Activity # noqa: E501 - View the details of all of your current OneSignal apps # noqa: E501 + Remotely start a Live Activity on iOS devices via OneSignal’s REST API. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_apps(async_req=True) + >>> thread = api.start_live_activity(app_id, activity_type, start_live_activity_request, async_req=True) >>> result = thread.get() + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + activity_type (str): The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. + start_live_activity_request (StartLiveActivityRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3435,7 +5514,7 @@ def get_apps( async_req (bool): execute request asynchronously Returns: - Apps + StartLiveActivitySuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -3464,26 +5543,34 @@ def get_apps( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_apps_endpoint.call_with_http_info(**kwargs) + kwargs['app_id'] = \ + app_id + kwargs['activity_type'] = \ + activity_type + kwargs['start_live_activity_request'] = \ + start_live_activity_request + return self.start_live_activity_endpoint.call_with_http_info(**kwargs) - def get_notification( + def transfer_subscription( self, app_id, - notification_id, + subscription_id, + transfer_subscription_request_body, **kwargs ): - """View notification # noqa: E501 + """transfer_subscription # noqa: E501 - View the details of a single notification and outcomes associated with it # noqa: E501 + Transfers this Subscription to the User identified by the identity in the payload. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification(app_id, notification_id, async_req=True) + >>> thread = api.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, async_req=True) >>> result = thread.get() Args: app_id (str): - notification_id (str): + subscription_id (str): + transfer_subscription_request_body (TransferSubscriptionRequestBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3518,7 +5605,7 @@ def get_notification( async_req (bool): execute request asynchronously Returns: - NotificationWithMeta + UserIdentityBody If the method is called asynchronously, returns the request thread. """ @@ -3549,28 +5636,32 @@ def get_notification( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['notification_id'] = \ - notification_id - return self.get_notification_endpoint.call_with_http_info(**kwargs) + kwargs['subscription_id'] = \ + subscription_id + kwargs['transfer_subscription_request_body'] = \ + transfer_subscription_request_body + return self.transfer_subscription_endpoint.call_with_http_info(**kwargs) - def get_notification_history( + def unsubscribe_email_with_token( self, + app_id, notification_id, - get_notification_history_request_body, + token, **kwargs ): - """Notification History # noqa: E501 + """Unsubscribe with token # noqa: E501 - -> 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. # noqa: E501 + Unsubscribe an email with a token when using your own custom email unsubscribe landing page # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_history(notification_id, get_notification_history_request_body, async_req=True) + >>> thread = api.unsubscribe_email_with_token(app_id, notification_id, token, async_req=True) >>> result = thread.get() Args: - notification_id (str): The \"id\" of the message found in the Notification object - get_notification_history_request_body (GetNotificationHistoryRequestBody): + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + notification_id (str): The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. + token (str): The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. Keyword Args: _return_http_data_only (bool): response data without head status @@ -3605,7 +5696,7 @@ def get_notification_history( async_req (bool): execute request asynchronously Returns: - NotificationHistorySuccessResponse + GenericSuccessBoolResponse If the method is called asynchronously, returns the request thread. """ @@ -3634,33 +5725,36 @@ def get_notification_history( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['app_id'] = \ + app_id kwargs['notification_id'] = \ notification_id - kwargs['get_notification_history_request_body'] = \ - get_notification_history_request_body - return self.get_notification_history_endpoint.call_with_http_info(**kwargs) + kwargs['token'] = \ + token + return self.unsubscribe_email_with_token_endpoint.call_with_http_info(**kwargs) - def get_notifications( + def update_api_key( self, app_id, + token_id, + update_api_key_request, **kwargs ): - """View notifications # noqa: E501 + """Update API key # noqa: E501 - View the details of multiple notifications # noqa: E501 + Update a Rich Authentication Token (App API Key) for a OneSignal app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notifications(app_id, async_req=True) + >>> thread = api.update_api_key(app_id, token_id, update_api_key_request, async_req=True) >>> result = thread.get() Args: - app_id (str): The app ID that you want to view notifications from + app_id (str): + token_id (str): + update_api_key_request (UpdateApiKeyRequest): Keyword Args: - limit (int): How many notifications to return. Max is 50. Default is 50.. [optional] - offset (int): 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 (int): Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3693,7 +5787,7 @@ def get_notifications( async_req (bool): execute request asynchronously Returns: - NotificationSlice + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} If the method is called asynchronously, returns the request thread. """ @@ -3724,32 +5818,32 @@ def get_notifications( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.get_notifications_endpoint.call_with_http_info(**kwargs) + kwargs['token_id'] = \ + token_id + kwargs['update_api_key_request'] = \ + update_api_key_request + return self.update_api_key_endpoint.call_with_http_info(**kwargs) - def get_outcomes( + def update_app( self, app_id, - outcome_names, + app, **kwargs ): - """View Outcomes # noqa: E501 + """Update an app # noqa: E501 - 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. # noqa: E501 + Updates the name or configuration settings of an existing OneSignal app # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_outcomes(app_id, outcome_names, async_req=True) + >>> thread = api.update_app(app_id, app, async_req=True) >>> result = thread.get() Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. - outcome_names (str): 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 + app_id (str): An app id + app (App): Keyword Args: - outcome_names2 (str): 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] - outcome_time_range (str): 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] - outcome_platforms (str): 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] - outcome_attribution (str): Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3782,7 +5876,7 @@ def get_outcomes( async_req (bool): execute request asynchronously Returns: - OutcomesData + App If the method is called asynchronously, returns the request thread. """ @@ -3813,30 +5907,32 @@ def get_outcomes( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['outcome_names'] = \ - outcome_names - return self.get_outcomes_endpoint.call_with_http_info(**kwargs) + kwargs['app'] = \ + app + return self.update_app_endpoint.call_with_http_info(**kwargs) - def get_segments( + def update_live_activity( self, app_id, + activity_id, + update_live_activity_request, **kwargs ): - """Get Segments # noqa: E501 + """Update a Live Activity via Push # noqa: E501 - Returns an array of segments from an app. # noqa: E501 + Updates a specified live activity. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_segments(app_id, async_req=True) + >>> thread = api.update_live_activity(app_id, activity_id, update_live_activity_request, async_req=True) >>> result = thread.get() Args: app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + activity_id (str): Live Activity record ID + update_live_activity_request (UpdateLiveActivityRequest): Keyword Args: - offset (int): Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.. [optional] - limit (int): The amount of Segments in the response. Maximum 300.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3869,7 +5965,7 @@ def get_segments( async_req (bool): execute request asynchronously Returns: - GetSegmentsSuccessResponse + UpdateLiveActivitySuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -3900,28 +5996,32 @@ def get_segments( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.get_segments_endpoint.call_with_http_info(**kwargs) + kwargs['activity_id'] = \ + activity_id + kwargs['update_live_activity_request'] = \ + update_live_activity_request + return self.update_live_activity_endpoint.call_with_http_info(**kwargs) - def get_user( + def update_subscription( self, app_id, - alias_label, - alias_id, + subscription_id, + subscription_body, **kwargs ): - """get_user # noqa: E501 + """update_subscription # noqa: E501 - Returns the User’s properties, Aliases, and Subscriptions. # noqa: E501 + Updates an existing Subscription’s properties. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user(app_id, alias_label, alias_id, async_req=True) + >>> thread = api.update_subscription(app_id, subscription_id, subscription_body, async_req=True) >>> result = thread.get() Args: app_id (str): - alias_label (str): - alias_id (str): + subscription_id (str): + subscription_body (SubscriptionBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3956,7 +6056,7 @@ def get_user( async_req (bool): execute request asynchronously Returns: - User + None If the method is called asynchronously, returns the request thread. """ @@ -3987,32 +6087,34 @@ def get_user( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - return self.get_user_endpoint.call_with_http_info(**kwargs) + kwargs['subscription_id'] = \ + subscription_id + kwargs['subscription_body'] = \ + subscription_body + return self.update_subscription_endpoint.call_with_http_info(**kwargs) - def transfer_subscription( + def update_subscription_by_token( self, app_id, - subscription_id, - transfer_subscription_request_body, + token_type, + token, + subscription_body, **kwargs ): - """transfer_subscription # noqa: E501 + """Update subscription by token # noqa: E501 - Transfers this Subscription to the User identified by the identity in the payload. # noqa: E501 + Update properties on an existing OneSignal subscription using its token. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, async_req=True) + >>> thread = api.update_subscription_by_token(app_id, token_type, token, subscription_body, async_req=True) >>> result = thread.get() Args: - app_id (str): - subscription_id (str): - transfer_subscription_request_body (TransferSubscriptionRequestBody): + app_id (str): Your OneSignal App ID in UUID v4 format. + token_type (str): The type of token to use when looking up the subscription. See Subscription Types. + token (str): The value of the token to lookup by (e.g., email address, phone number). + subscription_body (SubscriptionBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -4047,7 +6149,7 @@ def transfer_subscription( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} If the method is called asynchronously, returns the request thread. """ @@ -4078,32 +6180,34 @@ def transfer_subscription( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['subscription_id'] = \ - subscription_id - kwargs['transfer_subscription_request_body'] = \ - transfer_subscription_request_body - return self.transfer_subscription_endpoint.call_with_http_info(**kwargs) + kwargs['token_type'] = \ + token_type + kwargs['token'] = \ + token + kwargs['subscription_body'] = \ + subscription_body + return self.update_subscription_by_token_endpoint.call_with_http_info(**kwargs) - def unsubscribe_email_with_token( + def update_template( self, + template_id, app_id, - notification_id, - token, + update_template_request, **kwargs ): - """Unsubscribe with token # noqa: E501 + """Update template # noqa: E501 - Unsubscribe an email with a token when using your own custom email unsubscribe landing page # noqa: E501 + Update an existing template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.unsubscribe_email_with_token(app_id, notification_id, token, async_req=True) + >>> thread = api.update_template(template_id, app_id, update_template_request, async_req=True) >>> result = thread.get() Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. - notification_id (str): The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. - token (str): The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. + template_id (str): + app_id (str): + update_template_request (UpdateTemplateRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -4138,7 +6242,7 @@ def unsubscribe_email_with_token( async_req (bool): execute request asynchronously Returns: - GenericSuccessBoolResponse + TemplateResource If the method is called asynchronously, returns the request thread. """ @@ -4167,32 +6271,36 @@ def unsubscribe_email_with_token( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['template_id'] = \ + template_id kwargs['app_id'] = \ app_id - kwargs['notification_id'] = \ - notification_id - kwargs['token'] = \ - token - return self.unsubscribe_email_with_token_endpoint.call_with_http_info(**kwargs) + kwargs['update_template_request'] = \ + update_template_request + return self.update_template_endpoint.call_with_http_info(**kwargs) - def update_app( + def update_user( self, app_id, - app, + alias_label, + alias_id, + update_user_request, **kwargs ): - """Update an app # noqa: E501 + """update_user # noqa: E501 - Updates the name or configuration settings of an existing OneSignal app # noqa: E501 + Updates an existing User’s properties. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_app(app_id, app, async_req=True) + >>> thread = api.update_user(app_id, alias_label, alias_id, update_user_request, async_req=True) >>> result = thread.get() Args: - app_id (str): An app id - app (App): + app_id (str): + alias_label (str): + alias_id (str): + update_user_request (UpdateUserRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -4227,7 +6335,7 @@ def update_app( async_req (bool): execute request asynchronously Returns: - App + PropertiesBody If the method is called asynchronously, returns the request thread. """ @@ -4258,30 +6366,30 @@ def update_app( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['app'] = \ - app - return self.update_app_endpoint.call_with_http_info(**kwargs) + kwargs['alias_label'] = \ + alias_label + kwargs['alias_id'] = \ + alias_id + kwargs['update_user_request'] = \ + update_user_request + return self.update_user_endpoint.call_with_http_info(**kwargs) - def update_live_activity( + def view_api_keys( self, app_id, - activity_id, - update_live_activity_request, **kwargs ): - """Update a Live Activity via Push # noqa: E501 + """View API keys # noqa: E501 - Updates a specified live activity. # noqa: E501 + View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_live_activity(app_id, activity_id, update_live_activity_request, async_req=True) + >>> thread = api.view_api_keys(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. - activity_id (str): Live Activity record ID - update_live_activity_request (UpdateLiveActivityRequest): + app_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -4316,7 +6424,7 @@ def update_live_activity( async_req (bool): execute request asynchronously Returns: - UpdateLiveActivitySuccessResponse + ApiKeyTokensListResponse If the method is called asynchronously, returns the request thread. """ @@ -4347,32 +6455,26 @@ def update_live_activity( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['activity_id'] = \ - activity_id - kwargs['update_live_activity_request'] = \ - update_live_activity_request - return self.update_live_activity_endpoint.call_with_http_info(**kwargs) + return self.view_api_keys_endpoint.call_with_http_info(**kwargs) - def update_subscription( + def view_template( self, + template_id, app_id, - subscription_id, - subscription_body, **kwargs ): - """update_subscription # noqa: E501 + """View template # noqa: E501 - Updates an existing Subscription’s properties. # noqa: E501 + Fetch a single template by id. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_subscription(app_id, subscription_id, subscription_body, async_req=True) + >>> thread = api.view_template(template_id, app_id, async_req=True) >>> result = thread.get() Args: + template_id (str): app_id (str): - subscription_id (str): - subscription_body (SubscriptionBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -4407,7 +6509,7 @@ def update_subscription( async_req (bool): execute request asynchronously Returns: - None + TemplateResource If the method is called asynchronously, returns the request thread. """ @@ -4436,38 +6538,33 @@ def update_subscription( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['template_id'] = \ + template_id kwargs['app_id'] = \ app_id - kwargs['subscription_id'] = \ - subscription_id - kwargs['subscription_body'] = \ - subscription_body - return self.update_subscription_endpoint.call_with_http_info(**kwargs) + return self.view_template_endpoint.call_with_http_info(**kwargs) - def update_user( + def view_templates( self, app_id, - alias_label, - alias_id, - update_user_request, **kwargs ): - """update_user # noqa: E501 + """View templates # noqa: E501 - Updates an existing User’s properties. # noqa: E501 + List templates for an app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user(app_id, alias_label, alias_id, update_user_request, async_req=True) + >>> thread = api.view_templates(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): - alias_label (str): - alias_id (str): - update_user_request (UpdateUserRequest): + app_id (str): Your OneSignal App ID in UUID v4 format. Keyword Args: + limit (int): Maximum number of templates. Default and max is 50.. [optional] if omitted the server will use the default value of 50 + offset (int): Pagination offset.. [optional] if omitted the server will use the default value of 0 + channel (str): Filter by delivery channel.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -4500,7 +6597,7 @@ def update_user( async_req (bool): execute request asynchronously Returns: - PropertiesBody + TemplatesListResponse If the method is called asynchronously, returns the request thread. """ @@ -4531,11 +6628,5 @@ def update_user( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - kwargs['alias_label'] = \ - alias_label - kwargs['alias_id'] = \ - alias_id - kwargs['update_user_request'] = \ - update_user_request - return self.update_user_endpoint.call_with_http_info(**kwargs) + return self.view_templates_endpoint.call_with_http_info(**kwargs) diff --git a/onesignal/api_client.py b/onesignal/api_client.py index d0a8861..83cca04 100644 --- a/onesignal/api_client.py +++ b/onesignal/api_client.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/5.2.2-beta1/python' + self.user_agent = 'OpenAPI-Generator/5.3.0-beta1/python' def __enter__(self): return self @@ -142,7 +142,7 @@ def __call_api( # header parameters header_params = header_params or {} header_params.update(self.default_headers) - header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.2.2-beta1" + header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.3.0-beta1" if self.cookie: header_params['Cookie'] = self.cookie if header_params: diff --git a/onesignal/configuration.py b/onesignal/configuration.py index 567e7c4..6e7fb42 100644 --- a/onesignal/configuration.py +++ b/onesignal/configuration.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -399,8 +399,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 5.2.1\n"\ - "SDK Package Version: 5.2.2-beta1".\ + "Version of the API: 5.3.0\n"\ + "SDK Package Version: 5.3.0-beta1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onesignal/exceptions.py b/onesignal/exceptions.py index de759d2..d09f0ce 100644 --- a/onesignal/exceptions.py +++ b/onesignal/exceptions.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/api_key_token.py b/onesignal/model/api_key_token.py new file mode 100644 index 0000000..dfef96b --- /dev/null +++ b/onesignal/model/api_key_token.py @@ -0,0 +1,288 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class ApiKeyToken(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('ip_allowlist_mode',): { + 'DISABLED': "disabled", + 'EXPLICIT': "explicit", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'token_id': (str,), # noqa: E501 + 'updated_at': (str,), # noqa: E501 + 'created_at': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'ip_allowlist_mode': (str,), # noqa: E501 + 'ip_allowlist': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'token_id': 'token_id', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'name': 'name', # noqa: E501 + 'ip_allowlist_mode': 'ip_allowlist_mode', # noqa: E501 + 'ip_allowlist': 'ip_allowlist', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiKeyToken - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + token_id (str): [optional] # noqa: E501 + updated_at (str): [optional] # noqa: E501 + created_at (str): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ApiKeyToken - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + token_id (str): [optional] # noqa: E501 + updated_at (str): [optional] # noqa: E501 + created_at (str): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/api_key_tokens_list_response.py b/onesignal/model/api_key_tokens_list_response.py new file mode 100644 index 0000000..cc06d2f --- /dev/null +++ b/onesignal/model/api_key_tokens_list_response.py @@ -0,0 +1,270 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.api_key_token import ApiKeyToken + globals()['ApiKeyToken'] = ApiKeyToken + + +class ApiKeyTokensListResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'tokens': ([ApiKeyToken],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'tokens': 'tokens', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiKeyTokensListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tokens ([ApiKeyToken]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ApiKeyTokensListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tokens ([ApiKeyToken]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/app.py b/onesignal/model/app.py index 99ebdf4..5c25baf 100644 --- a/onesignal/model/app.py +++ b/onesignal/model/app.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/apps.py b/onesignal/model/apps.py index e1ab5b4..8e767a0 100644 --- a/onesignal/model/apps.py +++ b/onesignal/model/apps.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/basic_notification.py b/onesignal/model/basic_notification.py index 7d37bed..d44ca08 100644 --- a/onesignal/model/basic_notification.py +++ b/onesignal/model/basic_notification.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -35,6 +35,7 @@ def lazy_import(): from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout from onesignal.model.button import Button from onesignal.model.filter_expression import FilterExpression + from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_target import NotificationTarget from onesignal.model.web_button import WebButton @@ -42,6 +43,7 @@ def lazy_import(): globals()['BasicNotificationAllOfAndroidBackgroundLayout'] = BasicNotificationAllOfAndroidBackgroundLayout globals()['Button'] = Button globals()['FilterExpression'] = FilterExpression + globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationTarget'] = NotificationTarget globals()['WebButton'] = WebButton @@ -121,7 +123,7 @@ def openapi_types(): 'include_chrome_reg_ids': ([str],), # noqa: E501 'include_chrome_web_reg_ids': ([str],), # noqa: E501 'include_android_reg_ids': ([str],), # noqa: E501 - 'include_aliases': ({str: ([str],)}, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 'target_channel': (str,), # noqa: E501 'id': (str,), # noqa: E501 'value': (int,), # noqa: E501 @@ -388,7 +390,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 @@ -599,7 +601,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 diff --git a/onesignal/model/basic_notification_all_of.py b/onesignal/model/basic_notification_all_of.py index 0ffa7c5..6b189b8 100644 --- a/onesignal/model/basic_notification_all_of.py +++ b/onesignal/model/basic_notification_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/basic_notification_all_of_android_background_layout.py b/onesignal/model/basic_notification_all_of_android_background_layout.py index 96ea66b..bfd147d 100644 --- a/onesignal/model/basic_notification_all_of_android_background_layout.py +++ b/onesignal/model/basic_notification_all_of_android_background_layout.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/button.py b/onesignal/model/button.py index c6f5ed2..e1e351e 100644 --- a/onesignal/model/button.py +++ b/onesignal/model/button.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/copy_template_request.py b/onesignal/model/copy_template_request.py new file mode 100644 index 0000000..b7d005a --- /dev/null +++ b/onesignal/model/copy_template_request.py @@ -0,0 +1,270 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class CopyTemplateRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'target_app_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'target_app_id': 'target_app_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, target_app_id, *args, **kwargs): # noqa: E501 + """CopyTemplateRequest - a model defined in OpenAPI + + Args: + target_app_id (str): Destination OneSignal App ID in UUID v4 format. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.target_app_id = target_app_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, target_app_id, *args, **kwargs): # noqa: E501 + """CopyTemplateRequest - a model defined in OpenAPI + + Args: + target_app_id (str): Destination OneSignal App ID in UUID v4 format. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.target_app_id = target_app_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/create_api_key_request.py b/onesignal/model/create_api_key_request.py new file mode 100644 index 0000000..d77f3e1 --- /dev/null +++ b/onesignal/model/create_api_key_request.py @@ -0,0 +1,276 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class CreateApiKeyRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('ip_allowlist_mode',): { + 'DISABLED': "disabled", + 'EXPLICIT': "explicit", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'ip_allowlist_mode': (str,), # noqa: E501 + 'ip_allowlist': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'ip_allowlist_mode': 'ip_allowlist_mode', # noqa: E501 + 'ip_allowlist': 'ip_allowlist', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateApiKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateApiKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/create_api_key_response.py b/onesignal/model/create_api_key_response.py new file mode 100644 index 0000000..d36235c --- /dev/null +++ b/onesignal/model/create_api_key_response.py @@ -0,0 +1,268 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class CreateApiKeyResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'token_id': (str,), # noqa: E501 + 'formatted_token': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'token_id': 'token_id', # noqa: E501 + 'formatted_token': 'formatted_token', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateApiKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + token_id (str): [optional] # noqa: E501 + formatted_token (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateApiKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + token_id (str): [optional] # noqa: E501 + formatted_token (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/create_notification_success_response.py b/onesignal/model/create_notification_success_response.py index 2517a63..87ea748 100644 --- a/onesignal/model/create_notification_success_response.py +++ b/onesignal/model/create_notification_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/create_segment_conflict_response.py b/onesignal/model/create_segment_conflict_response.py index b4c95b6..f9fd540 100644 --- a/onesignal/model/create_segment_conflict_response.py +++ b/onesignal/model/create_segment_conflict_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/create_segment_success_response.py b/onesignal/model/create_segment_success_response.py index 16e72c0..e166e3a 100644 --- a/onesignal/model/create_segment_success_response.py +++ b/onesignal/model/create_segment_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/create_template_request.py b/onesignal/model/create_template_request.py new file mode 100644 index 0000000..0cb5d5f --- /dev/null +++ b/onesignal/model/create_template_request.py @@ -0,0 +1,308 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.language_string_map import LanguageStringMap + globals()['LanguageStringMap'] = LanguageStringMap + + +class CreateTemplateRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'app_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'contents': (LanguageStringMap,), # noqa: E501 + 'is_email': (bool,), # noqa: E501 + 'email_subject': (str, none_type,), # noqa: E501 + 'email_body': (str, none_type,), # noqa: E501 + 'is_sms': (bool,), # noqa: E501 + 'dynamic_content': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'app_id': 'app_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'contents': 'contents', # noqa: E501 + 'is_email': 'isEmail', # noqa: E501 + 'email_subject': 'email_subject', # noqa: E501 + 'email_body': 'email_body', # noqa: E501 + 'is_sms': 'isSMS', # noqa: E501 + 'dynamic_content': 'dynamic_content', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, app_id, name, contents, *args, **kwargs): # noqa: E501 + """CreateTemplateRequest - a model defined in OpenAPI + + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + name (str): Name of the template. + contents (LanguageStringMap): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_email (bool): Set true for an Email template.. [optional] # noqa: E501 + email_subject (str, none_type): Subject of the email.. [optional] # noqa: E501 + email_body (str, none_type): Body of the email (HTML supported).. [optional] # noqa: E501 + is_sms (bool): Set true for an SMS template.. [optional] # noqa: E501 + dynamic_content (str, none_type): JSON string for dynamic content personalization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.app_id = app_id + self.name = name + self.contents = contents + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, app_id, name, contents, *args, **kwargs): # noqa: E501 + """CreateTemplateRequest - a model defined in OpenAPI + + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + name (str): Name of the template. + contents (LanguageStringMap): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_email (bool): Set true for an Email template.. [optional] # noqa: E501 + email_subject (str, none_type): Subject of the email.. [optional] # noqa: E501 + email_body (str, none_type): Body of the email (HTML supported).. [optional] # noqa: E501 + is_sms (bool): Set true for an SMS template.. [optional] # noqa: E501 + dynamic_content (str, none_type): JSON string for dynamic content personalization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.app_id = app_id + self.name = name + self.contents = contents + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/create_user_conflict_response.py b/onesignal/model/create_user_conflict_response.py index b27eb2c..90dde14 100644 --- a/onesignal/model/create_user_conflict_response.py +++ b/onesignal/model/create_user_conflict_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/create_user_conflict_response_errors_inner.py b/onesignal/model/create_user_conflict_response_errors_inner.py index b00a5df..cb42f87 100644 --- a/onesignal/model/create_user_conflict_response_errors_inner.py +++ b/onesignal/model/create_user_conflict_response_errors_inner.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/create_user_conflict_response_errors_items_meta.py b/onesignal/model/create_user_conflict_response_errors_items_meta.py index 03917a6..5ef4b6b 100644 --- a/onesignal/model/create_user_conflict_response_errors_items_meta.py +++ b/onesignal/model/create_user_conflict_response_errors_items_meta.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/custom_event.py b/onesignal/model/custom_event.py new file mode 100644 index 0000000..beafd48 --- /dev/null +++ b/onesignal/model/custom_event.py @@ -0,0 +1,286 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class CustomEvent(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'external_id': (str, none_type,), # noqa: E501 + 'onesignal_id': (str, none_type,), # noqa: E501 + 'timestamp': (datetime,), # noqa: E501 + 'payload': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'external_id': 'external_id', # noqa: E501 + 'onesignal_id': 'onesignal_id', # noqa: E501 + 'timestamp': 'timestamp', # noqa: E501 + 'payload': 'payload', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """CustomEvent - a model defined in OpenAPI + + Args: + name (str): The identifier or name of the event. Maximum 128 characters. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + external_id (str, none_type): The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.. [optional] # noqa: E501 + onesignal_id (str, none_type): The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.. [optional] # noqa: E501 + timestamp (datetime): Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided.. [optional] # noqa: E501 + payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Properties or data related to the event, like {\"geography\": \"USA\"}. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, *args, **kwargs): # noqa: E501 + """CustomEvent - a model defined in OpenAPI + + Args: + name (str): The identifier or name of the event. Maximum 128 characters. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + external_id (str, none_type): The external ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.. [optional] # noqa: E501 + onesignal_id (str, none_type): The OneSignal ID of the user targeted for the event. Either the user's External ID or OneSignal ID is required.. [optional] # noqa: E501 + timestamp (datetime): Time the event occurred as an ISO8601 formatted string. Defaults to now if not included or past date provided.. [optional] # noqa: E501 + payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Properties or data related to the event, like {\"geography\": \"USA\"}. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/custom_events_request.py b/onesignal/model/custom_events_request.py new file mode 100644 index 0000000..68fff99 --- /dev/null +++ b/onesignal/model/custom_events_request.py @@ -0,0 +1,276 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.custom_event import CustomEvent + globals()['CustomEvent'] = CustomEvent + + +class CustomEventsRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'events': ([CustomEvent],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'events': 'events', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, events, *args, **kwargs): # noqa: E501 + """CustomEventsRequest - a model defined in OpenAPI + + Args: + events ([CustomEvent]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.events = events + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, events, *args, **kwargs): # noqa: E501 + """CustomEventsRequest - a model defined in OpenAPI + + Args: + events ([CustomEvent]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.events = events + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/delivery_data.py b/onesignal/model/delivery_data.py index cb35f49..4758ff7 100644 --- a/onesignal/model/delivery_data.py +++ b/onesignal/model/delivery_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/export_events_success_response.py b/onesignal/model/export_events_success_response.py index 9445453..55e2182 100644 --- a/onesignal/model/export_events_success_response.py +++ b/onesignal/model/export_events_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/export_subscriptions_request_body.py b/onesignal/model/export_subscriptions_request_body.py index e14f811..584b6df 100644 --- a/onesignal/model/export_subscriptions_request_body.py +++ b/onesignal/model/export_subscriptions_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/export_subscriptions_success_response.py b/onesignal/model/export_subscriptions_success_response.py index 199d918..f0e28b6 100644 --- a/onesignal/model/export_subscriptions_success_response.py +++ b/onesignal/model/export_subscriptions_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/filter.py b/onesignal/model/filter.py index b8ac80d..c72de18 100644 --- a/onesignal/model/filter.py +++ b/onesignal/model/filter.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/filter_expression.py b/onesignal/model/filter_expression.py index 271e808..9c46dfe 100644 --- a/onesignal/model/filter_expression.py +++ b/onesignal/model/filter_expression.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/generic_error.py b/onesignal/model/generic_error.py index 6d3dc1b..a8e6458 100644 --- a/onesignal/model/generic_error.py +++ b/onesignal/model/generic_error.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/generic_success_bool_response.py b/onesignal/model/generic_success_bool_response.py index 0172b54..a8f5d5b 100644 --- a/onesignal/model/generic_success_bool_response.py +++ b/onesignal/model/generic_success_bool_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/get_notification_history_request_body.py b/onesignal/model/get_notification_history_request_body.py index 2a95fcb..b2c4e52 100644 --- a/onesignal/model/get_notification_history_request_body.py +++ b/onesignal/model/get_notification_history_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/get_segments_success_response.py b/onesignal/model/get_segments_success_response.py index 5c0c5a9..0426471 100644 --- a/onesignal/model/get_segments_success_response.py +++ b/onesignal/model/get_segments_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/identity_object.py b/onesignal/model/identity_object.py index e7e8420..d8a6cda 100644 --- a/onesignal/model/identity_object.py +++ b/onesignal/model/identity_object.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/include_aliases.py b/onesignal/model/include_aliases.py new file mode 100644 index 0000000..fd42abf --- /dev/null +++ b/onesignal/model/include_aliases.py @@ -0,0 +1,260 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class IncludeAliases(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ([str],) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncludeAliases - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """IncludeAliases - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/language_string_map.py b/onesignal/model/language_string_map.py index a8a00c3..3c70e4f 100644 --- a/onesignal/model/language_string_map.py +++ b/onesignal/model/language_string_map.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/notification.py b/onesignal/model/notification.py index 207d9cb..6dce078 100644 --- a/onesignal/model/notification.py +++ b/onesignal/model/notification.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -35,6 +35,7 @@ def lazy_import(): from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout from onesignal.model.button import Button from onesignal.model.filter_expression import FilterExpression + from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_all_of import NotificationAllOf from onesignal.model.web_button import WebButton @@ -42,6 +43,7 @@ def lazy_import(): globals()['BasicNotificationAllOfAndroidBackgroundLayout'] = BasicNotificationAllOfAndroidBackgroundLayout globals()['Button'] = Button globals()['FilterExpression'] = FilterExpression + globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationAllOf'] = NotificationAllOf globals()['WebButton'] = WebButton @@ -121,7 +123,7 @@ def openapi_types(): 'include_chrome_reg_ids': ([str],), # noqa: E501 'include_chrome_web_reg_ids': ([str],), # noqa: E501 'include_android_reg_ids': ([str],), # noqa: E501 - 'include_aliases': ({str: ([str],)}, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 'target_channel': (str,), # noqa: E501 'id': (str,), # noqa: E501 'value': (int,), # noqa: E501 @@ -390,7 +392,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 @@ -602,7 +604,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 diff --git a/onesignal/model/notification_all_of.py b/onesignal/model/notification_all_of.py index fab19ba..366b138 100644 --- a/onesignal/model/notification_all_of.py +++ b/onesignal/model/notification_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/notification_history_success_response.py b/onesignal/model/notification_history_success_response.py index ea4f64e..3a4919a 100644 --- a/onesignal/model/notification_history_success_response.py +++ b/onesignal/model/notification_history_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/notification_slice.py b/onesignal/model/notification_slice.py index 3de976b..3c9ec4b 100644 --- a/onesignal/model/notification_slice.py +++ b/onesignal/model/notification_slice.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/notification_target.py b/onesignal/model/notification_target.py index c66761d..614d944 100644 --- a/onesignal/model/notification_target.py +++ b/onesignal/model/notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -31,8 +31,10 @@ def lazy_import(): + from onesignal.model.include_aliases import IncludeAliases from onesignal.model.segment_notification_target import SegmentNotificationTarget from onesignal.model.subscription_notification_target import SubscriptionNotificationTarget + globals()['IncludeAliases'] = IncludeAliases globals()['SegmentNotificationTarget'] = SegmentNotificationTarget globals()['SubscriptionNotificationTarget'] = SubscriptionNotificationTarget @@ -106,7 +108,7 @@ def openapi_types(): 'include_chrome_reg_ids': ([str],), # noqa: E501 'include_chrome_web_reg_ids': ([str],), # noqa: E501 'include_android_reg_ids': ([str],), # noqa: E501 - 'include_aliases': ({str: ([str],)}, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 'target_channel': (str,), # noqa: E501 } @@ -181,7 +183,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 """ @@ -297,7 +299,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 """ diff --git a/onesignal/model/notification_with_meta.py b/onesignal/model/notification_with_meta.py index a252c0c..923eaad 100644 --- a/onesignal/model/notification_with_meta.py +++ b/onesignal/model/notification_with_meta.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -36,6 +36,7 @@ def lazy_import(): from onesignal.model.button import Button from onesignal.model.delivery_data import DeliveryData from onesignal.model.filter_expression import FilterExpression + from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_with_meta_all_of import NotificationWithMetaAllOf from onesignal.model.outcome_data import OutcomeData @@ -47,6 +48,7 @@ def lazy_import(): globals()['Button'] = Button globals()['DeliveryData'] = DeliveryData globals()['FilterExpression'] = FilterExpression + globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationWithMetaAllOf'] = NotificationWithMetaAllOf globals()['OutcomeData'] = OutcomeData @@ -129,7 +131,7 @@ def openapi_types(): 'include_chrome_reg_ids': ([str],), # noqa: E501 'include_chrome_web_reg_ids': ([str],), # noqa: E501 'include_android_reg_ids': ([str],), # noqa: E501 - 'include_aliases': ({str: ([str],)}, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 'target_channel': (str,), # noqa: E501 'id': (str,), # noqa: E501 'value': (int,), # noqa: E501 @@ -420,7 +422,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 @@ -643,7 +645,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 id (str): [optional] # noqa: E501 value (int): [optional] # noqa: E501 diff --git a/onesignal/model/notification_with_meta_all_of.py b/onesignal/model/notification_with_meta_all_of.py index b6eb23a..c405c9c 100644 --- a/onesignal/model/notification_with_meta_all_of.py +++ b/onesignal/model/notification_with_meta_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/operator.py b/onesignal/model/operator.py index d006a10..db790c6 100644 --- a/onesignal/model/operator.py +++ b/onesignal/model/operator.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/outcome_data.py b/onesignal/model/outcome_data.py index 3288a8c..b833507 100644 --- a/onesignal/model/outcome_data.py +++ b/onesignal/model/outcome_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/outcomes_data.py b/onesignal/model/outcomes_data.py index 93895a0..c7e9b70 100644 --- a/onesignal/model/outcomes_data.py +++ b/onesignal/model/outcomes_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/platform_delivery_data.py b/onesignal/model/platform_delivery_data.py index f3d8986..a49379b 100644 --- a/onesignal/model/platform_delivery_data.py +++ b/onesignal/model/platform_delivery_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/platform_delivery_data_email_all_of.py b/onesignal/model/platform_delivery_data_email_all_of.py index 0a2a179..359c07d 100644 --- a/onesignal/model/platform_delivery_data_email_all_of.py +++ b/onesignal/model/platform_delivery_data_email_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/platform_delivery_data_sms_all_of.py b/onesignal/model/platform_delivery_data_sms_all_of.py index 286fab4..edd53bf 100644 --- a/onesignal/model/platform_delivery_data_sms_all_of.py +++ b/onesignal/model/platform_delivery_data_sms_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/properties_body.py b/onesignal/model/properties_body.py index 32d9c62..2d430c9 100644 --- a/onesignal/model/properties_body.py +++ b/onesignal/model/properties_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/properties_deltas.py b/onesignal/model/properties_deltas.py index 10b5b8d..9dc8c91 100644 --- a/onesignal/model/properties_deltas.py +++ b/onesignal/model/properties_deltas.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/properties_object.py b/onesignal/model/properties_object.py index f348464..f076c17 100644 --- a/onesignal/model/properties_object.py +++ b/onesignal/model/properties_object.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/purchase.py b/onesignal/model/purchase.py index 3c6bd8d..68a0ecb 100644 --- a/onesignal/model/purchase.py +++ b/onesignal/model/purchase.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/rate_limit_error.py b/onesignal/model/rate_limit_error.py index 612487f..13966c0 100644 --- a/onesignal/model/rate_limit_error.py +++ b/onesignal/model/rate_limit_error.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/segment.py b/onesignal/model/segment.py index c735459..7adb60c 100644 --- a/onesignal/model/segment.py +++ b/onesignal/model/segment.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/segment_data.py b/onesignal/model/segment_data.py index dedfe07..f2a4ad2 100644 --- a/onesignal/model/segment_data.py +++ b/onesignal/model/segment_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/segment_notification_target.py b/onesignal/model/segment_notification_target.py index 4196601..909d466 100644 --- a/onesignal/model/segment_notification_target.py +++ b/onesignal/model/segment_notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/start_live_activity_request.py b/onesignal/model/start_live_activity_request.py new file mode 100644 index 0000000..4feedc8 --- /dev/null +++ b/onesignal/model/start_live_activity_request.py @@ -0,0 +1,357 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.filter_expression import FilterExpression + from onesignal.model.include_aliases import IncludeAliases + from onesignal.model.language_string_map import LanguageStringMap + globals()['FilterExpression'] = FilterExpression + globals()['IncludeAliases'] = IncludeAliases + globals()['LanguageStringMap'] = LanguageStringMap + + +class StartLiveActivityRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('event',): { + 'START': "start", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'event': (str,), # noqa: E501 + 'activity_id': (str,), # noqa: E501 + 'event_attributes': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'event_updates': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'contents': (LanguageStringMap,), # noqa: E501 + 'headings': (LanguageStringMap,), # noqa: E501 + 'stale_date': (int,), # noqa: E501 + 'priority': (int,), # noqa: E501 + 'ios_relevance_score': (float, none_type,), # noqa: E501 + 'idempotency_key': (str, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 + 'include_subscription_ids': ([str], none_type,), # noqa: E501 + 'included_segments': ([str], none_type,), # noqa: E501 + 'excluded_segments': ([str], none_type,), # noqa: E501 + 'filters': ([FilterExpression], none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'event': 'event', # noqa: E501 + 'activity_id': 'activity_id', # noqa: E501 + 'event_attributes': 'event_attributes', # noqa: E501 + 'event_updates': 'event_updates', # noqa: E501 + 'contents': 'contents', # noqa: E501 + 'headings': 'headings', # noqa: E501 + 'stale_date': 'stale_date', # noqa: E501 + 'priority': 'priority', # noqa: E501 + 'ios_relevance_score': 'ios_relevance_score', # noqa: E501 + 'idempotency_key': 'idempotency_key', # noqa: E501 + 'include_aliases': 'include_aliases', # noqa: E501 + 'include_subscription_ids': 'include_subscription_ids', # noqa: E501 + 'included_segments': 'included_segments', # noqa: E501 + 'excluded_segments': 'excluded_segments', # noqa: E501 + 'filters': 'filters', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, activity_id, event_attributes, event_updates, contents, headings, *args, **kwargs): # noqa: E501 + """StartLiveActivityRequest - a model defined in OpenAPI + + Args: + name (str): An internal name to assist with your campaign organization. This does not get displayed in the message itself. + activity_id (str): Set a unique activity_id to track and manage the Live Activity. + event_attributes ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Default/static data to initialize the Live Activity upon start. + event_updates ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. + contents (LanguageStringMap): + headings (LanguageStringMap): + + Keyword Args: + event (str): defaults to "start", must be one of ["start", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + stale_date (int): Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.. [optional] # noqa: E501 + priority (int): Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10.. [optional] # noqa: E501 + ios_relevance_score (float, none_type): iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1.. [optional] # noqa: E501 + idempotency_key (str, none_type): Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true . [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 + include_subscription_ids ([str], none_type): Specific subscription ids to target. Not compatible with other targeting parameters.. [optional] # noqa: E501 + included_segments ([str], none_type): Segment names to include. Only compatible with excluded_segments.. [optional] # noqa: E501 + excluded_segments ([str], none_type): Segment names to exclude. Only compatible with included_segments.. [optional] # noqa: E501 + filters ([FilterExpression], none_type): [optional] # noqa: E501 + """ + + event = kwargs.get('event', "start") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.event = event + self.activity_id = activity_id + self.event_attributes = event_attributes + self.event_updates = event_updates + self.contents = contents + self.headings = headings + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, activity_id, event_attributes, event_updates, contents, headings, *args, **kwargs): # noqa: E501 + """StartLiveActivityRequest - a model defined in OpenAPI + + Args: + name (str): An internal name to assist with your campaign organization. This does not get displayed in the message itself. + activity_id (str): Set a unique activity_id to track and manage the Live Activity. + event_attributes ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Default/static data to initialize the Live Activity upon start. + event_updates ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app. + contents (LanguageStringMap): + headings (LanguageStringMap): + + Keyword Args: + event (str): defaults to "start", must be one of ["start", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + stale_date (int): Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.. [optional] # noqa: E501 + priority (int): Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10.. [optional] # noqa: E501 + ios_relevance_score (float, none_type): iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1.. [optional] # noqa: E501 + idempotency_key (str, none_type): Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true . [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 + include_subscription_ids ([str], none_type): Specific subscription ids to target. Not compatible with other targeting parameters.. [optional] # noqa: E501 + included_segments ([str], none_type): Segment names to include. Only compatible with excluded_segments.. [optional] # noqa: E501 + excluded_segments ([str], none_type): Segment names to exclude. Only compatible with included_segments.. [optional] # noqa: E501 + filters ([FilterExpression], none_type): [optional] # noqa: E501 + """ + + event = kwargs.get('event', "start") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.event = event + self.activity_id = activity_id + self.event_attributes = event_attributes + self.event_updates = event_updates + self.contents = contents + self.headings = headings + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/start_live_activity_success_response.py b/onesignal/model/start_live_activity_success_response.py new file mode 100644 index 0000000..2e74044 --- /dev/null +++ b/onesignal/model/start_live_activity_success_response.py @@ -0,0 +1,264 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class StartLiveActivitySuccessResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'notification_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'notification_id': 'notification_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """StartLiveActivitySuccessResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + notification_id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """StartLiveActivitySuccessResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + notification_id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/subscription.py b/onesignal/model/subscription.py index 45dae1f..c3cb916 100644 --- a/onesignal/model/subscription.py +++ b/onesignal/model/subscription.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/subscription_body.py b/onesignal/model/subscription_body.py index 0c4fd65..cca9831 100644 --- a/onesignal/model/subscription_body.py +++ b/onesignal/model/subscription_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/subscription_notification_target.py b/onesignal/model/subscription_notification_target.py index 31ba753..d267ac1 100644 --- a/onesignal/model/subscription_notification_target.py +++ b/onesignal/model/subscription_notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -30,6 +30,10 @@ from onesignal.exceptions import ApiAttributeError +def lazy_import(): + from onesignal.model.include_aliases import IncludeAliases + globals()['IncludeAliases'] = IncludeAliases + class SubscriptionNotificationTarget(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. @@ -72,6 +76,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ + lazy_import() return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,6 +91,7 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'include_subscription_ids': ([str], none_type,), # noqa: E501 'include_email_tokens': ([str],), # noqa: E501 @@ -96,7 +102,7 @@ def openapi_types(): 'include_chrome_reg_ids': ([str],), # noqa: E501 'include_chrome_web_reg_ids': ([str],), # noqa: E501 'include_android_reg_ids': ([str],), # noqa: E501 - 'include_aliases': ({str: ([str],)}, none_type,), # noqa: E501 + 'include_aliases': (IncludeAliases,), # noqa: E501 'target_channel': (str,), # noqa: E501 } @@ -169,7 +175,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 """ @@ -265,7 +271,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 include_chrome_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_chrome_web_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 include_android_reg_ids ([str]): Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call . [optional] # noqa: E501 - include_aliases ({str: ([str],)}, none_type): Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.. [optional] # noqa: E501 + include_aliases (IncludeAliases): [optional] # noqa: E501 target_channel (str): [optional] # noqa: E501 """ diff --git a/onesignal/model/template_resource.py b/onesignal/model/template_resource.py new file mode 100644 index 0000000..6b7730a --- /dev/null +++ b/onesignal/model/template_resource.py @@ -0,0 +1,290 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class TemplateResource(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('channel',): { + 'None': None, + 'PUSH': "push", + 'EMAIL': "email", + 'SMS': "sms", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'created_at': (datetime,), # noqa: E501 + 'updated_at': (datetime,), # noqa: E501 + 'channel': (str, none_type,), # noqa: E501 + 'content': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'channel': 'channel', # noqa: E501 + 'content': 'content', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TemplateResource - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + created_at (datetime): [optional] # noqa: E501 + updated_at (datetime): [optional] # noqa: E501 + channel (str, none_type): [optional] # noqa: E501 + content ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Rendered content and channel/platform flags for the template.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """TemplateResource - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + created_at (datetime): [optional] # noqa: E501 + updated_at (datetime): [optional] # noqa: E501 + channel (str, none_type): [optional] # noqa: E501 + content ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Rendered content and channel/platform flags for the template.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/templates_list_response.py b/onesignal/model/templates_list_response.py new file mode 100644 index 0000000..6c511b4 --- /dev/null +++ b/onesignal/model/templates_list_response.py @@ -0,0 +1,270 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.template_resource import TemplateResource + globals()['TemplateResource'] = TemplateResource + + +class TemplatesListResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'templates': ([TemplateResource],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'templates': 'templates', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TemplatesListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + templates ([TemplateResource]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """TemplatesListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + templates ([TemplateResource]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/transfer_subscription_request_body.py b/onesignal/model/transfer_subscription_request_body.py index 9d2c79b..78333c5 100644 --- a/onesignal/model/transfer_subscription_request_body.py +++ b/onesignal/model/transfer_subscription_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/update_api_key_request.py b/onesignal/model/update_api_key_request.py new file mode 100644 index 0000000..b8a9fee --- /dev/null +++ b/onesignal/model/update_api_key_request.py @@ -0,0 +1,276 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class UpdateApiKeyRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('ip_allowlist_mode',): { + 'DISABLED': "disabled", + 'EXPLICIT': "explicit", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'ip_allowlist_mode': (str,), # noqa: E501 + 'ip_allowlist': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'ip_allowlist_mode': 'ip_allowlist_mode', # noqa: E501 + 'ip_allowlist': 'ip_allowlist', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateApiKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UpdateApiKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + ip_allowlist_mode (str): [optional] # noqa: E501 + ip_allowlist ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/update_live_activity_request.py b/onesignal/model/update_live_activity_request.py index b35df64..83ad884 100644 --- a/onesignal/model/update_live_activity_request.py +++ b/onesignal/model/update_live_activity_request.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/update_live_activity_success_response.py b/onesignal/model/update_live_activity_success_response.py index eef1fb5..4d1b1a6 100644 --- a/onesignal/model/update_live_activity_success_response.py +++ b/onesignal/model/update_live_activity_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/update_template_request.py b/onesignal/model/update_template_request.py new file mode 100644 index 0000000..a8dd445 --- /dev/null +++ b/onesignal/model/update_template_request.py @@ -0,0 +1,294 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.language_string_map import LanguageStringMap + globals()['LanguageStringMap'] = LanguageStringMap + + +class UpdateTemplateRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'contents': (LanguageStringMap,), # noqa: E501 + 'is_email': (bool,), # noqa: E501 + 'email_subject': (str, none_type,), # noqa: E501 + 'email_body': (str, none_type,), # noqa: E501 + 'is_sms': (bool,), # noqa: E501 + 'dynamic_content': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'contents': 'contents', # noqa: E501 + 'is_email': 'isEmail', # noqa: E501 + 'email_subject': 'email_subject', # noqa: E501 + 'email_body': 'email_body', # noqa: E501 + 'is_sms': 'isSMS', # noqa: E501 + 'dynamic_content': 'dynamic_content', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateTemplateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): Updated name of the template.. [optional] # noqa: E501 + contents (LanguageStringMap): [optional] # noqa: E501 + is_email (bool): Set true for an Email template.. [optional] # noqa: E501 + email_subject (str, none_type): Subject of the email.. [optional] # noqa: E501 + email_body (str, none_type): Body of the email (HTML supported).. [optional] # noqa: E501 + is_sms (bool): Set true for an SMS template.. [optional] # noqa: E501 + dynamic_content (str, none_type): JSON string for dynamic content personalization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UpdateTemplateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): Updated name of the template.. [optional] # noqa: E501 + contents (LanguageStringMap): [optional] # noqa: E501 + is_email (bool): Set true for an Email template.. [optional] # noqa: E501 + email_subject (str, none_type): Subject of the email.. [optional] # noqa: E501 + email_body (str, none_type): Body of the email (HTML supported).. [optional] # noqa: E501 + is_sms (bool): Set true for an SMS template.. [optional] # noqa: E501 + dynamic_content (str, none_type): JSON string for dynamic content personalization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/onesignal/model/update_user_request.py b/onesignal/model/update_user_request.py index 9b44fd6..b657599 100644 --- a/onesignal/model/update_user_request.py +++ b/onesignal/model/update_user_request.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/user.py b/onesignal/model/user.py index 166ed48..6293d05 100644 --- a/onesignal/model/user.py +++ b/onesignal/model/user.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/user_identity_body.py b/onesignal/model/user_identity_body.py index 72d5674..0712b61 100644 --- a/onesignal/model/user_identity_body.py +++ b/onesignal/model/user_identity_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model/web_button.py b/onesignal/model/web_button.py index 23b810f..15beb1a 100644 --- a/onesignal/model/web_button.py +++ b/onesignal/model/web_button.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/model_utils.py b/onesignal/model_utils.py index 9c24cb3..4342de4 100644 --- a/onesignal/model_utils.py +++ b/onesignal/model_utils.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/onesignal/models/__init__.py b/onesignal/models/__init__.py index 780ffa1..091dcfb 100644 --- a/onesignal/models/__init__.py +++ b/onesignal/models/__init__.py @@ -9,18 +9,26 @@ # import sys # sys.setrecursionlimit(n) +from onesignal.model.api_key_token import ApiKeyToken +from onesignal.model.api_key_tokens_list_response import ApiKeyTokensListResponse from onesignal.model.app import App from onesignal.model.apps import Apps from onesignal.model.basic_notification import BasicNotification from onesignal.model.basic_notification_all_of import BasicNotificationAllOf from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout from onesignal.model.button import Button +from onesignal.model.copy_template_request import CopyTemplateRequest +from onesignal.model.create_api_key_request import CreateApiKeyRequest +from onesignal.model.create_api_key_response import CreateApiKeyResponse from onesignal.model.create_notification_success_response import CreateNotificationSuccessResponse from onesignal.model.create_segment_conflict_response import CreateSegmentConflictResponse from onesignal.model.create_segment_success_response import CreateSegmentSuccessResponse +from onesignal.model.create_template_request import CreateTemplateRequest from onesignal.model.create_user_conflict_response import CreateUserConflictResponse from onesignal.model.create_user_conflict_response_errors_inner import CreateUserConflictResponseErrorsInner from onesignal.model.create_user_conflict_response_errors_items_meta import CreateUserConflictResponseErrorsItemsMeta +from onesignal.model.custom_event import CustomEvent +from onesignal.model.custom_events_request import CustomEventsRequest from onesignal.model.delivery_data import DeliveryData from onesignal.model.export_events_success_response import ExportEventsSuccessResponse from onesignal.model.export_subscriptions_request_body import ExportSubscriptionsRequestBody @@ -32,6 +40,7 @@ from onesignal.model.get_notification_history_request_body import GetNotificationHistoryRequestBody from onesignal.model.get_segments_success_response import GetSegmentsSuccessResponse from onesignal.model.identity_object import IdentityObject +from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification import Notification from onesignal.model.notification_all_of import NotificationAllOf @@ -54,12 +63,18 @@ from onesignal.model.segment import Segment from onesignal.model.segment_data import SegmentData from onesignal.model.segment_notification_target import SegmentNotificationTarget +from onesignal.model.start_live_activity_request import StartLiveActivityRequest +from onesignal.model.start_live_activity_success_response import StartLiveActivitySuccessResponse from onesignal.model.subscription import Subscription from onesignal.model.subscription_body import SubscriptionBody from onesignal.model.subscription_notification_target import SubscriptionNotificationTarget +from onesignal.model.template_resource import TemplateResource +from onesignal.model.templates_list_response import TemplatesListResponse from onesignal.model.transfer_subscription_request_body import TransferSubscriptionRequestBody +from onesignal.model.update_api_key_request import UpdateApiKeyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse +from onesignal.model.update_template_request import UpdateTemplateRequest from onesignal.model.update_user_request import UpdateUserRequest from onesignal.model.user import User from onesignal.model.user_identity_body import UserIdentityBody diff --git a/onesignal/rest.py b/onesignal/rest.py index b814c12..53ff9f4 100644 --- a/onesignal/rest.py +++ b/onesignal/rest.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/setup.py b/setup.py index e986e71..c9423c8 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onesignal_python_api" -VERSION = "5.2.2-beta1" +VERSION = "5.3.0-beta1" # To install the library, run the following # # python setup.py install diff --git a/test/test_api_key_token.py b/test/test_api_key_token.py new file mode 100644 index 0000000..0ebe42b --- /dev/null +++ b/test/test_api_key_token.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.api_key_token import ApiKeyToken + + +class TestApiKeyToken(unittest.TestCase): + """ApiKeyToken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiKeyToken(self): + """Test ApiKeyToken""" + # FIXME: construct object with mandatory attributes with example values + # model = ApiKeyToken() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_api_key_tokens_list_response.py b/test/test_api_key_tokens_list_response.py new file mode 100644 index 0000000..2532ba7 --- /dev/null +++ b/test/test_api_key_tokens_list_response.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.api_key_token import ApiKeyToken +globals()['ApiKeyToken'] = ApiKeyToken +from onesignal.model.api_key_tokens_list_response import ApiKeyTokensListResponse + + +class TestApiKeyTokensListResponse(unittest.TestCase): + """ApiKeyTokensListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiKeyTokensListResponse(self): + """Test ApiKeyTokensListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ApiKeyTokensListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_app.py b/test/test_app.py index 655dd28..42fde6d 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_apps.py b/test/test_apps.py index 7162ee5..a784944 100644 --- a/test/test_apps.py +++ b/test/test_apps.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_basic_notification.py b/test/test_basic_notification.py index 7a58801..ac18af3 100644 --- a/test/test_basic_notification.py +++ b/test/test_basic_notification.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -17,6 +17,7 @@ from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout from onesignal.model.button import Button from onesignal.model.filter_expression import FilterExpression +from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_target import NotificationTarget from onesignal.model.web_button import WebButton @@ -24,6 +25,7 @@ globals()['BasicNotificationAllOfAndroidBackgroundLayout'] = BasicNotificationAllOfAndroidBackgroundLayout globals()['Button'] = Button globals()['FilterExpression'] = FilterExpression +globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationTarget'] = NotificationTarget globals()['WebButton'] = WebButton diff --git a/test/test_basic_notification_all_of.py b/test/test_basic_notification_all_of.py index 27d72ed..a769612 100644 --- a/test/test_basic_notification_all_of.py +++ b/test/test_basic_notification_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_basic_notification_all_of_android_background_layout.py b/test/test_basic_notification_all_of_android_background_layout.py index a264850..031e914 100644 --- a/test/test_basic_notification_all_of_android_background_layout.py +++ b/test/test_basic_notification_all_of_android_background_layout.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_button.py b/test/test_button.py index cfc3edf..3bd8e48 100644 --- a/test/test_button.py +++ b/test/test_button.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_copy_template_request.py b/test/test_copy_template_request.py new file mode 100644 index 0000000..8c5dd87 --- /dev/null +++ b/test/test_copy_template_request.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.copy_template_request import CopyTemplateRequest + + +class TestCopyTemplateRequest(unittest.TestCase): + """CopyTemplateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCopyTemplateRequest(self): + """Test CopyTemplateRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CopyTemplateRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_api_key_request.py b/test/test_create_api_key_request.py new file mode 100644 index 0000000..ddc36a3 --- /dev/null +++ b/test/test_create_api_key_request.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.create_api_key_request import CreateApiKeyRequest + + +class TestCreateApiKeyRequest(unittest.TestCase): + """CreateApiKeyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateApiKeyRequest(self): + """Test CreateApiKeyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateApiKeyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_api_key_response.py b/test/test_create_api_key_response.py new file mode 100644 index 0000000..3cda641 --- /dev/null +++ b/test/test_create_api_key_response.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.create_api_key_response import CreateApiKeyResponse + + +class TestCreateApiKeyResponse(unittest.TestCase): + """CreateApiKeyResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateApiKeyResponse(self): + """Test CreateApiKeyResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateApiKeyResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_notification_success_response.py b/test/test_create_notification_success_response.py index 2f67d78..c0e388f 100644 --- a/test/test_create_notification_success_response.py +++ b/test/test_create_notification_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_create_segment_conflict_response.py b/test/test_create_segment_conflict_response.py index c52bda3..f1e918d 100644 --- a/test/test_create_segment_conflict_response.py +++ b/test/test_create_segment_conflict_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_create_segment_success_response.py b/test/test_create_segment_success_response.py index 2ddf19d..594a2ad 100644 --- a/test/test_create_segment_success_response.py +++ b/test/test_create_segment_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_create_template_request.py b/test/test_create_template_request.py new file mode 100644 index 0000000..929955f --- /dev/null +++ b/test/test_create_template_request.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.language_string_map import LanguageStringMap +globals()['LanguageStringMap'] = LanguageStringMap +from onesignal.model.create_template_request import CreateTemplateRequest + + +class TestCreateTemplateRequest(unittest.TestCase): + """CreateTemplateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateTemplateRequest(self): + """Test CreateTemplateRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateTemplateRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_user_conflict_response.py b/test/test_create_user_conflict_response.py index 1a5f73f..d5b3830 100644 --- a/test/test_create_user_conflict_response.py +++ b/test/test_create_user_conflict_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_create_user_conflict_response_errors_inner.py b/test/test_create_user_conflict_response_errors_inner.py index 058e1b0..fb17c1d 100644 --- a/test/test_create_user_conflict_response_errors_inner.py +++ b/test/test_create_user_conflict_response_errors_inner.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_create_user_conflict_response_errors_items_meta.py b/test/test_create_user_conflict_response_errors_items_meta.py index 467f5af..1779a76 100644 --- a/test/test_create_user_conflict_response_errors_items_meta.py +++ b/test/test_create_user_conflict_response_errors_items_meta.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_custom_event.py b/test/test_custom_event.py new file mode 100644 index 0000000..577cc92 --- /dev/null +++ b/test/test_custom_event.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.custom_event import CustomEvent + + +class TestCustomEvent(unittest.TestCase): + """CustomEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEvent(self): + """Test CustomEvent""" + # FIXME: construct object with mandatory attributes with example values + # model = CustomEvent() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_custom_events_request.py b/test/test_custom_events_request.py new file mode 100644 index 0000000..6e69238 --- /dev/null +++ b/test/test_custom_events_request.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.custom_event import CustomEvent +globals()['CustomEvent'] = CustomEvent +from onesignal.model.custom_events_request import CustomEventsRequest + + +class TestCustomEventsRequest(unittest.TestCase): + """CustomEventsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEventsRequest(self): + """Test CustomEventsRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CustomEventsRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_default_api.py b/test/test_default_api.py index ce86c39..9a384a1 100644 --- a/test/test_default_api.py +++ b/test/test_default_api.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -31,6 +31,13 @@ def test_cancel_notification(self): """ pass + def test_copy_template_to_app(self): + """Test case for copy_template_to_app + + Copy template to another app # noqa: E501 + """ + pass + def test_create_alias(self): """Test case for create_alias @@ -43,6 +50,13 @@ def test_create_alias_by_subscription(self): """ pass + def test_create_api_key(self): + """Test case for create_api_key + + Create API key # noqa: E501 + """ + pass + def test_create_app(self): """Test case for create_app @@ -50,6 +64,13 @@ def test_create_app(self): """ pass + def test_create_custom_events(self): + """Test case for create_custom_events + + Create custom events # noqa: E501 + """ + pass + def test_create_notification(self): """Test case for create_notification @@ -70,6 +91,13 @@ def test_create_subscription(self): """ pass + def test_create_template(self): + """Test case for create_template + + Create template # noqa: E501 + """ + pass + def test_create_user(self): """Test case for create_user @@ -82,6 +110,13 @@ def test_delete_alias(self): """ pass + def test_delete_api_key(self): + """Test case for delete_api_key + + Delete API key # noqa: E501 + """ + pass + def test_delete_segment(self): """Test case for delete_segment @@ -95,6 +130,13 @@ def test_delete_subscription(self): """ pass + def test_delete_template(self): + """Test case for delete_template + + Delete template # noqa: E501 + """ + pass + def test_delete_user(self): """Test case for delete_user @@ -182,6 +224,20 @@ def test_get_user(self): """ pass + def test_rotate_api_key(self): + """Test case for rotate_api_key + + Rotate API key # noqa: E501 + """ + pass + + def test_start_live_activity(self): + """Test case for start_live_activity + + Start Live Activity # noqa: E501 + """ + pass + def test_transfer_subscription(self): """Test case for transfer_subscription @@ -195,6 +251,13 @@ def test_unsubscribe_email_with_token(self): """ pass + def test_update_api_key(self): + """Test case for update_api_key + + Update API key # noqa: E501 + """ + pass + def test_update_app(self): """Test case for update_app @@ -215,12 +278,47 @@ def test_update_subscription(self): """ pass + def test_update_subscription_by_token(self): + """Test case for update_subscription_by_token + + Update subscription by token # noqa: E501 + """ + pass + + def test_update_template(self): + """Test case for update_template + + Update template # noqa: E501 + """ + pass + def test_update_user(self): """Test case for update_user """ pass + def test_view_api_keys(self): + """Test case for view_api_keys + + View API keys # noqa: E501 + """ + pass + + def test_view_template(self): + """Test case for view_template + + View template # noqa: E501 + """ + pass + + def test_view_templates(self): + """Test case for view_templates + + View templates # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/test/test_delivery_data.py b/test/test_delivery_data.py index 5d238a2..ef52c71 100644 --- a/test/test_delivery_data.py +++ b/test/test_delivery_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_export_events_success_response.py b/test/test_export_events_success_response.py index 3de1e28..34b52ef 100644 --- a/test/test_export_events_success_response.py +++ b/test/test_export_events_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_export_subscriptions_request_body.py b/test/test_export_subscriptions_request_body.py index a39e95d..723d476 100644 --- a/test/test_export_subscriptions_request_body.py +++ b/test/test_export_subscriptions_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_export_subscriptions_success_response.py b/test/test_export_subscriptions_success_response.py index bfa1f30..95144b5 100644 --- a/test/test_export_subscriptions_success_response.py +++ b/test/test_export_subscriptions_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_filter.py b/test/test_filter.py index 216655a..2f89dba 100644 --- a/test/test_filter.py +++ b/test/test_filter.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_filter_expression.py b/test/test_filter_expression.py index af083ab..0b64148 100644 --- a/test/test_filter_expression.py +++ b/test/test_filter_expression.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_generic_error.py b/test/test_generic_error.py index 8c1cd38..73732ce 100644 --- a/test/test_generic_error.py +++ b/test/test_generic_error.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_generic_success_bool_response.py b/test/test_generic_success_bool_response.py index 1272a36..714beba 100644 --- a/test/test_generic_success_bool_response.py +++ b/test/test_generic_success_bool_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_get_notification_history_request_body.py b/test/test_get_notification_history_request_body.py index 2a4de02..8617d71 100644 --- a/test/test_get_notification_history_request_body.py +++ b/test/test_get_notification_history_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_get_segments_success_response.py b/test/test_get_segments_success_response.py index 0b7cc5d..18b4dd9 100644 --- a/test/test_get_segments_success_response.py +++ b/test/test_get_segments_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_identity_object.py b/test/test_identity_object.py index 364c52f..9141cc4 100644 --- a/test/test_identity_object.py +++ b/test/test_identity_object.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_include_aliases.py b/test/test_include_aliases.py new file mode 100644 index 0000000..e5b38df --- /dev/null +++ b/test/test_include_aliases.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.include_aliases import IncludeAliases + + +class TestIncludeAliases(unittest.TestCase): + """IncludeAliases unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIncludeAliases(self): + """Test IncludeAliases""" + # FIXME: construct object with mandatory attributes with example values + # model = IncludeAliases() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_language_string_map.py b/test/test_language_string_map.py index 2671b97..611b119 100644 --- a/test/test_language_string_map.py +++ b/test/test_language_string_map.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_notification.py b/test/test_notification.py index 2ff1185..095aba2 100644 --- a/test/test_notification.py +++ b/test/test_notification.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -17,6 +17,7 @@ from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout from onesignal.model.button import Button from onesignal.model.filter_expression import FilterExpression +from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_all_of import NotificationAllOf from onesignal.model.web_button import WebButton @@ -24,6 +25,7 @@ globals()['BasicNotificationAllOfAndroidBackgroundLayout'] = BasicNotificationAllOfAndroidBackgroundLayout globals()['Button'] = Button globals()['FilterExpression'] = FilterExpression +globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationAllOf'] = NotificationAllOf globals()['WebButton'] = WebButton diff --git a/test/test_notification_all_of.py b/test/test_notification_all_of.py index 332d59f..0e6f744 100644 --- a/test/test_notification_all_of.py +++ b/test/test_notification_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_notification_history_success_response.py b/test/test_notification_history_success_response.py index a95efbc..e22a001 100644 --- a/test/test_notification_history_success_response.py +++ b/test/test_notification_history_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_notification_slice.py b/test/test_notification_slice.py index 4ba7872..75cdd78 100644 --- a/test/test_notification_slice.py +++ b/test/test_notification_slice.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_notification_target.py b/test/test_notification_target.py index 2dbeebc..4a58875 100644 --- a/test/test_notification_target.py +++ b/test/test_notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -13,8 +13,10 @@ import unittest import onesignal +from onesignal.model.include_aliases import IncludeAliases from onesignal.model.segment_notification_target import SegmentNotificationTarget from onesignal.model.subscription_notification_target import SubscriptionNotificationTarget +globals()['IncludeAliases'] = IncludeAliases globals()['SegmentNotificationTarget'] = SegmentNotificationTarget globals()['SubscriptionNotificationTarget'] = SubscriptionNotificationTarget from onesignal.model.notification_target import NotificationTarget diff --git a/test/test_notification_with_meta.py b/test/test_notification_with_meta.py index 53119d4..ccd1be8 100644 --- a/test/test_notification_with_meta.py +++ b/test/test_notification_with_meta.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -18,6 +18,7 @@ from onesignal.model.button import Button from onesignal.model.delivery_data import DeliveryData from onesignal.model.filter_expression import FilterExpression +from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.notification_with_meta_all_of import NotificationWithMetaAllOf from onesignal.model.outcome_data import OutcomeData @@ -29,6 +30,7 @@ globals()['Button'] = Button globals()['DeliveryData'] = DeliveryData globals()['FilterExpression'] = FilterExpression +globals()['IncludeAliases'] = IncludeAliases globals()['LanguageStringMap'] = LanguageStringMap globals()['NotificationWithMetaAllOf'] = NotificationWithMetaAllOf globals()['OutcomeData'] = OutcomeData diff --git a/test/test_notification_with_meta_all_of.py b/test/test_notification_with_meta_all_of.py index 6b5a42a..c5a36ad 100644 --- a/test/test_notification_with_meta_all_of.py +++ b/test/test_notification_with_meta_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_operator.py b/test/test_operator.py index cb6d3c5..f5b710c 100644 --- a/test/test_operator.py +++ b/test/test_operator.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_outcome_data.py b/test/test_outcome_data.py index 1483b44..fe43567 100644 --- a/test/test_outcome_data.py +++ b/test/test_outcome_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_outcomes_data.py b/test/test_outcomes_data.py index 8c8daad..a93187e 100644 --- a/test/test_outcomes_data.py +++ b/test/test_outcomes_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_platform_delivery_data.py b/test/test_platform_delivery_data.py index 4181bd3..fc6d357 100644 --- a/test/test_platform_delivery_data.py +++ b/test/test_platform_delivery_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_platform_delivery_data_email_all_of.py b/test/test_platform_delivery_data_email_all_of.py index 01e58b7..bc3321e 100644 --- a/test/test_platform_delivery_data_email_all_of.py +++ b/test/test_platform_delivery_data_email_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_platform_delivery_data_sms_all_of.py b/test/test_platform_delivery_data_sms_all_of.py index b453d1e..417c2d2 100644 --- a/test/test_platform_delivery_data_sms_all_of.py +++ b/test/test_platform_delivery_data_sms_all_of.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_properties_body.py b/test/test_properties_body.py index d191a40..6a2c356 100644 --- a/test/test_properties_body.py +++ b/test/test_properties_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_properties_deltas.py b/test/test_properties_deltas.py index 22f296f..7fc3272 100644 --- a/test/test_properties_deltas.py +++ b/test/test_properties_deltas.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_properties_object.py b/test/test_properties_object.py index a5313ce..b36e6bb 100644 --- a/test/test_properties_object.py +++ b/test/test_properties_object.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_purchase.py b/test/test_purchase.py index 61f29b5..fdcab94 100644 --- a/test/test_purchase.py +++ b/test/test_purchase.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_rate_limit_error.py b/test/test_rate_limit_error.py index f1c8253..655872a 100644 --- a/test/test_rate_limit_error.py +++ b/test/test_rate_limit_error.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_segment.py b/test/test_segment.py index c81f280..f2e6e7d 100644 --- a/test/test_segment.py +++ b/test/test_segment.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_segment_data.py b/test/test_segment_data.py index 7093dfe..09d45e4 100644 --- a/test/test_segment_data.py +++ b/test/test_segment_data.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_segment_notification_target.py b/test/test_segment_notification_target.py index 94ab7b7..73d365f 100644 --- a/test/test_segment_notification_target.py +++ b/test/test_segment_notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_start_live_activity_request.py b/test/test_start_live_activity_request.py new file mode 100644 index 0000000..4c769a6 --- /dev/null +++ b/test/test_start_live_activity_request.py @@ -0,0 +1,42 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.filter_expression import FilterExpression +from onesignal.model.include_aliases import IncludeAliases +from onesignal.model.language_string_map import LanguageStringMap +globals()['FilterExpression'] = FilterExpression +globals()['IncludeAliases'] = IncludeAliases +globals()['LanguageStringMap'] = LanguageStringMap +from onesignal.model.start_live_activity_request import StartLiveActivityRequest + + +class TestStartLiveActivityRequest(unittest.TestCase): + """StartLiveActivityRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStartLiveActivityRequest(self): + """Test StartLiveActivityRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = StartLiveActivityRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_start_live_activity_success_response.py b/test/test_start_live_activity_success_response.py new file mode 100644 index 0000000..7ecd771 --- /dev/null +++ b/test/test_start_live_activity_success_response.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.start_live_activity_success_response import StartLiveActivitySuccessResponse + + +class TestStartLiveActivitySuccessResponse(unittest.TestCase): + """StartLiveActivitySuccessResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStartLiveActivitySuccessResponse(self): + """Test StartLiveActivitySuccessResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = StartLiveActivitySuccessResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_subscription.py b/test/test_subscription.py index 8d12017..a3311f9 100644 --- a/test/test_subscription.py +++ b/test/test_subscription.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_subscription_body.py b/test/test_subscription_body.py index 51e296b..2b34143 100644 --- a/test/test_subscription_body.py +++ b/test/test_subscription_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_subscription_notification_target.py b/test/test_subscription_notification_target.py index ab553ca..1eaf206 100644 --- a/test/test_subscription_notification_target.py +++ b/test/test_subscription_notification_target.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ @@ -13,6 +13,8 @@ import unittest import onesignal +from onesignal.model.include_aliases import IncludeAliases +globals()['IncludeAliases'] = IncludeAliases from onesignal.model.subscription_notification_target import SubscriptionNotificationTarget diff --git a/test/test_template_resource.py b/test/test_template_resource.py new file mode 100644 index 0000000..72b1e2d --- /dev/null +++ b/test/test_template_resource.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.template_resource import TemplateResource + + +class TestTemplateResource(unittest.TestCase): + """TemplateResource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTemplateResource(self): + """Test TemplateResource""" + # FIXME: construct object with mandatory attributes with example values + # model = TemplateResource() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_templates_list_response.py b/test/test_templates_list_response.py new file mode 100644 index 0000000..8b753d8 --- /dev/null +++ b/test/test_templates_list_response.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.template_resource import TemplateResource +globals()['TemplateResource'] = TemplateResource +from onesignal.model.templates_list_response import TemplatesListResponse + + +class TestTemplatesListResponse(unittest.TestCase): + """TemplatesListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTemplatesListResponse(self): + """Test TemplatesListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = TemplatesListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transfer_subscription_request_body.py b/test/test_transfer_subscription_request_body.py index ea5b250..05b2c4d 100644 --- a/test/test_transfer_subscription_request_body.py +++ b/test/test_transfer_subscription_request_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_update_api_key_request.py b/test/test_update_api_key_request.py new file mode 100644 index 0000000..bf451b9 --- /dev/null +++ b/test/test_update_api_key_request.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.update_api_key_request import UpdateApiKeyRequest + + +class TestUpdateApiKeyRequest(unittest.TestCase): + """UpdateApiKeyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateApiKeyRequest(self): + """Test UpdateApiKeyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateApiKeyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_live_activity_request.py b/test/test_update_live_activity_request.py index 85ef905..f892530 100644 --- a/test/test_update_live_activity_request.py +++ b/test/test_update_live_activity_request.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_update_live_activity_success_response.py b/test/test_update_live_activity_success_response.py index b083b3f..12b0c85 100644 --- a/test/test_update_live_activity_success_response.py +++ b/test/test_update_live_activity_success_response.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_update_template_request.py b/test/test_update_template_request.py new file mode 100644 index 0000000..1d182c2 --- /dev/null +++ b/test/test_update_template_request.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.3.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.language_string_map import LanguageStringMap +globals()['LanguageStringMap'] = LanguageStringMap +from onesignal.model.update_template_request import UpdateTemplateRequest + + +class TestUpdateTemplateRequest(unittest.TestCase): + """UpdateTemplateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateTemplateRequest(self): + """Test UpdateTemplateRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateTemplateRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_user_request.py b/test/test_update_user_request.py index 0f4581a..9758525 100644 --- a/test/test_update_user_request.py +++ b/test/test_update_user_request.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_user.py b/test/test_user.py index 2fc87ca..093d21c 100644 --- a/test/test_user.py +++ b/test/test_user.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_user_identity_body.py b/test/test_user_identity_body.py index ad0ba75..31c8472 100644 --- a/test/test_user_identity_body.py +++ b/test/test_user_identity_body.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """ diff --git a/test/test_web_button.py b/test/test_web_button.py index f09d291..291401f 100644 --- a/test/test_web_button.py +++ b/test/test_web_button.py @@ -3,7 +3,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 - The version of the OpenAPI document: 5.2.1 + The version of the OpenAPI document: 5.3.0 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech """