diff --git a/README.md b/README.md index 69a1617..1834197 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com -- API version: 5.11.2 -- Package version: 5.11.3 +- API version: 5.12.0 +- Package version: 5.12.0 ## Requirements diff --git a/docs/CreateJourneyRequest.md b/docs/CreateJourneyRequest.md new file mode 100644 index 0000000..7d16a0d --- /dev/null +++ b/docs/CreateJourneyRequest.md @@ -0,0 +1,19 @@ +# CreateJourneyRequest + +Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Journey name, up to 300 characters. | +**description** | **str, none_type** | Optional journey description, up to 1024 characters. | [optional] +**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] +**early_exit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] +**reentry_rules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] +**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] +**nodes** | [**[JourneyNode]**](JourneyNode.md) | Ordered list of journey nodes. Server-assigned id fields are rejected on create. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 055a57e..88d7a6c 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**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}/custom_events | Create custom events +[**create_journey**](DefaultApi.md#create_journey) | **POST** /apps/{app_id}/journeys | Create journey [**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 | @@ -18,6 +19,7 @@ Method | HTTP request | Description [**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_journey**](DefaultApi.md#delete_journey) | **DELETE** /apps/{app_id}/journeys/{journey_id} | Delete journey [**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 @@ -42,6 +44,8 @@ Method | HTTP request | Description [**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_journey**](DefaultApi.md#update_journey) | **PATCH** /apps/{app_id}/journeys/{journey_id} | Update journey +[**update_journey_node**](DefaultApi.md#update_journey_node) | **PATCH** /apps/{app_id}/journeys/{journey_id}/nodes/{node_id} | Update journey node [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push [**update_segment**](DefaultApi.md#update_segment) | **PATCH** /apps/{app_id}/segments/{segment_id} | Update Segment [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | @@ -49,6 +53,9 @@ Method | HTTP request | Description [**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_journey**](DefaultApi.md#view_journey) | **GET** /apps/{app_id}/journeys/{journey_id} | View journey +[**view_journey_stats**](DefaultApi.md#view_journey_stats) | **GET** /apps/{app_id}/journeys/{journey_id}/stats | View journey stats +[**view_journeys**](DefaultApi.md#view_journeys) | **GET** /apps/{app_id}/journeys | View journeys [**view_template**](DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template [**view_templates**](DefaultApi.md#view_templates) | **GET** /templates | View templates @@ -678,6 +685,196 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) +# **create_journey** +> Journey create_journey(app_id, create_journey_request) + +Create journey + +The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + create_journey_request = CreateJourneyRequest( + name="name_example", + description="description_example", + audience=JourneyAudience( + kind="segment", + included_segment_ids=[ + "included_segment_ids_example", + ], + excluded_segment_ids=[ + "excluded_segment_ids_example", + ], + future_additions_only=True, + name="name_example", + attributes=JourneyEventTriggerAttributes([ + [ + JourneyEventAttribute( + key="key_example", + operator="equal", + value="value_example", + ), + ], + ]), + ), + early_exit=JourneyEarlyExit( + rules=JourneyEarlyExitRules( + on_segment=JourneyEarlyExitRulesOnSegment( + included_segment_ids=[ + "included_segment_ids_example", + ], + ), + when_not_in_audience=True, + on_session=True, + on_event=JourneyEarlyExitRulesOnEvent( + name="name_example", + ), + ), + tag_on_early_exit={ + "key": "key_example", + }, + ), + reentry_rules=JourneyReentryRules( + duration_seconds=600, + ), + schedule=JourneySchedule( + start_at="start_at_example", + stop_at="stop_at_example", + error="error_example", + ), + nodes=[ + JourneyNode( + id="id_example", + kind="wait", + client_node_id="client_node_id_example", + annotation="annotation_example", + duration_seconds=60, + relative_to="schedule_in_timezone", + windows=[ + JourneyTimeWindow( + start=None, + end=None, + day_of_week=1, + ), + ], + time_zone="time_zone_example", + use_user_time_zone=True, + template_id="template_id_example", + iam_id="iam_id_example", + user_ttl_seconds=1, + webhook_id="webhook_id_example", + assignments={ + "key": "key_example", + }, + randomize_on_entry=True, + branches=[ + JourneyBranch( + id="id_example", + condition=JourneyCondition( + kind="segment_membership", + included_segment_ids=[ + "included_segment_ids_example", + ], + excluded_segment_ids=[ + "excluded_segment_ids_example", + ], + action="received", + sending_node_id="sending_node_id_example", + client_node_id="client_node_id_example", + name="name_example", + attributes=JourneyEventTriggerAttributes([ + [ + JourneyEventAttribute( + key="key_example", + operator="equal", + value="value_example", + ), + ], + ]), + entry_event_match_attributes=[ + {}, + ], + ), + weight=3.14, + nodes=[ + JourneyNode(), + ], + ), + ], + expiration=JourneyWaitUntilExpiration( + duration_seconds=60, + exits=True, + ), + ), + ], + ) + + try: + # Create journey + api_response = api_instance.create_journey(app_id, create_journey_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->create_journey: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **create_journey_request** | [**CreateJourneyRequest**](CreateJourneyRequest.md)| | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + # **create_notification** > CreateNotificationSuccessResponse create_notification(notification) @@ -1525,6 +1722,83 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) +# **delete_journey** +> GenericSuccessBoolResponse delete_journey(app_id, journey_id) + +Delete journey + +The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey to delete. + + try: + # Delete journey + api_response = api_instance.delete_journey(app_id, journey_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->delete_journey: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **journey_id** | **str**| UUID of the journey to delete. | + +### Return type + +[**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + # **delete_segment** > GenericSuccessBoolResponse delete_segment(app_id, segment_id) @@ -3580,12 +3854,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) -# **update_live_activity** -> UpdateLiveActivitySuccessResponse update_live_activity(app_id, activity_id, update_live_activity_request) +# **update_journey** +> Journey update_journey(app_id, journey_id, update_journey_request) -Update a Live Activity via Push +Update journey -Updates a specified live activity. +The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. ### Example @@ -3610,104 +3884,475 @@ configuration = onesignal.Configuration( with onesignal.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) - app_id = "YOUR_APP_ID" # The OneSignal App ID for your app. Available in Keys & IDs. - activity_id = "12345" # Live Activity record ID - update_live_activity_request = UpdateLiveActivityRequest( + app_id = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey to update. + update_journey_request = UpdateJourneyRequest( 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", + description="description_example", + audience=JourneyAudience( + kind="segment", + included_segment_ids=[ + "included_segment_ids_example", + ], + excluded_segment_ids=[ + "excluded_segment_ids_example", + ], + future_additions_only=True, + name="name_example", + attributes=JourneyEventTriggerAttributes([ + [ + JourneyEventAttribute( + key="key_example", + operator="equal", + value="value_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", + early_exit=JourneyEarlyExit( + rules=JourneyEarlyExitRules( + on_segment=JourneyEarlyExitRulesOnSegment( + included_segment_ids=[ + "included_segment_ids_example", + ], + ), + when_not_in_audience=True, + on_session=True, + on_event=JourneyEarlyExitRulesOnEvent( + name="name_example", + ), + ), + tag_on_early_exit={ + "key": "key_example", + }, ), - sound="sound_example", - stale_date=1, + reentry_rules=JourneyReentryRules( + duration_seconds=600, + ), + schedule=JourneySchedule( + start_at="start_at_example", + stop_at="stop_at_example", + error="error_example", + ), + nodes=[ + JourneyNode( + id="id_example", + kind="wait", + client_node_id="client_node_id_example", + annotation="annotation_example", + duration_seconds=60, + relative_to="schedule_in_timezone", + windows=[ + JourneyTimeWindow( + start=None, + end=None, + day_of_week=1, + ), + ], + time_zone="time_zone_example", + use_user_time_zone=True, + template_id="template_id_example", + iam_id="iam_id_example", + user_ttl_seconds=1, + webhook_id="webhook_id_example", + assignments={ + "key": "key_example", + }, + randomize_on_entry=True, + branches=[ + JourneyBranch( + id="id_example", + condition=JourneyCondition( + kind="segment_membership", + included_segment_ids=[ + "included_segment_ids_example", + ], + excluded_segment_ids=[ + "excluded_segment_ids_example", + ], + action="received", + sending_node_id="sending_node_id_example", + client_node_id="client_node_id_example", + name="name_example", + attributes=JourneyEventTriggerAttributes([ + [ + JourneyEventAttribute( + key="key_example", + operator="equal", + value="value_example", + ), + ], + ]), + entry_event_match_attributes=[ + {}, + ], + ), + weight=3.14, + nodes=[ + JourneyNode(), + ], + ), + ], + expiration=JourneyWaitUntilExpiration( + duration_seconds=60, + exits=True, + ), + ), + ], + state="draft", + concurrency_key="concurrency_key_example", + ) + + try: + # Update journey + api_response = api_instance.update_journey(app_id, journey_id, update_journey_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_journey: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **journey_id** | **str**| UUID of the journey to update. | + **update_journey_request** | [**UpdateJourneyRequest**](UpdateJourneyRequest.md)| | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + +# **update_journey_node** +> Journey update_journey_node(app_id, journey_id, node_id, update_journey_node_request) + +Update journey node + +The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey that owns the node. + node_id = "YOUR_NODE_ID" # Server-assigned UUID of the node to update, from a prior View journey fetch. + update_journey_node_request = UpdateJourneyNodeRequest( + client_node_id="client_node_id_example", + annotation="annotation_example", + duration_seconds=60, + relative_to="schedule_in_timezone", + windows=[ + JourneyTimeWindow( + start=None, + end=None, + day_of_week=1, + ), + ], + time_zone="time_zone_example", + use_user_time_zone=True, + template_id="template_id_example", + iam_id="iam_id_example", + user_ttl_seconds=1, + webhook_id="webhook_id_example", + assignments={ + "key": "key_example", + }, + randomize_on_entry=True, + branches=[ + JourneyBranch( + id="id_example", + condition=JourneyCondition( + kind="segment_membership", + included_segment_ids=[ + "included_segment_ids_example", + ], + excluded_segment_ids=[ + "excluded_segment_ids_example", + ], + action="received", + sending_node_id="sending_node_id_example", + client_node_id="client_node_id_example", + name="name_example", + attributes=JourneyEventTriggerAttributes([ + [ + JourneyEventAttribute( + key="key_example", + operator="equal", + value="value_example", + ), + ], + ]), + entry_event_match_attributes=[ + {}, + ], + ), + weight=3.14, + nodes=[ + JourneyNode( + id="id_example", + kind="wait", + client_node_id="client_node_id_example", + annotation="annotation_example", + duration_seconds=60, + relative_to="schedule_in_timezone", + windows=[ + JourneyTimeWindow( + start=None, + end=None, + day_of_week=1, + ), + ], + time_zone="time_zone_example", + use_user_time_zone=True, + template_id="template_id_example", + iam_id="iam_id_example", + user_ttl_seconds=1, + webhook_id="webhook_id_example", + assignments={ + "key": "key_example", + }, + randomize_on_entry=True, + branches=[], + expiration=JourneyWaitUntilExpiration( + duration_seconds=60, + exits=True, + ), + ), + ], + ), + ], + expiration=JourneyWaitUntilExpiration( + duration_seconds=60, + exits=True, + ), + concurrency_key="concurrency_key_example", + ) + + try: + # Update journey node + api_response = api_instance.update_journey_node(app_id, journey_id, node_id, update_journey_node_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_journey_node: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **journey_id** | **str**| UUID of the journey that owns the node. | + **node_id** | **str**| Server-assigned UUID of the node to update, from a prior View journey fetch. | + **update_journey_node_request** | [**UpdateJourneyNodeRequest**](UpdateJourneyNodeRequest.md)| | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**422** | Unprocessable Entity | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + +# **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.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # The OneSignal App ID for your app. Available in Keys & IDs. + activity_id = "12345" # 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, ) @@ -4458,6 +5103,237 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) +# **view_journey** +> Journey view_journey(app_id, journey_id) + +View journey + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey to retrieve. + + try: + # View journey + api_response = api_instance.view_journey(app_id, journey_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_journey: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **journey_id** | **str**| UUID of the journey to retrieve. | + +### Return type + +[**Journey**](Journey.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**404** | Not Found | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + +# **view_journey_stats** +> JourneyStats view_journey_stats(app_id, journey_id) + +View journey stats + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey to retrieve stats for. + + try: + # View journey stats + api_response = api_instance.view_journey_stats(app_id, journey_id) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_journey_stats: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **journey_id** | **str**| UUID of the journey to retrieve stats for. | + +### Return type + +[**JourneyStats**](JourneyStats.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**404** | Not Found | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + +# **view_journeys** +> JourneyListResponse view_journeys(app_id) + +View journeys + +The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. + +### Example + +* Bearer Authentication (rest_api_key): + +```python +import onesignal +from onesignal.api import default_api +from onesignal.models import * +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +# Some of the OneSignal endpoints require ORGANIZATION_API_KEY token for authorization, while others require REST_API_KEY. +# We recommend adding both of them in the configuration page so that you will not need to figure it out yourself. +configuration = onesignal.Configuration( + rest_api_key = "YOUR_REST_API_KEY", # App REST API key required for most endpoints + organization_api_key = "YOUR_ORGANIZATION_API_KEY" # Organization key is only required for creating new apps and other top-level endpoints +) + + +# 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 = "YOUR_APP_ID" # Your OneSignal App ID in UUID v4 format. + cursor = "cursor_example" # Opaque pagination token from a previous response's next_cursor. Omit for the first page. (optional) + limit = 50 # Maximum journeys to return per page. Minimum 1, maximum 50. (optional) + + try: + # View journeys + api_response = api_instance.view_journeys(app_id, cursor=cursor, limit=limit) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->view_journeys: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **str**| Your OneSignal App ID in UUID v4 format. | + **cursor** | **str**| Opaque pagination token from a previous response's next_cursor. Omit for the first page. | [optional] + **limit** | **int**| Maximum journeys to return per page. Minimum 1, maximum 50. | [optional] if omitted the server will use the default value of 50 + +### Return type + +[**JourneyListResponse**](JourneyListResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-python-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**429** | Rate Limit Exceeded | - | +**0** | Unexpected error | - | + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + # **view_template** > TemplateResource view_template(template_id, app_id) diff --git a/docs/Journey.md b/docs/Journey.md new file mode 100644 index 0000000..49116bf --- /dev/null +++ b/docs/Journey.md @@ -0,0 +1,28 @@ +# Journey + +Full journey representation returned by the detail, create, and update endpoints. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Journey UUID. Read-only. | [optional] +**app_id** | **str** | UUID of the app the journey belongs to. Read-only. | [optional] +**name** | **str** | Journey name, up to 300 characters. | [optional] +**description** | **str, none_type** | Journey description, up to 1024 characters. Defaults to an empty string. | [optional] +**state** | **str** | Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. | [optional] +**created_at** | **str** | ISO 8601 creation time. Read-only. | [optional] +**updated_at** | **str** | ISO 8601 last-update time. Read-only. | [optional] +**started_at** | **str, none_type** | ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing. | [optional] +**archived_at** | **str, none_type** | ISO 8601 time the journey was archived, or null. Read-only. | [optional] +**created_source** | **str, none_type** | Origin of the journey, for example public_api or dashboard. Read-only. | [optional] +**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] +**early_exit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] +**reentry_rules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] +**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] +**nodes** | [**[JourneyNode]**](JourneyNode.md) | Ordered list of journey nodes. | [optional] +**concurrency_key** | **str** | Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyAudience.md b/docs/JourneyAudience.md new file mode 100644 index 0000000..41cb4f1 --- /dev/null +++ b/docs/JourneyAudience.md @@ -0,0 +1,18 @@ +# JourneyAudience + +The journey entry audience. The kind field selects which other fields apply. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Audience kind. Selects which other fields apply. | +**included_segment_ids** | **[str]** | segment audiences: Segment UUIDs whose users enter the journey. | [optional] +**excluded_segment_ids** | **[str]** | segment audiences: Segment UUIDs whose users are excluded. | [optional] +**future_additions_only** | **bool, none_type** | segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false. | [optional] +**name** | **str** | event_trigger audiences: event name that triggers entry, up to 255 characters. | [optional] +**attributes** | [**JourneyEventTriggerAttributes**](JourneyEventTriggerAttributes.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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyBranch.md b/docs/JourneyBranch.md new file mode 100644 index 0000000..45085f5 --- /dev/null +++ b/docs/JourneyBranch.md @@ -0,0 +1,15 @@ +# JourneyBranch + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch. | [optional] +**condition** | [**JourneyCondition**](JourneyCondition.md) | | [optional] +**weight** | **float** | Branch weight for split_range nodes. Weights across a node's branches must sum to 100. | [optional] +**nodes** | [**[JourneyNode]**](JourneyNode.md) | Nodes run when this branch is taken, before flow converges to the next sibling node. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyBranchStats.md b/docs/JourneyBranchStats.md new file mode 100644 index 0000000..84fd0bb --- /dev/null +++ b/docs/JourneyBranchStats.md @@ -0,0 +1,13 @@ +# JourneyBranchStats + +Stats for a single branch of a branching node. Keyed in the response by the branch's server-assigned id. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed** | **int** | Users who took this branch. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyCondition.md b/docs/JourneyCondition.md new file mode 100644 index 0000000..15ec192 --- /dev/null +++ b/docs/JourneyCondition.md @@ -0,0 +1,21 @@ +# JourneyCondition + +A branch condition. The kind field selects which other fields apply. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Condition kind. Selects which other fields apply. | +**included_segment_ids** | **[str]** | segment_membership conditions: Segment UUIDs the user must belong to. | [optional] +**excluded_segment_ids** | **[str]** | segment_membership conditions: Segment UUIDs the user must not belong to. | [optional] +**action** | **str** | on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel. | [optional] +**sending_node_id** | **str** | on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write. | [optional] +**client_node_id** | **str** | on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id. | [optional] +**name** | **str** | event_trigger conditions: event name, up to 255 characters. | [optional] +**attributes** | [**JourneyEventTriggerAttributes**](JourneyEventTriggerAttributes.md) | | [optional] +**entry_event_match_attributes** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEarlyExit.md b/docs/JourneyEarlyExit.md new file mode 100644 index 0000000..543a300 --- /dev/null +++ b/docs/JourneyEarlyExit.md @@ -0,0 +1,14 @@ +# JourneyEarlyExit + +Conditions that remove a user from the journey before it completes. At least one rule must be set under rules. Send null to remove early exit entirely. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rules** | [**JourneyEarlyExitRules**](JourneyEarlyExitRules.md) | | [optional] +**tag_on_early_exit** | **{str: (str,)}** | Tag key-value pairs applied when a user exits early. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEarlyExitRules.md b/docs/JourneyEarlyExitRules.md new file mode 100644 index 0000000..deab10c --- /dev/null +++ b/docs/JourneyEarlyExitRules.md @@ -0,0 +1,15 @@ +# JourneyEarlyExitRules + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**on_segment** | [**JourneyEarlyExitRulesOnSegment**](JourneyEarlyExitRulesOnSegment.md) | | [optional] +**when_not_in_audience** | **bool, none_type** | Exit when the user no longer matches the journey audience. Defaults to false. | [optional] +**on_session** | **bool, none_type** | Exit on a new session start. Defaults to false. | [optional] +**on_event** | [**JourneyEarlyExitRulesOnEvent**](JourneyEarlyExitRulesOnEvent.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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEarlyExitRulesOnEvent.md b/docs/JourneyEarlyExitRulesOnEvent.md new file mode 100644 index 0000000..e081b43 --- /dev/null +++ b/docs/JourneyEarlyExitRulesOnEvent.md @@ -0,0 +1,12 @@ +# JourneyEarlyExitRulesOnEvent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Exit when this event occurs. Up to 255 characters. | +**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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEarlyExitRulesOnSegment.md b/docs/JourneyEarlyExitRulesOnSegment.md new file mode 100644 index 0000000..66701b2 --- /dev/null +++ b/docs/JourneyEarlyExitRulesOnSegment.md @@ -0,0 +1,12 @@ +# JourneyEarlyExitRulesOnSegment + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**included_segment_ids** | **[str]** | Exit when the user enters any of these segments. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEventAttribute.md b/docs/JourneyEventAttribute.md new file mode 100644 index 0000000..49723ce --- /dev/null +++ b/docs/JourneyEventAttribute.md @@ -0,0 +1,14 @@ +# JourneyEventAttribute + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | Event attribute key. | +**operator** | **str** | Comparison operator. | +**value** | **str** | Value to compare against. Not required for exists and not_exists. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyEventTriggerAttributes.md b/docs/JourneyEventTriggerAttributes.md new file mode 100644 index 0000000..d92f508 --- /dev/null +++ b/docs/JourneyEventTriggerAttributes.md @@ -0,0 +1,12 @@ +# JourneyEventTriggerAttributes + +Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**[[JourneyEventAttribute]]**](JourneyEventAttribute.md) | Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected. | + +[[Back to API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyListAudience.md b/docs/JourneyListAudience.md new file mode 100644 index 0000000..e3fa4f4 --- /dev/null +++ b/docs/JourneyListAudience.md @@ -0,0 +1,13 @@ +# JourneyListAudience + +Entry audience reduced to its kind. Use View journey for the full audience configuration. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Audience kind. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyListItem.md b/docs/JourneyListItem.md new file mode 100644 index 0000000..377e64a --- /dev/null +++ b/docs/JourneyListItem.md @@ -0,0 +1,24 @@ +# JourneyListItem + +Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Journey UUID. Read-only. | [optional] +**app_id** | **str** | UUID of the app the journey belongs to. Read-only. | [optional] +**name** | **str** | Journey name, up to 300 characters. | [optional] +**state** | **str** | Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey. | [optional] +**created_at** | **str** | ISO 8601 creation time. Read-only. | [optional] +**updated_at** | **str** | ISO 8601 last-update time. Read-only. | [optional] +**started_at** | **str, none_type** | ISO 8601 time the journey was activated, or null. Read-only. | [optional] +**archived_at** | **str, none_type** | ISO 8601 time the journey was archived, or null. Read-only. | [optional] +**created_source** | **str, none_type** | Origin of the journey, for example public_api or dashboard. Read-only. | [optional] +**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] +**audience** | [**JourneyListAudience**](JourneyListAudience.md) | | [optional] +**reentry_rules** | [**JourneyReentryRules**](JourneyReentryRules.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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyListResponse.md b/docs/JourneyListResponse.md new file mode 100644 index 0000000..8587411 --- /dev/null +++ b/docs/JourneyListResponse.md @@ -0,0 +1,14 @@ +# JourneyListResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**journeys** | [**[JourneyListItem]**](JourneyListItem.md) | Journeys ordered by creation time, newest first. | [optional] +**has_more** | **bool** | true if more journeys exist beyond this page. | [optional] +**next_cursor** | **str** | Cursor for the next page. Present only when has_more is true. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyMessageStats.md b/docs/JourneyMessageStats.md new file mode 100644 index 0000000..acb50e2 --- /dev/null +++ b/docs/JourneyMessageStats.md @@ -0,0 +1,13 @@ +# JourneyMessageStats + +Delivery stats for a message-sending node. Present only on send_push, send_email, send_sms, send_iam, and send_webhook nodes. The keys inside totals depend on the node's channel. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totals** | **{str: (float,)}** | All-time totals for this node, keyed by channel-specific stat name. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyNode.md b/docs/JourneyNode.md new file mode 100644 index 0000000..dbbb61c --- /dev/null +++ b/docs/JourneyNode.md @@ -0,0 +1,29 @@ +# JourneyNode + +A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Node kind. Selects which other fields apply. | +**id** | **str** | Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error. | [optional] +**client_node_id** | **str** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] +**annotation** | **str** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] +**duration_seconds** | **int, none_type** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] +**relative_to** | **str** | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. | [optional] +**windows** | [**[JourneyTimeWindow]**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] +**time_zone** | **str** | time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. | [optional] +**use_user_time_zone** | **bool, none_type** | time_window nodes: when true, uses the user's timezone if available. | [optional] +**template_id** | **str** | send_push, send_email, and send_sms nodes: UUID of the template to send. | [optional] +**iam_id** | **str** | send_iam nodes: UUID of the in-app message to send. | [optional] +**user_ttl_seconds** | **int, none_type** | send_iam nodes: optional time-to-live for the in-app message, in seconds. | [optional] +**webhook_id** | **str** | send_webhook nodes: UUID of the webhook to send. | [optional] +**assignments** | **{str: (str,)}** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] +**randomize_on_entry** | **bool, none_type** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] +**branches** | [**[JourneyBranch]**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] +**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyNodeStats.md b/docs/JourneyNodeStats.md new file mode 100644 index 0000000..a069d6b --- /dev/null +++ b/docs/JourneyNodeStats.md @@ -0,0 +1,17 @@ +# JourneyNodeStats + +Stats for a single node. Keyed in the response by the node's server-assigned id. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | Node kind, repeated here so stats can be read without joining against the journey definition. | [optional] +**waiting** | **int** | Users currently held at this node. | [optional] +**completed** | **int** | Users who advanced past this node normally. | [optional] +**exited_early** | **int** | Users who left the journey from this node through an early exit rule. | [optional] +**message_stats** | [**JourneyMessageStats**](JourneyMessageStats.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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyReentryRules.md b/docs/JourneyReentryRules.md new file mode 100644 index 0000000..2c0934e --- /dev/null +++ b/docs/JourneyReentryRules.md @@ -0,0 +1,13 @@ +# JourneyReentryRules + +Controls whether and how soon a user can re-enter the journey. null means re-entry is not allowed. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**duration_seconds** | **int, none_type** | Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes). | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneySchedule.md b/docs/JourneySchedule.md new file mode 100644 index 0000000..2a3f9d0 --- /dev/null +++ b/docs/JourneySchedule.md @@ -0,0 +1,15 @@ +# JourneySchedule + +Optional future start and/or stop time. null means no scheduled activation. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_at** | **str, none_type** | ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future. | [optional] +**stop_at** | **str, none_type** | ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at. | [optional] +**error** | **str, none_type** | Read-only. Present when a scheduling error occurred. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyStats.md b/docs/JourneyStats.md new file mode 100644 index 0000000..5936525 --- /dev/null +++ b/docs/JourneyStats.md @@ -0,0 +1,18 @@ +# JourneyStats + +Journey-level counts plus flat, id-keyed maps of node and branch stats. Contains no definition detail; join it by id against the journey from View journey. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | UUID of the journey these stats belong to. | [optional] +**started** | **int** | Users who entered the journey. | [optional] +**completed** | **int** | Users who reached the end of the journey normally. | [optional] +**exited_early** | **int** | Users who left the journey through an early exit rule. | [optional] +**nodes** | [**{str: (JourneyNodeStats,)}**](JourneyNodeStats.md) | Node stats keyed by node id. Includes every node in the graph, at any nesting depth. | [optional] +**branches** | [**{str: (JourneyBranchStats,)}**](JourneyBranchStats.md) | Branch stats keyed by branch id. Empty for a journey with no branching nodes. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyTimePoint.md b/docs/JourneyTimePoint.md new file mode 100644 index 0000000..8430121 --- /dev/null +++ b/docs/JourneyTimePoint.md @@ -0,0 +1,13 @@ +# JourneyTimePoint + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hour** | **int** | Hour of day, 0-23. | [optional] +**minute** | **int** | Minute of hour, 0-59. Defaults to 0. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyTimeWindow.md b/docs/JourneyTimeWindow.md new file mode 100644 index 0000000..d26743b --- /dev/null +++ b/docs/JourneyTimeWindow.md @@ -0,0 +1,15 @@ +# JourneyTimeWindow + +A wall-clock window. Each window must span at least 15 minutes. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **bool, date, datetime, dict, float, int, list, str, none_type** | When the window opens. | [optional] +**end** | **bool, date, datetime, dict, float, int, list, str, none_type** | When the window closes. | [optional] +**day_of_week** | **int** | Day of week, 1 = Monday. Omit to apply the window to every day. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/JourneyWaitUntilExpiration.md b/docs/JourneyWaitUntilExpiration.md new file mode 100644 index 0000000..49aedce --- /dev/null +++ b/docs/JourneyWaitUntilExpiration.md @@ -0,0 +1,14 @@ +# JourneyWaitUntilExpiration + +Optional expiration timer. null waits indefinitely. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**duration_seconds** | **int, none_type** | Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year). | [optional] +**exits** | **bool, none_type** | When true, the user exits the journey when the timer fires; when false, the user continues to convergence. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/UpdateJourneyNodeRequest.md b/docs/UpdateJourneyNodeRequest.md new file mode 100644 index 0000000..53c4784 --- /dev/null +++ b/docs/UpdateJourneyNodeRequest.md @@ -0,0 +1,28 @@ +# UpdateJourneyNodeRequest + +Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_node_id** | **str** | Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads. | [optional] +**annotation** | **str** | Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior. | [optional] +**duration_seconds** | **int, none_type** | wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year). | [optional] +**relative_to** | **str** | time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time. | [optional] +**windows** | [**[JourneyTimeWindow]**](JourneyTimeWindow.md) | time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time. | [optional] +**time_zone** | **str** | time_window nodes: IANA timezone identifier used when the user's timezone is unavailable. | [optional] +**use_user_time_zone** | **bool, none_type** | time_window nodes: when true, uses the user's timezone if available. | [optional] +**template_id** | **str** | send_push, send_email, and send_sms nodes: UUID of the template to send. | [optional] +**iam_id** | **str** | send_iam nodes: UUID of the in-app message to send. | [optional] +**user_ttl_seconds** | **int, none_type** | send_iam nodes: optional time-to-live for the in-app message, in seconds. | [optional] +**webhook_id** | **str** | send_webhook nodes: UUID of the webhook to send. | [optional] +**assignments** | **{str: (str,)}** | tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024. | [optional] +**randomize_on_entry** | **bool, none_type** | split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false. | [optional] +**branches** | [**[JourneyBranch]**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches. | [optional] +**expiration** | [**JourneyWaitUntilExpiration**](JourneyWaitUntilExpiration.md) | | [optional] +**concurrency_key** | **str, none_type** | Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/docs/UpdateJourneyRequest.md b/docs/UpdateJourneyRequest.md new file mode 100644 index 0000000..69d8a27 --- /dev/null +++ b/docs/UpdateJourneyRequest.md @@ -0,0 +1,21 @@ +# UpdateJourneyRequest + +Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Journey name. | [optional] +**description** | **str, none_type** | Journey description. Send null to clear it. | [optional] +**audience** | [**JourneyAudience**](JourneyAudience.md) | | [optional] +**early_exit** | [**JourneyEarlyExit**](JourneyEarlyExit.md) | | [optional] +**reentry_rules** | [**JourneyReentryRules**](JourneyReentryRules.md) | | [optional] +**schedule** | [**JourneySchedule**](JourneySchedule.md) | | [optional] +**nodes** | [**[JourneyNode]**](JourneyNode.md) | Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node. | [optional] +**state** | **str** | Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft. | [optional] +**concurrency_key** | **str, none_type** | Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. | [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 API list]](https://github.com/OneSignal/onesignal-python-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-python-api) + + diff --git a/onesignal/__init__.py b/onesignal/__init__.py index 2156d33..435f0f2 100644 --- a/onesignal/__init__.py +++ b/onesignal/__init__.py @@ -10,7 +10,7 @@ """ -__version__ = "5.11.3" +__version__ = "5.12.0" # import ApiClient from onesignal.api_client import ApiClient diff --git a/onesignal/api/default_api.py b/onesignal/api/default_api.py index 623a6f5..d164134 100644 --- a/onesignal/api/default_api.py +++ b/onesignal/api/default_api.py @@ -27,6 +27,7 @@ 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_journey_request import CreateJourneyRequest 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 @@ -41,6 +42,9 @@ from onesignal.model.get_notification_history_request_body import GetNotificationHistoryRequestBody from onesignal.model.get_segment_success_response import GetSegmentSuccessResponse from onesignal.model.get_segments_success_response import GetSegmentsSuccessResponse +from onesignal.model.journey import Journey +from onesignal.model.journey_list_response import JourneyListResponse +from onesignal.model.journey_stats import JourneyStats from onesignal.model.list_audit_logs_success_response import ListAuditLogsSuccessResponse from onesignal.model.notification import Notification from onesignal.model.notification_history_success_response import NotificationHistorySuccessResponse @@ -57,6 +61,8 @@ 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_journey_node_request import UpdateJourneyNodeRequest +from onesignal.model.update_journey_request import UpdateJourneyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse from onesignal.model.update_segment_request import UpdateSegmentRequest @@ -501,6 +507,64 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_journey_endpoint = _Endpoint( + settings={ + 'response_type': (Journey,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys', + 'operation_id': 'create_journey', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'create_journey_request', + ], + 'required': [ + 'app_id', + 'create_journey_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'create_journey_request': + (CreateJourneyRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + }, + 'location_map': { + 'app_id': 'path', + 'create_journey_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,), @@ -916,6 +980,63 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.delete_journey_endpoint = _Endpoint( + settings={ + 'response_type': (GenericSuccessBoolResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}', + 'operation_id': 'delete_journey', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'journey_id', + ], + 'required': [ + 'app_id', + 'journey_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'journey_id': + (str,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'journey_id': 'journey_id', + }, + 'location_map': { + 'app_id': 'path', + 'journey_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.delete_segment_endpoint = _Endpoint( settings={ 'response_type': (GenericSuccessBoolResponse,), @@ -2453,6 +2574,140 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.update_journey_endpoint = _Endpoint( + settings={ + 'response_type': (Journey,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}', + 'operation_id': 'update_journey', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'journey_id', + 'update_journey_request', + ], + 'required': [ + 'app_id', + 'journey_id', + 'update_journey_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'journey_id': + (str,), + 'update_journey_request': + (UpdateJourneyRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'journey_id': 'journey_id', + }, + 'location_map': { + 'app_id': 'path', + 'journey_id': 'path', + 'update_journey_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_journey_node_endpoint = _Endpoint( + settings={ + 'response_type': (Journey,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}/nodes/{node_id}', + 'operation_id': 'update_journey_node', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'journey_id', + 'node_id', + 'update_journey_node_request', + ], + 'required': [ + 'app_id', + 'journey_id', + 'node_id', + 'update_journey_node_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'journey_id': + (str,), + 'node_id': + (str,), + 'update_journey_node_request': + (UpdateJourneyNodeRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'journey_id': 'journey_id', + 'node_id': 'node_id', + }, + 'location_map': { + 'app_id': 'path', + 'journey_id': 'path', + 'node_id': 'path', + 'update_journey_node_request': '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,), @@ -2899,25 +3154,25 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.view_template_endpoint = _Endpoint( + self.view_journey_endpoint = _Endpoint( settings={ - 'response_type': (TemplateResource,), + 'response_type': (Journey,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/templates/{template_id}', - 'operation_id': 'view_template', + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}', + 'operation_id': 'view_journey', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ - 'template_id', 'app_id', + 'journey_id', ], 'required': [ - 'template_id', 'app_id', + 'journey_id', ], 'nullable': [ ], @@ -2932,18 +3187,18 @@ def __init__(self, api_client=None): 'allowed_values': { }, 'openapi_types': { - 'template_id': - (str,), 'app_id': (str,), + 'journey_id': + (str,), }, 'attribute_map': { - 'template_id': 'template_id', 'app_id': 'app_id', + 'journey_id': 'journey_id', }, 'location_map': { - 'template_id': 'path', - 'app_id': 'query', + 'app_id': 'path', + 'journey_id': 'path', }, 'collection_format_map': { } @@ -2956,31 +3211,29 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.view_templates_endpoint = _Endpoint( + self.view_journey_stats_endpoint = _Endpoint( settings={ - 'response_type': (TemplatesListResponse,), + 'response_type': (JourneyStats,), 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/templates', - 'operation_id': 'view_templates', + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}/stats', + 'operation_id': 'view_journey_stats', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'app_id', - 'limit', - 'offset', - 'channel', + 'journey_id', ], 'required': [ 'app_id', + 'journey_id', ], 'nullable': [ ], 'enum': [ - 'channel', ], 'validation': [ ] @@ -2989,34 +3242,20 @@ def __init__(self, api_client=None): 'validations': { }, 'allowed_values': { - ('channel',): { - - "PUSH": "push", - "EMAIL": "email", - "SMS": "sms" - }, }, 'openapi_types': { 'app_id': (str,), - 'limit': - (int,), - 'offset': - (int,), - 'channel': + 'journey_id': (str,), }, 'attribute_map': { 'app_id': 'app_id', - 'limit': 'limit', - 'offset': 'offset', - 'channel': 'channel', + 'journey_id': 'journey_id', }, 'location_map': { - 'app_id': 'query', - 'limit': 'query', - 'offset': 'query', - 'channel': 'query', + 'app_id': 'path', + 'journey_id': 'path', }, 'collection_format_map': { } @@ -3029,23 +3268,220 @@ def __init__(self, api_client=None): }, 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: + self.view_journeys_endpoint = _Endpoint( + settings={ + 'response_type': (JourneyListResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys', + 'operation_id': 'view_journeys', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'cursor', + 'limit', + ], + 'required': [ + 'app_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] + }, + root_map={ + 'validations': { + ('limit',): { + + 'inclusive_maximum': 50, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'cursor': + (str,), + 'limit': + (int,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'cursor': 'cursor', + 'limit': 'limit', + }, + 'location_map': { + 'app_id': 'path', + 'cursor': 'query', + 'limit': 'query', + }, + '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): @@ -3651,22 +4087,24 @@ def create_custom_events( custom_events_request return self.create_custom_events_endpoint.call_with_http_info(**kwargs) - def create_notification( + def create_journey( self, - notification, + app_id, + create_journey_request, **kwargs ): - """Create notification # noqa: E501 + """Create journey # noqa: E501 - Sends notifications to your users. **Target by External ID (push example):** set `include_aliases` to `{ \"external_id\": [\"your-user-id\"] }` and set `target_channel` to `push` (or `email` / `sms` for those channels). Alias object keys must match API labels exactly (for example `external_id`, not camelCase). **Do not confuse** the notification-level `external_id` field with External ID targeting: top-level `external_id` / `idempotency_key` are for idempotent notification requests only, not for selecting recipients. **Targeting compatibility:** `include_aliases` must not be combined with other targeting modes (segments, filters, subscription IDs, legacy player IDs, etc.). Clients should send only one targeting strategy per request. # noqa: E501 + The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys. # 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.create_journey(app_id, create_journey_request, async_req=True) >>> result = thread.get() Args: - notification (Notification): + app_id (str): Your OneSignal App ID in UUID v4 format. + create_journey_request (CreateJourneyRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -3701,7 +4139,7 @@ def create_notification( async_req (bool): execute request asynchronously Returns: - CreateNotificationSuccessResponse + Journey If the method is called asynchronously, returns the request thread. """ @@ -3730,29 +4168,30 @@ 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['create_journey_request'] = \ + create_journey_request + return self.create_journey_endpoint.call_with_http_info(**kwargs) - def create_segment( + def create_notification( self, - app_id, + notification, **kwargs ): - """Create Segment # noqa: E501 + """Create notification # 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 + Sends notifications to your users. **Target by External ID (push example):** set `include_aliases` to `{ \"external_id\": [\"your-user-id\"] }` and set `target_channel` to `push` (or `email` / `sms` for those channels). Alias object keys must match API labels exactly (for example `external_id`, not camelCase). **Do not confuse** the notification-level `external_id` field with External ID targeting: top-level `external_id` / `idempotency_key` are for idempotent notification requests only, not for selecting recipients. **Targeting compatibility:** `include_aliases` must not be combined with other targeting modes (segments, filters, subscription IDs, legacy player IDs, etc.). Clients should send only one targeting strategy per request. # 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.create_notification(notification, async_req=True) >>> result = thread.get() Args: - app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + notification (Notification): 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 @@ -3785,7 +4224,7 @@ def create_segment( async_req (bool): execute request asynchronously Returns: - CreateSegmentSuccessResponse + CreateNotificationSuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -3814,31 +4253,115 @@ def create_segment( '_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) + kwargs['notification'] = \ + notification + return self.create_notification_endpoint.call_with_http_info(**kwargs) - def create_subscription( + def create_segment( self, app_id, - alias_label, - alias_id, - subscription_body, **kwargs ): - """create_subscription # noqa: E501 + """Create Segment # noqa: E501 - Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. # 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_subscription(app_id, alias_label, alias_id, subscription_body, async_req=True) + >>> thread = api.create_segment(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: + 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: @@ -4265,6 +4788,93 @@ def delete_api_key( token_id return self.delete_api_key_endpoint.call_with_http_info(**kwargs) + def delete_journey( + self, + app_id, + journey_id, + **kwargs + ): + """Delete journey # noqa: E501 + + The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data. # 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_journey(app_id, journey_id, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + journey_id (str): UUID of the journey to delete. + + 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['journey_id'] = \ + journey_id + return self.delete_journey_endpoint.call_with_http_info(**kwargs) + def delete_segment( self, app_id, @@ -6024,17 +6634,470 @@ def transfer_subscription( ): """transfer_subscription # noqa: E501 - Transfers this Subscription to the User identified by the identity in the payload. # 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.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + subscription_id (str): + transfer_subscription_request_body (TransferSubscriptionRequestBody): + + 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['transfer_subscription_request_body'] = \ + transfer_subscription_request_body + return self.transfer_subscription_endpoint.call_with_http_info(**kwargs) + + def unsubscribe_email_with_token( + self, + app_id, + notification_id, + token, + **kwargs + ): + """Unsubscribe with token # 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.unsubscribe_email_with_token(app_id, notification_id, token, 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. + + 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 + kwargs['token'] = \ + token + return self.unsubscribe_email_with_token_endpoint.call_with_http_info(**kwargs) + + def update_api_key( + self, + app_id, + token_id, + update_api_key_request, + **kwargs + ): + """Update API key # 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.update_api_key(app_id, token_id, update_api_key_request, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): + token_id (str): + update_api_key_request (UpdateApiKeyRequest): + + 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['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 update_app( + self, + app_id, + app, + **kwargs + ): + """Update an app # 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.update_app(app_id, app, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): An app id + 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_id'] = \ + app_id + kwargs['app'] = \ + app + return self.update_app_endpoint.call_with_http_info(**kwargs) + + def update_journey( + self, + app_id, + journey_id, + update_journey_request, + **kwargs + ): + """Update journey # noqa: E501 + + The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey. # 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_journey(app_id, journey_id, update_journey_request, async_req=True) + >>> result = thread.get() + + Args: + app_id (str): Your OneSignal App ID in UUID v4 format. + journey_id (str): UUID of the journey to update. + update_journey_request (UpdateJourneyRequest): + + 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: + Journey + 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['journey_id'] = \ + journey_id + kwargs['update_journey_request'] = \ + update_journey_request + return self.update_journey_endpoint.call_with_http_info(**kwargs) + + def update_journey_node( + self, + app_id, + journey_id, + node_id, + update_journey_node_request, + **kwargs + ): + """Update journey node # noqa: E501 + + The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey. # 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_journey_node(app_id, journey_id, node_id, update_journey_node_request, 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. + journey_id (str): UUID of the journey that owns the node. + node_id (str): Server-assigned UUID of the node to update, from a prior View journey fetch. + update_journey_node_request (UpdateJourneyNodeRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -6069,7 +7132,7 @@ def transfer_subscription( async_req (bool): execute request asynchronously Returns: - UserIdentityBody + Journey If the method is called asynchronously, returns the request thread. """ @@ -6100,32 +7163,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['journey_id'] = \ + journey_id + kwargs['node_id'] = \ + node_id + kwargs['update_journey_node_request'] = \ + update_journey_node_request + return self.update_journey_node_endpoint.call_with_http_info(**kwargs) - def unsubscribe_email_with_token( + def update_live_activity( self, app_id, - notification_id, - token, + activity_id, + update_live_activity_request, **kwargs ): - """Unsubscribe with token # noqa: E501 + """Update a Live Activity via Push # noqa: E501 - Unsubscribe an email with a token when using your own custom email unsubscribe landing page # 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.unsubscribe_email_with_token(app_id, notification_id, token, 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. - 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. + activity_id (str): Live Activity record ID + update_live_activity_request (UpdateLiveActivityRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -6160,7 +7225,7 @@ def unsubscribe_email_with_token( async_req (bool): execute request asynchronously Returns: - GenericSuccessBoolResponse + UpdateLiveActivitySuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -6191,34 +7256,33 @@ def unsubscribe_email_with_token( kwargs['_request_auths'] = kwargs.get('_request_auths', None) 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['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 update_api_key( + def update_segment( self, app_id, - token_id, - update_api_key_request, + segment_id, **kwargs ): - """Update API key # noqa: E501 + """Update Segment # noqa: E501 - Update a Rich Authentication Token (App API Key) for a OneSignal app. # noqa: E501 + Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. # 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_api_key(app_id, token_id, update_api_key_request, async_req=True) + >>> thread = api.update_segment(app_id, segment_id, async_req=True) >>> result = thread.get() Args: - app_id (str): - token_id (str): - update_api_key_request (UpdateApiKeyRequest): + app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. + segment_id (str): The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. Keyword Args: + update_segment_request (UpdateSegmentRequest): [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 @@ -6251,7 +7315,7 @@ def update_api_key( async_req (bool): execute request asynchronously Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + UpdateSegmentSuccessResponse If the method is called asynchronously, returns the request thread. """ @@ -6282,30 +7346,30 @@ def update_api_key( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - 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) + kwargs['segment_id'] = \ + segment_id + return self.update_segment_endpoint.call_with_http_info(**kwargs) - def update_app( + def update_subscription( self, app_id, - app, + subscription_id, + subscription_body, **kwargs ): - """Update an app # noqa: E501 + """update_subscription # noqa: E501 - Updates the name or configuration settings of an existing OneSignal app # 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.update_app(app_id, app, async_req=True) + >>> thread = api.update_subscription(app_id, subscription_id, subscription_body, async_req=True) >>> result = thread.get() Args: - app_id (str): An app id - app (App): + app_id (str): + subscription_id (str): + subscription_body (SubscriptionBody): Keyword Args: _return_http_data_only (bool): response data without head status @@ -6340,7 +7404,7 @@ def update_app( async_req (bool): execute request asynchronously Returns: - App + None If the method is called asynchronously, returns the request thread. """ @@ -6371,30 +7435,34 @@ 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['subscription_id'] = \ + subscription_id + kwargs['subscription_body'] = \ + subscription_body + return self.update_subscription_endpoint.call_with_http_info(**kwargs) - def update_live_activity( + def update_subscription_by_token( self, app_id, - activity_id, - update_live_activity_request, + token_type, + token, + subscription_body, **kwargs ): - """Update a Live Activity via Push # noqa: E501 + """Update subscription by token # noqa: E501 - Updates a specified live activity. # 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.update_live_activity(app_id, activity_id, update_live_activity_request, 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): 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): 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 @@ -6429,7 +7497,7 @@ def update_live_activity( async_req (bool): execute request asynchronously Returns: - UpdateLiveActivitySuccessResponse + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} If the method is called asynchronously, returns the request thread. """ @@ -6460,33 +7528,36 @@ 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) + 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 update_segment( + def update_template( self, + template_id, app_id, - segment_id, + update_template_request, **kwargs ): - """Update Segment # noqa: E501 + """Update template # noqa: E501 - Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. # 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.update_segment(app_id, segment_id, 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. - segment_id (str): The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. + template_id (str): + app_id (str): + update_template_request (UpdateTemplateRequest): Keyword Args: - update_segment_request (UpdateSegmentRequest): [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 @@ -6519,7 +7590,7 @@ def update_segment( async_req (bool): execute request asynchronously Returns: - UpdateSegmentSuccessResponse + TemplateResource If the method is called asynchronously, returns the request thread. """ @@ -6548,32 +7619,36 @@ def update_segment( '_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['segment_id'] = \ - segment_id - return self.update_segment_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_subscription( + def update_user( self, app_id, - subscription_id, - subscription_body, + alias_label, + alias_id, + update_user_request, **kwargs ): - """update_subscription # noqa: E501 + """update_user # noqa: E501 - Updates an existing Subscription’s properties. # 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_subscription(app_id, subscription_id, subscription_body, 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): - subscription_id (str): - subscription_body (SubscriptionBody): + alias_label (str): + alias_id (str): + update_user_request (UpdateUserRequest): Keyword Args: _return_http_data_only (bool): response data without head status @@ -6608,7 +7683,7 @@ def update_subscription( async_req (bool): execute request asynchronously Returns: - None + PropertiesBody If the method is called asynchronously, returns the request thread. """ @@ -6639,34 +7714,30 @@ def update_subscription( kwargs['_request_auths'] = kwargs.get('_request_auths', None) 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) + 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_subscription_by_token( + def view_api_keys( self, app_id, - token_type, - token, - subscription_body, **kwargs ): - """Update subscription by token # noqa: E501 + """View API keys # noqa: E501 - Update properties on an existing OneSignal subscription using its token. # 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_subscription_by_token(app_id, token_type, token, subscription_body, async_req=True) + >>> thread = api.view_api_keys(app_id, async_req=True) >>> result = thread.get() Args: - 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): + app_id (str): Keyword Args: _return_http_data_only (bool): response data without head status @@ -6701,7 +7772,7 @@ def update_subscription_by_token( async_req (bool): execute request asynchronously Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + ApiKeyTokensListResponse If the method is called asynchronously, returns the request thread. """ @@ -6732,34 +7803,26 @@ def update_subscription_by_token( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - 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) + return self.view_api_keys_endpoint.call_with_http_info(**kwargs) - def update_template( + def view_journey( self, - template_id, app_id, - update_template_request, + journey_id, **kwargs ): - """Update template # noqa: E501 + """View journey # noqa: E501 - Update an existing template. # noqa: E501 + The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph. # 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_template(template_id, app_id, update_template_request, async_req=True) + >>> thread = api.view_journey(app_id, journey_id, async_req=True) >>> result = thread.get() Args: - template_id (str): - app_id (str): - update_template_request (UpdateTemplateRequest): + app_id (str): Your OneSignal App ID in UUID v4 format. + journey_id (str): UUID of the journey to retrieve. Keyword Args: _return_http_data_only (bool): response data without head status @@ -6794,7 +7857,7 @@ def update_template( async_req (bool): execute request asynchronously Returns: - TemplateResource + Journey If the method is called asynchronously, returns the request thread. """ @@ -6823,36 +7886,30 @@ def update_template( '_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['update_template_request'] = \ - update_template_request - return self.update_template_endpoint.call_with_http_info(**kwargs) + kwargs['journey_id'] = \ + journey_id + return self.view_journey_endpoint.call_with_http_info(**kwargs) - def update_user( + def view_journey_stats( self, app_id, - alias_label, - alias_id, - update_user_request, + journey_id, **kwargs ): - """update_user # noqa: E501 + """View journey stats # noqa: E501 - Updates an existing User’s properties. # noqa: E501 + The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey. # 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_journey_stats(app_id, journey_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. + journey_id (str): UUID of the journey to retrieve stats for. Keyword Args: _return_http_data_only (bool): response data without head status @@ -6887,7 +7944,7 @@ def update_user( async_req (bool): execute request asynchronously Returns: - PropertiesBody + JourneyStats If the method is called asynchronously, returns the request thread. """ @@ -6918,32 +7975,30 @@ 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) + kwargs['journey_id'] = \ + journey_id + return self.view_journey_stats_endpoint.call_with_http_info(**kwargs) - def view_api_keys( + def view_journeys( self, app_id, **kwargs ): - """View API keys # noqa: E501 + """View journeys # noqa: E501 - View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app. # noqa: E501 + The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.view_api_keys(app_id, async_req=True) + >>> thread = api.view_journeys(app_id, async_req=True) >>> result = thread.get() Args: - app_id (str): + app_id (str): Your OneSignal App ID in UUID v4 format. Keyword Args: + cursor (str): Opaque pagination token from a previous response's next_cursor. Omit for the first page.. [optional] + limit (int): Maximum journeys to return per page. Minimum 1, maximum 50.. [optional] if omitted the server will use the default value of 50 _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 @@ -6976,7 +8031,7 @@ def view_api_keys( async_req (bool): execute request asynchronously Returns: - ApiKeyTokensListResponse + JourneyListResponse If the method is called asynchronously, returns the request thread. """ @@ -7007,7 +8062,7 @@ def view_api_keys( kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['app_id'] = \ app_id - return self.view_api_keys_endpoint.call_with_http_info(**kwargs) + return self.view_journeys_endpoint.call_with_http_info(**kwargs) def view_template( self, diff --git a/onesignal/api_client.py b/onesignal/api_client.py index 9f02f79..70b2091 100644 --- a/onesignal/api_client.py +++ b/onesignal/api_client.py @@ -76,7 +76,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.11.3/python' + self.user_agent = 'OpenAPI-Generator/5.12.0/python' def __enter__(self): return self @@ -141,7 +141,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.11.3" + header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.12.0" if self.cookie: header_params['Cookie'] = self.cookie if header_params: diff --git a/onesignal/configuration.py b/onesignal/configuration.py index 0bf66e7..a19571a 100644 --- a/onesignal/configuration.py +++ b/onesignal/configuration.py @@ -398,8 +398,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 5.11.2\n"\ - "SDK Package Version: 5.11.3".\ + "Version of the API: 5.12.0\n"\ + "SDK Package Version: 5.12.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onesignal/model/create_journey_request.py b/onesignal/model/create_journey_request.py new file mode 100644 index 0000000..0710fcb --- /dev/null +++ b/onesignal/model/create_journey_request.py @@ -0,0 +1,307 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_audience import JourneyAudience + from onesignal.model.journey_early_exit import JourneyEarlyExit + from onesignal.model.journey_node import JourneyNode + from onesignal.model.journey_reentry_rules import JourneyReentryRules + from onesignal.model.journey_schedule import JourneySchedule + globals()['JourneyAudience'] = JourneyAudience + globals()['JourneyEarlyExit'] = JourneyEarlyExit + globals()['JourneyNode'] = JourneyNode + globals()['JourneyReentryRules'] = JourneyReentryRules + globals()['JourneySchedule'] = JourneySchedule + + +class CreateJourneyRequest(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 + 'description': (str, none_type,), # noqa: E501 + 'audience': (JourneyAudience,), # noqa: E501 + 'early_exit': (JourneyEarlyExit,), # noqa: E501 + 'reentry_rules': (JourneyReentryRules,), # noqa: E501 + 'schedule': (JourneySchedule,), # noqa: E501 + 'nodes': ([JourneyNode],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'audience': 'audience', # noqa: E501 + 'early_exit': 'early_exit', # noqa: E501 + 'reentry_rules': 'reentry_rules', # noqa: E501 + 'schedule': 'schedule', # noqa: E501 + 'nodes': 'nodes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """CreateJourneyRequest - a model defined in OpenAPI + + Args: + name (str): Journey name, up to 300 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,) + description (str, none_type): Optional journey description, up to 1024 characters.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Ordered list of journey nodes. Server-assigned id fields are rejected on create.. [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 + """CreateJourneyRequest - a model defined in OpenAPI + + Args: + name (str): Journey name, up to 300 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,) + description (str, none_type): Optional journey description, up to 1024 characters.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Ordered list of journey nodes. Server-assigned id fields are rejected on create.. [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/journey.py b/onesignal/model/journey.py new file mode 100644 index 0000000..e28233f --- /dev/null +++ b/onesignal/model/journey.py @@ -0,0 +1,344 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_audience import JourneyAudience + from onesignal.model.journey_early_exit import JourneyEarlyExit + from onesignal.model.journey_node import JourneyNode + from onesignal.model.journey_reentry_rules import JourneyReentryRules + from onesignal.model.journey_schedule import JourneySchedule + globals()['JourneyAudience'] = JourneyAudience + globals()['JourneyEarlyExit'] = JourneyEarlyExit + globals()['JourneyNode'] = JourneyNode + globals()['JourneyReentryRules'] = JourneyReentryRules + globals()['JourneySchedule'] = JourneySchedule + + +class Journey(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 = { + ('state',): { + 'DRAFT': "draft", + 'SCHEDULED': "scheduled", + 'PROCESSING': "processing", + 'ACTIVE': "active", + 'ARCHIVED': "archived", + }, + } + + 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 { + 'id': (str,), # noqa: E501 + 'app_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'state': (str,), # noqa: E501 + 'created_at': (str,), # noqa: E501 + 'updated_at': (str,), # noqa: E501 + 'started_at': (str, none_type,), # noqa: E501 + 'archived_at': (str, none_type,), # noqa: E501 + 'created_source': (str, none_type,), # noqa: E501 + 'audience': (JourneyAudience,), # noqa: E501 + 'early_exit': (JourneyEarlyExit,), # noqa: E501 + 'reentry_rules': (JourneyReentryRules,), # noqa: E501 + 'schedule': (JourneySchedule,), # noqa: E501 + 'nodes': ([JourneyNode],), # noqa: E501 + 'concurrency_key': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'app_id': 'app_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'state': 'state', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'started_at': 'started_at', # noqa: E501 + 'archived_at': 'archived_at', # noqa: E501 + 'created_source': 'created_source', # noqa: E501 + 'audience': 'audience', # noqa: E501 + 'early_exit': 'early_exit', # noqa: E501 + 'reentry_rules': 'reentry_rules', # noqa: E501 + 'schedule': 'schedule', # noqa: E501 + 'nodes': 'nodes', # noqa: E501 + 'concurrency_key': 'concurrency_key', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Journey - 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): Journey UUID. Read-only.. [optional] # noqa: E501 + app_id (str): UUID of the app the journey belongs to. Read-only.. [optional] # noqa: E501 + name (str): Journey name, up to 300 characters.. [optional] # noqa: E501 + description (str, none_type): Journey description, up to 1024 characters. Defaults to an empty string.. [optional] # noqa: E501 + state (str): Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.. [optional] # noqa: E501 + created_at (str): ISO 8601 creation time. Read-only.. [optional] # noqa: E501 + updated_at (str): ISO 8601 last-update time. Read-only.. [optional] # noqa: E501 + started_at (str, none_type): ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing.. [optional] # noqa: E501 + archived_at (str, none_type): ISO 8601 time the journey was archived, or null. Read-only.. [optional] # noqa: E501 + created_source (str, none_type): Origin of the journey, for example public_api or dashboard. Read-only.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Ordered list of journey nodes.. [optional] # noqa: E501 + concurrency_key (str): Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it.. [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 + """Journey - 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): Journey UUID. Read-only.. [optional] # noqa: E501 + app_id (str): UUID of the app the journey belongs to. Read-only.. [optional] # noqa: E501 + name (str): Journey name, up to 300 characters.. [optional] # noqa: E501 + description (str, none_type): Journey description, up to 1024 characters. Defaults to an empty string.. [optional] # noqa: E501 + state (str): Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.. [optional] # noqa: E501 + created_at (str): ISO 8601 creation time. Read-only.. [optional] # noqa: E501 + updated_at (str): ISO 8601 last-update time. Read-only.. [optional] # noqa: E501 + started_at (str, none_type): ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing.. [optional] # noqa: E501 + archived_at (str, none_type): ISO 8601 time the journey was archived, or null. Read-only.. [optional] # noqa: E501 + created_source (str, none_type): Origin of the journey, for example public_api or dashboard. Read-only.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Ordered list of journey nodes.. [optional] # noqa: E501 + concurrency_key (str): Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it.. [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/journey_audience.py b/onesignal/model/journey_audience.py new file mode 100644 index 0000000..36324f5 --- /dev/null +++ b/onesignal/model/journey_audience.py @@ -0,0 +1,299 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_event_trigger_attributes import JourneyEventTriggerAttributes + globals()['JourneyEventTriggerAttributes'] = JourneyEventTriggerAttributes + + +class JourneyAudience(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 = { + ('kind',): { + 'SEGMENT': "segment", + 'EVENT_TRIGGER': "event_trigger", + }, + } + + 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 { + 'kind': (str,), # noqa: E501 + 'included_segment_ids': ([str],), # noqa: E501 + 'excluded_segment_ids': ([str],), # noqa: E501 + 'future_additions_only': (bool, none_type,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'attributes': (JourneyEventTriggerAttributes,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'kind': 'kind', # noqa: E501 + 'included_segment_ids': 'included_segment_ids', # noqa: E501 + 'excluded_segment_ids': 'excluded_segment_ids', # noqa: E501 + 'future_additions_only': 'future_additions_only', # noqa: E501 + 'name': 'name', # noqa: E501 + 'attributes': 'attributes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, kind, *args, **kwargs): # noqa: E501 + """JourneyAudience - a model defined in OpenAPI + + Args: + kind (str): Audience kind. Selects which other fields apply. + + 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,) + included_segment_ids ([str]): segment audiences: Segment UUIDs whose users enter the journey.. [optional] # noqa: E501 + excluded_segment_ids ([str]): segment audiences: Segment UUIDs whose users are excluded.. [optional] # noqa: E501 + future_additions_only (bool, none_type): segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false.. [optional] # noqa: E501 + name (str): event_trigger audiences: event name that triggers entry, up to 255 characters.. [optional] # noqa: E501 + attributes (JourneyEventTriggerAttributes): [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.kind = kind + 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, kind, *args, **kwargs): # noqa: E501 + """JourneyAudience - a model defined in OpenAPI + + Args: + kind (str): Audience kind. Selects which other fields apply. + + 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,) + included_segment_ids ([str]): segment audiences: Segment UUIDs whose users enter the journey.. [optional] # noqa: E501 + excluded_segment_ids ([str]): segment audiences: Segment UUIDs whose users are excluded.. [optional] # noqa: E501 + future_additions_only (bool, none_type): segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false.. [optional] # noqa: E501 + name (str): event_trigger audiences: event name that triggers entry, up to 255 characters.. [optional] # noqa: E501 + attributes (JourneyEventTriggerAttributes): [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.kind = kind + 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/journey_branch.py b/onesignal/model/journey_branch.py new file mode 100644 index 0000000..94269c1 --- /dev/null +++ b/onesignal/model/journey_branch.py @@ -0,0 +1,283 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_condition import JourneyCondition + from onesignal.model.journey_node import JourneyNode + globals()['JourneyCondition'] = JourneyCondition + globals()['JourneyNode'] = JourneyNode + + +class JourneyBranch(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 { + 'id': (str,), # noqa: E501 + 'condition': (JourneyCondition,), # noqa: E501 + 'weight': (float,), # noqa: E501 + 'nodes': ([JourneyNode],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'condition': 'condition', # noqa: E501 + 'weight': 'weight', # noqa: E501 + 'nodes': 'nodes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyBranch - 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): Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch.. [optional] # noqa: E501 + condition (JourneyCondition): [optional] # noqa: E501 + weight (float): Branch weight for split_range nodes. Weights across a node's branches must sum to 100.. [optional] # noqa: E501 + nodes ([JourneyNode]): Nodes run when this branch is taken, before flow converges to the next sibling node.. [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 + """JourneyBranch - 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): Server-assigned branch identifier. Read-only on create; echo it on update to keep the branch.. [optional] # noqa: E501 + condition (JourneyCondition): [optional] # noqa: E501 + weight (float): Branch weight for split_range nodes. Weights across a node's branches must sum to 100.. [optional] # noqa: E501 + nodes ([JourneyNode]): Nodes run when this branch is taken, before flow converges to the next sibling node.. [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/journey_branch_stats.py b/onesignal/model/journey_branch_stats.py new file mode 100644 index 0000000..4f4f8ac --- /dev/null +++ b/onesignal/model/journey_branch_stats.py @@ -0,0 +1,263 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyBranchStats(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 { + 'completed': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'completed': 'completed', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyBranchStats - 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,) + completed (int): Users who took this branch.. [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 + """JourneyBranchStats - 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,) + completed (int): Users who took this branch.. [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/journey_condition.py b/onesignal/model/journey_condition.py new file mode 100644 index 0000000..59a49ec --- /dev/null +++ b/onesignal/model/journey_condition.py @@ -0,0 +1,317 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_event_trigger_attributes import JourneyEventTriggerAttributes + globals()['JourneyEventTriggerAttributes'] = JourneyEventTriggerAttributes + + +class JourneyCondition(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 = { + ('kind',): { + 'SEGMENT_MEMBERSHIP': "segment_membership", + 'ON_NOTIFICATION_ACTION': "on_notification_action", + 'EVENT_TRIGGER': "event_trigger", + }, + ('action',): { + 'RECEIVED': "received", + 'CLICKED': "clicked", + 'OPENED': "opened", + }, + } + + 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 { + 'kind': (str,), # noqa: E501 + 'included_segment_ids': ([str],), # noqa: E501 + 'excluded_segment_ids': ([str],), # noqa: E501 + 'action': (str,), # noqa: E501 + 'sending_node_id': (str,), # noqa: E501 + 'client_node_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'attributes': (JourneyEventTriggerAttributes,), # noqa: E501 + 'entry_event_match_attributes': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'kind': 'kind', # noqa: E501 + 'included_segment_ids': 'included_segment_ids', # noqa: E501 + 'excluded_segment_ids': 'excluded_segment_ids', # noqa: E501 + 'action': 'action', # noqa: E501 + 'sending_node_id': 'sending_node_id', # noqa: E501 + 'client_node_id': 'client_node_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'attributes': 'attributes', # noqa: E501 + 'entry_event_match_attributes': 'entry_event_match_attributes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, kind, *args, **kwargs): # noqa: E501 + """JourneyCondition - a model defined in OpenAPI + + Args: + kind (str): Condition kind. Selects which other fields apply. + + 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,) + included_segment_ids ([str]): segment_membership conditions: Segment UUIDs the user must belong to.. [optional] # noqa: E501 + excluded_segment_ids ([str]): segment_membership conditions: Segment UUIDs the user must not belong to.. [optional] # noqa: E501 + action (str): on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel.. [optional] # noqa: E501 + sending_node_id (str): on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write.. [optional] # noqa: E501 + client_node_id (str): on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id.. [optional] # noqa: E501 + name (str): event_trigger conditions: event name, up to 255 characters.. [optional] # noqa: E501 + attributes (JourneyEventTriggerAttributes): [optional] # noqa: E501 + entry_event_match_attributes ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys.. [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.kind = kind + 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, kind, *args, **kwargs): # noqa: E501 + """JourneyCondition - a model defined in OpenAPI + + Args: + kind (str): Condition kind. Selects which other fields apply. + + 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,) + included_segment_ids ([str]): segment_membership conditions: Segment UUIDs the user must belong to.. [optional] # noqa: E501 + excluded_segment_ids ([str]): segment_membership conditions: Segment UUIDs the user must not belong to.. [optional] # noqa: E501 + action (str): on_notification_action conditions: the notification action to branch on. Which actions apply depends on the sending node's channel.. [optional] # noqa: E501 + sending_node_id (str): on_notification_action conditions: id of the sending node this action refers to. Returned on reads; accepted on write.. [optional] # noqa: E501 + client_node_id (str): on_notification_action conditions: write-only alternative to sending_node_id. References the sending node by its client_node_id.. [optional] # noqa: E501 + name (str): event_trigger conditions: event name, up to 255 characters.. [optional] # noqa: E501 + attributes (JourneyEventTriggerAttributes): [optional] # noqa: E501 + entry_event_match_attributes ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): event_trigger conditions: match incoming event properties against the journey's entry event. Only valid on event-triggered journeys.. [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.kind = kind + 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/journey_early_exit.py b/onesignal/model/journey_early_exit.py new file mode 100644 index 0000000..368c8de --- /dev/null +++ b/onesignal/model/journey_early_exit.py @@ -0,0 +1,273 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_early_exit_rules import JourneyEarlyExitRules + globals()['JourneyEarlyExitRules'] = JourneyEarlyExitRules + + +class JourneyEarlyExit(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 = 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. + """ + lazy_import() + return { + 'rules': (JourneyEarlyExitRules,), # noqa: E501 + 'tag_on_early_exit': ({str: (str,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'rules': 'rules', # noqa: E501 + 'tag_on_early_exit': 'tag_on_early_exit', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyEarlyExit - 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,) + rules (JourneyEarlyExitRules): [optional] # noqa: E501 + tag_on_early_exit ({str: (str,)}): Tag key-value pairs applied when a user exits early.. [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 + """JourneyEarlyExit - 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,) + rules (JourneyEarlyExitRules): [optional] # noqa: E501 + tag_on_early_exit ({str: (str,)}): Tag key-value pairs applied when a user exits early.. [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/journey_early_exit_rules.py b/onesignal/model/journey_early_exit_rules.py new file mode 100644 index 0000000..7c97780 --- /dev/null +++ b/onesignal/model/journey_early_exit_rules.py @@ -0,0 +1,283 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_early_exit_rules_on_event import JourneyEarlyExitRulesOnEvent + from onesignal.model.journey_early_exit_rules_on_segment import JourneyEarlyExitRulesOnSegment + globals()['JourneyEarlyExitRulesOnEvent'] = JourneyEarlyExitRulesOnEvent + globals()['JourneyEarlyExitRulesOnSegment'] = JourneyEarlyExitRulesOnSegment + + +class JourneyEarlyExitRules(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 { + 'on_segment': (JourneyEarlyExitRulesOnSegment,), # noqa: E501 + 'when_not_in_audience': (bool, none_type,), # noqa: E501 + 'on_session': (bool, none_type,), # noqa: E501 + 'on_event': (JourneyEarlyExitRulesOnEvent,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'on_segment': 'on_segment', # noqa: E501 + 'when_not_in_audience': 'when_not_in_audience', # noqa: E501 + 'on_session': 'on_session', # noqa: E501 + 'on_event': 'on_event', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyEarlyExitRules - 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,) + on_segment (JourneyEarlyExitRulesOnSegment): [optional] # noqa: E501 + when_not_in_audience (bool, none_type): Exit when the user no longer matches the journey audience. Defaults to false.. [optional] # noqa: E501 + on_session (bool, none_type): Exit on a new session start. Defaults to false.. [optional] # noqa: E501 + on_event (JourneyEarlyExitRulesOnEvent): [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 + """JourneyEarlyExitRules - 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,) + on_segment (JourneyEarlyExitRulesOnSegment): [optional] # noqa: E501 + when_not_in_audience (bool, none_type): Exit when the user no longer matches the journey audience. Defaults to false.. [optional] # noqa: E501 + on_session (bool, none_type): Exit on a new session start. Defaults to false.. [optional] # noqa: E501 + on_event (JourneyEarlyExitRulesOnEvent): [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/journey_early_exit_rules_on_event.py b/onesignal/model/journey_early_exit_rules_on_event.py new file mode 100644 index 0000000..bd80de4 --- /dev/null +++ b/onesignal/model/journey_early_exit_rules_on_event.py @@ -0,0 +1,269 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyEarlyExitRulesOnEvent(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 = 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 { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """JourneyEarlyExitRulesOnEvent - a model defined in OpenAPI + + Args: + name (str): Exit when this event occurs. Up to 255 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,) + """ + + _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 + """JourneyEarlyExitRulesOnEvent - a model defined in OpenAPI + + Args: + name (str): Exit when this event occurs. Up to 255 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,) + """ + + _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/journey_early_exit_rules_on_segment.py b/onesignal/model/journey_early_exit_rules_on_segment.py new file mode 100644 index 0000000..b08bff7 --- /dev/null +++ b/onesignal/model/journey_early_exit_rules_on_segment.py @@ -0,0 +1,263 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyEarlyExitRulesOnSegment(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 = 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 { + 'included_segment_ids': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'included_segment_ids': 'included_segment_ids', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyEarlyExitRulesOnSegment - 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,) + included_segment_ids ([str]): Exit when the user enters any of these segments.. [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 + """JourneyEarlyExitRulesOnSegment - 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,) + included_segment_ids ([str]): Exit when the user enters any of these segments.. [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/journey_event_attribute.py b/onesignal/model/journey_event_attribute.py new file mode 100644 index 0000000..04195a2 --- /dev/null +++ b/onesignal/model/journey_event_attribute.py @@ -0,0 +1,293 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyEventAttribute(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 = { + ('operator',): { + 'EQUAL': "equal", + 'NOT_EQUAL': "not_equal", + 'LESS': "less", + 'LESS_OR_EQUAL': "less_or_equal", + 'GREATER_OR_EQUAL': "greater_or_equal", + 'GREATER': "greater", + 'IS': "is", + 'IS_NOT': "is_not", + 'EXISTS': "exists", + 'NOT_EXISTS': "not_exists", + 'BEFORE': "before", + 'AFTER': "after", + }, + } + + 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 { + 'key': (str,), # noqa: E501 + 'operator': (str,), # noqa: E501 + 'value': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'key': 'key', # noqa: E501 + 'operator': 'operator', # noqa: E501 + 'value': 'value', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, key, operator, *args, **kwargs): # noqa: E501 + """JourneyEventAttribute - a model defined in OpenAPI + + Args: + key (str): Event attribute key. + operator (str): Comparison operator. + + 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,) + value (str): Value to compare against. Not required for exists and not_exists.. [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.key = key + self.operator = operator + 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, key, operator, *args, **kwargs): # noqa: E501 + """JourneyEventAttribute - a model defined in OpenAPI + + Args: + key (str): Event attribute key. + operator (str): Comparison operator. + + 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,) + value (str): Value to compare against. Not required for exists and not_exists.. [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.key = key + self.operator = operator + 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/journey_event_trigger_attributes.py b/onesignal/model/journey_event_trigger_attributes.py new file mode 100644 index 0000000..d3885fb --- /dev/null +++ b/onesignal/model/journey_event_trigger_attributes.py @@ -0,0 +1,291 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_event_attribute import JourneyEventAttribute + globals()['JourneyEventAttribute'] = JourneyEventAttribute + + +class JourneyEventTriggerAttributes(ModelSimple): + """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. + 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 = { + } + + additional_properties_type = None + + _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 { + 'value': ([[JourneyEventAttribute]],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + 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): + """JourneyEventTriggerAttributes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([[JourneyEventAttribute]]): Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.. # noqa: E501 + + Keyword Args: + value ([[JourneyEventAttribute]]): Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.. # 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,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _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.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """JourneyEventTriggerAttributes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([[JourneyEventAttribute]]): Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.. # noqa: E501 + + Keyword Args: + value ([[JourneyEventAttribute]]): Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.. # 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,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _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.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/onesignal/model/journey_list_audience.py b/onesignal/model/journey_list_audience.py new file mode 100644 index 0000000..9a25b33 --- /dev/null +++ b/onesignal/model/journey_list_audience.py @@ -0,0 +1,267 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyListAudience(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 = { + ('kind',): { + 'SEGMENT': "segment", + 'EVENT_TRIGGER': "event_trigger", + }, + } + + 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 { + 'kind': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'kind': 'kind', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyListAudience - 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,) + kind (str): Audience kind.. [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 + """JourneyListAudience - 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,) + kind (str): Audience kind.. [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/journey_list_item.py b/onesignal/model/journey_list_item.py new file mode 100644 index 0000000..d046156 --- /dev/null +++ b/onesignal/model/journey_list_item.py @@ -0,0 +1,324 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_list_audience import JourneyListAudience + from onesignal.model.journey_reentry_rules import JourneyReentryRules + from onesignal.model.journey_schedule import JourneySchedule + globals()['JourneyListAudience'] = JourneyListAudience + globals()['JourneyReentryRules'] = JourneyReentryRules + globals()['JourneySchedule'] = JourneySchedule + + +class JourneyListItem(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 = { + ('state',): { + 'DRAFT': "draft", + 'SCHEDULED': "scheduled", + 'PROCESSING': "processing", + 'ACTIVE': "active", + 'ARCHIVED': "archived", + }, + } + + 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 { + 'id': (str,), # noqa: E501 + 'app_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'state': (str,), # noqa: E501 + 'created_at': (str,), # noqa: E501 + 'updated_at': (str,), # noqa: E501 + 'started_at': (str, none_type,), # noqa: E501 + 'archived_at': (str, none_type,), # noqa: E501 + 'created_source': (str, none_type,), # noqa: E501 + 'schedule': (JourneySchedule,), # noqa: E501 + 'audience': (JourneyListAudience,), # noqa: E501 + 'reentry_rules': (JourneyReentryRules,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'app_id': 'app_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'state': 'state', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'started_at': 'started_at', # noqa: E501 + 'archived_at': 'archived_at', # noqa: E501 + 'created_source': 'created_source', # noqa: E501 + 'schedule': 'schedule', # noqa: E501 + 'audience': 'audience', # noqa: E501 + 'reentry_rules': 'reentry_rules', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyListItem - 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): Journey UUID. Read-only.. [optional] # noqa: E501 + app_id (str): UUID of the app the journey belongs to. Read-only.. [optional] # noqa: E501 + name (str): Journey name, up to 300 characters.. [optional] # noqa: E501 + state (str): Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.. [optional] # noqa: E501 + created_at (str): ISO 8601 creation time. Read-only.. [optional] # noqa: E501 + updated_at (str): ISO 8601 last-update time. Read-only.. [optional] # noqa: E501 + started_at (str, none_type): ISO 8601 time the journey was activated, or null. Read-only.. [optional] # noqa: E501 + archived_at (str, none_type): ISO 8601 time the journey was archived, or null. Read-only.. [optional] # noqa: E501 + created_source (str, none_type): Origin of the journey, for example public_api or dashboard. Read-only.. [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + audience (JourneyListAudience): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [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 + """JourneyListItem - 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): Journey UUID. Read-only.. [optional] # noqa: E501 + app_id (str): UUID of the app the journey belongs to. Read-only.. [optional] # noqa: E501 + name (str): Journey name, up to 300 characters.. [optional] # noqa: E501 + state (str): Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.. [optional] # noqa: E501 + created_at (str): ISO 8601 creation time. Read-only.. [optional] # noqa: E501 + updated_at (str): ISO 8601 last-update time. Read-only.. [optional] # noqa: E501 + started_at (str, none_type): ISO 8601 time the journey was activated, or null. Read-only.. [optional] # noqa: E501 + archived_at (str, none_type): ISO 8601 time the journey was archived, or null. Read-only.. [optional] # noqa: E501 + created_source (str, none_type): Origin of the journey, for example public_api or dashboard. Read-only.. [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + audience (JourneyListAudience): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [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/journey_list_response.py b/onesignal/model/journey_list_response.py new file mode 100644 index 0000000..59d2365 --- /dev/null +++ b/onesignal/model/journey_list_response.py @@ -0,0 +1,277 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_list_item import JourneyListItem + globals()['JourneyListItem'] = JourneyListItem + + +class JourneyListResponse(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 { + 'journeys': ([JourneyListItem],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + 'next_cursor': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'journeys': 'journeys', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + 'next_cursor': 'next_cursor', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyListResponse - 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,) + journeys ([JourneyListItem]): Journeys ordered by creation time, newest first.. [optional] # noqa: E501 + has_more (bool): true if more journeys exist beyond this page.. [optional] # noqa: E501 + next_cursor (str): Cursor for the next page. Present only when has_more is true.. [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 + """JourneyListResponse - 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,) + journeys ([JourneyListItem]): Journeys ordered by creation time, newest first.. [optional] # noqa: E501 + has_more (bool): true if more journeys exist beyond this page.. [optional] # noqa: E501 + next_cursor (str): Cursor for the next page. Present only when has_more is true.. [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/journey_message_stats.py b/onesignal/model/journey_message_stats.py new file mode 100644 index 0000000..91019e8 --- /dev/null +++ b/onesignal/model/journey_message_stats.py @@ -0,0 +1,263 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyMessageStats(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 { + 'totals': ({str: (float,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'totals': 'totals', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyMessageStats - 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,) + totals ({str: (float,)}): All-time totals for this node, keyed by channel-specific stat name.. [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 + """JourneyMessageStats - 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,) + totals ({str: (float,)}): All-time totals for this node, keyed by channel-specific stat name.. [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/journey_node.py b/onesignal/model/journey_node.py new file mode 100644 index 0000000..e06f4a9 --- /dev/null +++ b/onesignal/model/journey_node.py @@ -0,0 +1,367 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_branch import JourneyBranch + from onesignal.model.journey_time_window import JourneyTimeWindow + from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration + globals()['JourneyBranch'] = JourneyBranch + globals()['JourneyTimeWindow'] = JourneyTimeWindow + globals()['JourneyWaitUntilExpiration'] = JourneyWaitUntilExpiration + + +class JourneyNode(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 = { + ('kind',): { + 'WAIT': "wait", + 'TIME_WINDOW': "time_window", + 'SEND_PUSH': "send_push", + 'SEND_EMAIL': "send_email", + 'SEND_SMS': "send_sms", + 'SEND_IAM': "send_iam", + 'SEND_WEBHOOK': "send_webhook", + 'TAG': "tag", + 'SPLIT_RANGE': "split_range", + 'YES_NO': "yes_no", + 'WAIT_UNTIL': "wait_until", + }, + ('relative_to',): { + 'SCHEDULE_IN_TIMEZONE': "schedule_in_timezone", + 'LAST_ACTIVE_TIME': "last_active_time", + }, + } + + validations = { + ('duration_seconds',): { + 'inclusive_maximum': 31556952, + 'inclusive_minimum': 60, + }, + ('user_ttl_seconds',): { + 'inclusive_minimum': 1, + }, + } + + @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 { + 'kind': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'client_node_id': (str,), # noqa: E501 + 'annotation': (str,), # noqa: E501 + 'duration_seconds': (int, none_type,), # noqa: E501 + 'relative_to': (str,), # noqa: E501 + 'windows': ([JourneyTimeWindow],), # noqa: E501 + 'time_zone': (str,), # noqa: E501 + 'use_user_time_zone': (bool, none_type,), # noqa: E501 + 'template_id': (str,), # noqa: E501 + 'iam_id': (str,), # noqa: E501 + 'user_ttl_seconds': (int, none_type,), # noqa: E501 + 'webhook_id': (str,), # noqa: E501 + 'assignments': ({str: (str,)},), # noqa: E501 + 'randomize_on_entry': (bool, none_type,), # noqa: E501 + 'branches': ([JourneyBranch],), # noqa: E501 + 'expiration': (JourneyWaitUntilExpiration,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'kind': 'kind', # noqa: E501 + 'id': 'id', # noqa: E501 + 'client_node_id': 'client_node_id', # noqa: E501 + 'annotation': 'annotation', # noqa: E501 + 'duration_seconds': 'duration_seconds', # noqa: E501 + 'relative_to': 'relative_to', # noqa: E501 + 'windows': 'windows', # noqa: E501 + 'time_zone': 'time_zone', # noqa: E501 + 'use_user_time_zone': 'use_user_time_zone', # noqa: E501 + 'template_id': 'template_id', # noqa: E501 + 'iam_id': 'iam_id', # noqa: E501 + 'user_ttl_seconds': 'user_ttl_seconds', # noqa: E501 + 'webhook_id': 'webhook_id', # noqa: E501 + 'assignments': 'assignments', # noqa: E501 + 'randomize_on_entry': 'randomize_on_entry', # noqa: E501 + 'branches': 'branches', # noqa: E501 + 'expiration': 'expiration', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, kind, *args, **kwargs): # noqa: E501 + """JourneyNode - a model defined in OpenAPI + + Args: + kind (str): Node kind. Selects which other fields apply. + + 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): Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error.. [optional] # noqa: E501 + client_node_id (str): Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.. [optional] # noqa: E501 + annotation (str): Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.. [optional] # noqa: E501 + duration_seconds (int, none_type): wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + relative_to (str): time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.. [optional] # noqa: E501 + windows ([JourneyTimeWindow]): time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.. [optional] # noqa: E501 + time_zone (str): time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.. [optional] # noqa: E501 + use_user_time_zone (bool, none_type): time_window nodes: when true, uses the user's timezone if available.. [optional] # noqa: E501 + template_id (str): send_push, send_email, and send_sms nodes: UUID of the template to send.. [optional] # noqa: E501 + iam_id (str): send_iam nodes: UUID of the in-app message to send.. [optional] # noqa: E501 + user_ttl_seconds (int, none_type): send_iam nodes: optional time-to-live for the in-app message, in seconds.. [optional] # noqa: E501 + webhook_id (str): send_webhook nodes: UUID of the webhook to send.. [optional] # noqa: E501 + assignments ({str: (str,)}): tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.. [optional] # noqa: E501 + randomize_on_entry (bool, none_type): split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.. [optional] # noqa: E501 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.. [optional] # noqa: E501 + expiration (JourneyWaitUntilExpiration): [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.kind = kind + 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, kind, *args, **kwargs): # noqa: E501 + """JourneyNode - a model defined in OpenAPI + + Args: + kind (str): Node kind. Selects which other fields apply. + + 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): Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error.. [optional] # noqa: E501 + client_node_id (str): Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.. [optional] # noqa: E501 + annotation (str): Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.. [optional] # noqa: E501 + duration_seconds (int, none_type): wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + relative_to (str): time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.. [optional] # noqa: E501 + windows ([JourneyTimeWindow]): time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.. [optional] # noqa: E501 + time_zone (str): time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.. [optional] # noqa: E501 + use_user_time_zone (bool, none_type): time_window nodes: when true, uses the user's timezone if available.. [optional] # noqa: E501 + template_id (str): send_push, send_email, and send_sms nodes: UUID of the template to send.. [optional] # noqa: E501 + iam_id (str): send_iam nodes: UUID of the in-app message to send.. [optional] # noqa: E501 + user_ttl_seconds (int, none_type): send_iam nodes: optional time-to-live for the in-app message, in seconds.. [optional] # noqa: E501 + webhook_id (str): send_webhook nodes: UUID of the webhook to send.. [optional] # noqa: E501 + assignments ({str: (str,)}): tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.. [optional] # noqa: E501 + randomize_on_entry (bool, none_type): split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.. [optional] # noqa: E501 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.. [optional] # noqa: E501 + expiration (JourneyWaitUntilExpiration): [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.kind = kind + 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/journey_node_stats.py b/onesignal/model/journey_node_stats.py new file mode 100644 index 0000000..b260d8a --- /dev/null +++ b/onesignal/model/journey_node_stats.py @@ -0,0 +1,298 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_message_stats import JourneyMessageStats + globals()['JourneyMessageStats'] = JourneyMessageStats + + +class JourneyNodeStats(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 = { + ('kind',): { + 'WAIT': "wait", + 'TIME_WINDOW': "time_window", + 'SEND_PUSH': "send_push", + 'SEND_EMAIL': "send_email", + 'SEND_SMS': "send_sms", + 'SEND_IAM': "send_iam", + 'SEND_WEBHOOK': "send_webhook", + 'TAG': "tag", + 'SPLIT_RANGE': "split_range", + 'YES_NO': "yes_no", + 'WAIT_UNTIL': "wait_until", + }, + } + + 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 { + 'kind': (str,), # noqa: E501 + 'waiting': (int,), # noqa: E501 + 'completed': (int,), # noqa: E501 + 'exited_early': (int,), # noqa: E501 + 'message_stats': (JourneyMessageStats,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'kind': 'kind', # noqa: E501 + 'waiting': 'waiting', # noqa: E501 + 'completed': 'completed', # noqa: E501 + 'exited_early': 'exited_early', # noqa: E501 + 'message_stats': 'message_stats', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyNodeStats - 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,) + kind (str): Node kind, repeated here so stats can be read without joining against the journey definition.. [optional] # noqa: E501 + waiting (int): Users currently held at this node.. [optional] # noqa: E501 + completed (int): Users who advanced past this node normally.. [optional] # noqa: E501 + exited_early (int): Users who left the journey from this node through an early exit rule.. [optional] # noqa: E501 + message_stats (JourneyMessageStats): [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 + """JourneyNodeStats - 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,) + kind (str): Node kind, repeated here so stats can be read without joining against the journey definition.. [optional] # noqa: E501 + waiting (int): Users currently held at this node.. [optional] # noqa: E501 + completed (int): Users who advanced past this node normally.. [optional] # noqa: E501 + exited_early (int): Users who left the journey from this node through an early exit rule.. [optional] # noqa: E501 + message_stats (JourneyMessageStats): [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/journey_reentry_rules.py b/onesignal/model/journey_reentry_rules.py new file mode 100644 index 0000000..d81fd32 --- /dev/null +++ b/onesignal/model/journey_reentry_rules.py @@ -0,0 +1,266 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyReentryRules(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 = { + ('duration_seconds',): { + 'inclusive_minimum': 600, + }, + } + + @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 = 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 { + 'duration_seconds': (int, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'duration_seconds': 'duration_seconds', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyReentryRules - 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,) + duration_seconds (int, none_type): Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes).. [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 + """JourneyReentryRules - 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,) + duration_seconds (int, none_type): Minimum seconds before a user can re-enter. Must be at least 600 (10 minutes).. [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/journey_schedule.py b/onesignal/model/journey_schedule.py new file mode 100644 index 0000000..67556a0 --- /dev/null +++ b/onesignal/model/journey_schedule.py @@ -0,0 +1,271 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneySchedule(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 = 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 { + 'start_at': (str, none_type,), # noqa: E501 + 'stop_at': (str, none_type,), # noqa: E501 + 'error': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'start_at': 'start_at', # noqa: E501 + 'stop_at': 'stop_at', # noqa: E501 + 'error': 'error', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneySchedule - 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,) + start_at (str, none_type): ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future.. [optional] # noqa: E501 + stop_at (str, none_type): ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at.. [optional] # noqa: E501 + error (str, none_type): Read-only. Present when a scheduling error occurred.. [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 + """JourneySchedule - 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,) + start_at (str, none_type): ISO 8601 start time. Use UTC (Z or +00:00). Must be at least 5 minutes in the future.. [optional] # noqa: E501 + stop_at (str, none_type): ISO 8601 stop time. Use UTC (Z or +00:00). Must be in the future and later than start_at.. [optional] # noqa: E501 + error (str, none_type): Read-only. Present when a scheduling error occurred.. [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/journey_stats.py b/onesignal/model/journey_stats.py new file mode 100644 index 0000000..580f45c --- /dev/null +++ b/onesignal/model/journey_stats.py @@ -0,0 +1,291 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_branch_stats import JourneyBranchStats + from onesignal.model.journey_node_stats import JourneyNodeStats + globals()['JourneyBranchStats'] = JourneyBranchStats + globals()['JourneyNodeStats'] = JourneyNodeStats + + +class JourneyStats(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 { + 'id': (str,), # noqa: E501 + 'started': (int,), # noqa: E501 + 'completed': (int,), # noqa: E501 + 'exited_early': (int,), # noqa: E501 + 'nodes': ({str: (JourneyNodeStats,)},), # noqa: E501 + 'branches': ({str: (JourneyBranchStats,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'started': 'started', # noqa: E501 + 'completed': 'completed', # noqa: E501 + 'exited_early': 'exited_early', # noqa: E501 + 'nodes': 'nodes', # noqa: E501 + 'branches': 'branches', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyStats - 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): UUID of the journey these stats belong to.. [optional] # noqa: E501 + started (int): Users who entered the journey.. [optional] # noqa: E501 + completed (int): Users who reached the end of the journey normally.. [optional] # noqa: E501 + exited_early (int): Users who left the journey through an early exit rule.. [optional] # noqa: E501 + nodes ({str: (JourneyNodeStats,)}): Node stats keyed by node id. Includes every node in the graph, at any nesting depth.. [optional] # noqa: E501 + branches ({str: (JourneyBranchStats,)}): Branch stats keyed by branch id. Empty for a journey with no branching nodes.. [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 + """JourneyStats - 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): UUID of the journey these stats belong to.. [optional] # noqa: E501 + started (int): Users who entered the journey.. [optional] # noqa: E501 + completed (int): Users who reached the end of the journey normally.. [optional] # noqa: E501 + exited_early (int): Users who left the journey through an early exit rule.. [optional] # noqa: E501 + nodes ({str: (JourneyNodeStats,)}): Node stats keyed by node id. Includes every node in the graph, at any nesting depth.. [optional] # noqa: E501 + branches ({str: (JourneyBranchStats,)}): Branch stats keyed by branch id. Empty for a journey with no branching nodes.. [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/journey_time_point.py b/onesignal/model/journey_time_point.py new file mode 100644 index 0000000..3b846f9 --- /dev/null +++ b/onesignal/model/journey_time_point.py @@ -0,0 +1,275 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyTimePoint(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 = { + ('hour',): { + 'inclusive_maximum': 23, + 'inclusive_minimum': 0, + }, + ('minute',): { + 'inclusive_maximum': 59, + 'inclusive_minimum': 0, + }, + } + + @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 { + 'hour': (int,), # noqa: E501 + 'minute': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'hour': 'hour', # noqa: E501 + 'minute': 'minute', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyTimePoint - 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,) + hour (int): Hour of day, 0-23.. [optional] # noqa: E501 + minute (int): Minute of hour, 0-59. Defaults to 0.. [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 + """JourneyTimePoint - 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,) + hour (int): Hour of day, 0-23.. [optional] # noqa: E501 + minute (int): Minute of hour, 0-59. Defaults to 0.. [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/journey_time_window.py b/onesignal/model/journey_time_window.py new file mode 100644 index 0000000..4181c16 --- /dev/null +++ b/onesignal/model/journey_time_window.py @@ -0,0 +1,281 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_time_point import JourneyTimePoint + globals()['JourneyTimePoint'] = JourneyTimePoint + + +class JourneyTimeWindow(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 = { + ('day_of_week',): { + 'inclusive_maximum': 7, + 'inclusive_minimum': 1, + }, + } + + @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 { + 'start': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'end': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'day_of_week': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'start': 'start', # noqa: E501 + 'end': 'end', # noqa: E501 + 'day_of_week': 'day_of_week', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyTimeWindow - 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,) + start (bool, date, datetime, dict, float, int, list, str, none_type): When the window opens.. [optional] # noqa: E501 + end (bool, date, datetime, dict, float, int, list, str, none_type): When the window closes.. [optional] # noqa: E501 + day_of_week (int): Day of week, 1 = Monday. Omit to apply the window to every day.. [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 + """JourneyTimeWindow - 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,) + start (bool, date, datetime, dict, float, int, list, str, none_type): When the window opens.. [optional] # noqa: E501 + end (bool, date, datetime, dict, float, int, list, str, none_type): When the window closes.. [optional] # noqa: E501 + day_of_week (int): Day of week, 1 = Monday. Omit to apply the window to every day.. [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/journey_wait_until_expiration.py b/onesignal/model/journey_wait_until_expiration.py new file mode 100644 index 0000000..30d1b26 --- /dev/null +++ b/onesignal/model/journey_wait_until_expiration.py @@ -0,0 +1,271 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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 JourneyWaitUntilExpiration(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 = { + ('duration_seconds',): { + 'inclusive_maximum': 31556952, + 'inclusive_minimum': 60, + }, + } + + @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 = 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 { + 'duration_seconds': (int, none_type,), # noqa: E501 + 'exits': (bool, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'duration_seconds': 'duration_seconds', # noqa: E501 + 'exits': 'exits', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """JourneyWaitUntilExpiration - 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,) + duration_seconds (int, none_type): Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + exits (bool, none_type): When true, the user exits the journey when the timer fires; when false, the user continues to convergence.. [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 + """JourneyWaitUntilExpiration - 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,) + duration_seconds (int, none_type): Seconds to wait before the timer fires. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + exits (bool, none_type): When true, the user exits the journey when the timer fires; when false, the user continues to convergence.. [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_journey_node_request.py b/onesignal/model/update_journey_node_request.py new file mode 100644 index 0000000..3d00b27 --- /dev/null +++ b/onesignal/model/update_journey_node_request.py @@ -0,0 +1,344 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_branch import JourneyBranch + from onesignal.model.journey_time_window import JourneyTimeWindow + from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration + globals()['JourneyBranch'] = JourneyBranch + globals()['JourneyTimeWindow'] = JourneyTimeWindow + globals()['JourneyWaitUntilExpiration'] = JourneyWaitUntilExpiration + + +class UpdateJourneyNodeRequest(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 = { + ('relative_to',): { + 'SCHEDULE_IN_TIMEZONE': "schedule_in_timezone", + 'LAST_ACTIVE_TIME': "last_active_time", + }, + } + + validations = { + ('duration_seconds',): { + 'inclusive_maximum': 31556952, + 'inclusive_minimum': 60, + }, + ('user_ttl_seconds',): { + 'inclusive_minimum': 1, + }, + } + + @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 { + 'client_node_id': (str,), # noqa: E501 + 'annotation': (str,), # noqa: E501 + 'duration_seconds': (int, none_type,), # noqa: E501 + 'relative_to': (str,), # noqa: E501 + 'windows': ([JourneyTimeWindow],), # noqa: E501 + 'time_zone': (str,), # noqa: E501 + 'use_user_time_zone': (bool, none_type,), # noqa: E501 + 'template_id': (str,), # noqa: E501 + 'iam_id': (str,), # noqa: E501 + 'user_ttl_seconds': (int, none_type,), # noqa: E501 + 'webhook_id': (str,), # noqa: E501 + 'assignments': ({str: (str,)},), # noqa: E501 + 'randomize_on_entry': (bool, none_type,), # noqa: E501 + 'branches': ([JourneyBranch],), # noqa: E501 + 'expiration': (JourneyWaitUntilExpiration,), # noqa: E501 + 'concurrency_key': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'client_node_id': 'client_node_id', # noqa: E501 + 'annotation': 'annotation', # noqa: E501 + 'duration_seconds': 'duration_seconds', # noqa: E501 + 'relative_to': 'relative_to', # noqa: E501 + 'windows': 'windows', # noqa: E501 + 'time_zone': 'time_zone', # noqa: E501 + 'use_user_time_zone': 'use_user_time_zone', # noqa: E501 + 'template_id': 'template_id', # noqa: E501 + 'iam_id': 'iam_id', # noqa: E501 + 'user_ttl_seconds': 'user_ttl_seconds', # noqa: E501 + 'webhook_id': 'webhook_id', # noqa: E501 + 'assignments': 'assignments', # noqa: E501 + 'randomize_on_entry': 'randomize_on_entry', # noqa: E501 + 'branches': 'branches', # noqa: E501 + 'expiration': 'expiration', # noqa: E501 + 'concurrency_key': 'concurrency_key', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateJourneyNodeRequest - 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,) + client_node_id (str): Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.. [optional] # noqa: E501 + annotation (str): Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.. [optional] # noqa: E501 + duration_seconds (int, none_type): wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + relative_to (str): time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.. [optional] # noqa: E501 + windows ([JourneyTimeWindow]): time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.. [optional] # noqa: E501 + time_zone (str): time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.. [optional] # noqa: E501 + use_user_time_zone (bool, none_type): time_window nodes: when true, uses the user's timezone if available.. [optional] # noqa: E501 + template_id (str): send_push, send_email, and send_sms nodes: UUID of the template to send.. [optional] # noqa: E501 + iam_id (str): send_iam nodes: UUID of the in-app message to send.. [optional] # noqa: E501 + user_ttl_seconds (int, none_type): send_iam nodes: optional time-to-live for the in-app message, in seconds.. [optional] # noqa: E501 + webhook_id (str): send_webhook nodes: UUID of the webhook to send.. [optional] # noqa: E501 + assignments ({str: (str,)}): tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.. [optional] # noqa: E501 + randomize_on_entry (bool, none_type): split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.. [optional] # noqa: E501 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.. [optional] # noqa: E501 + expiration (JourneyWaitUntilExpiration): [optional] # noqa: E501 + concurrency_key (str, none_type): Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node.. [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 + """UpdateJourneyNodeRequest - 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,) + client_node_id (str): Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.. [optional] # noqa: E501 + annotation (str): Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.. [optional] # noqa: E501 + duration_seconds (int, none_type): wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).. [optional] # noqa: E501 + relative_to (str): time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.. [optional] # noqa: E501 + windows ([JourneyTimeWindow]): time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.. [optional] # noqa: E501 + time_zone (str): time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.. [optional] # noqa: E501 + use_user_time_zone (bool, none_type): time_window nodes: when true, uses the user's timezone if available.. [optional] # noqa: E501 + template_id (str): send_push, send_email, and send_sms nodes: UUID of the template to send.. [optional] # noqa: E501 + iam_id (str): send_iam nodes: UUID of the in-app message to send.. [optional] # noqa: E501 + user_ttl_seconds (int, none_type): send_iam nodes: optional time-to-live for the in-app message, in seconds.. [optional] # noqa: E501 + webhook_id (str): send_webhook nodes: UUID of the webhook to send.. [optional] # noqa: E501 + assignments ({str: (str,)}): tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.. [optional] # noqa: E501 + randomize_on_entry (bool, none_type): split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.. [optional] # noqa: E501 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.. [optional] # noqa: E501 + expiration (JourneyWaitUntilExpiration): [optional] # noqa: E501 + concurrency_key (str, none_type): Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check. It is not merged onto the node.. [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_journey_request.py b/onesignal/model/update_journey_request.py new file mode 100644 index 0000000..8e1101d --- /dev/null +++ b/onesignal/model/update_journey_request.py @@ -0,0 +1,315 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + 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.journey_audience import JourneyAudience + from onesignal.model.journey_early_exit import JourneyEarlyExit + from onesignal.model.journey_node import JourneyNode + from onesignal.model.journey_reentry_rules import JourneyReentryRules + from onesignal.model.journey_schedule import JourneySchedule + globals()['JourneyAudience'] = JourneyAudience + globals()['JourneyEarlyExit'] = JourneyEarlyExit + globals()['JourneyNode'] = JourneyNode + globals()['JourneyReentryRules'] = JourneyReentryRules + globals()['JourneySchedule'] = JourneySchedule + + +class UpdateJourneyRequest(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 = { + ('state',): { + 'DRAFT': "draft", + 'SCHEDULED': "scheduled", + 'ACTIVE': "active", + 'ARCHIVED': "archived", + }, + } + + 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 + 'description': (str, none_type,), # noqa: E501 + 'audience': (JourneyAudience,), # noqa: E501 + 'early_exit': (JourneyEarlyExit,), # noqa: E501 + 'reentry_rules': (JourneyReentryRules,), # noqa: E501 + 'schedule': (JourneySchedule,), # noqa: E501 + 'nodes': ([JourneyNode],), # noqa: E501 + 'state': (str,), # noqa: E501 + 'concurrency_key': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'audience': 'audience', # noqa: E501 + 'early_exit': 'early_exit', # noqa: E501 + 'reentry_rules': 'reentry_rules', # noqa: E501 + 'schedule': 'schedule', # noqa: E501 + 'nodes': 'nodes', # noqa: E501 + 'state': 'state', # noqa: E501 + 'concurrency_key': 'concurrency_key', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateJourneyRequest - 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): Journey name.. [optional] # noqa: E501 + description (str, none_type): Journey description. Send null to clear it.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node.. [optional] # noqa: E501 + state (str): Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.. [optional] # noqa: E501 + concurrency_key (str, none_type): Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check.. [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 + """UpdateJourneyRequest - 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): Journey name.. [optional] # noqa: E501 + description (str, none_type): Journey description. Send null to clear it.. [optional] # noqa: E501 + audience (JourneyAudience): [optional] # noqa: E501 + early_exit (JourneyEarlyExit): [optional] # noqa: E501 + reentry_rules (JourneyReentryRules): [optional] # noqa: E501 + schedule (JourneySchedule): [optional] # noqa: E501 + nodes ([JourneyNode]): Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node.. [optional] # noqa: E501 + state (str): Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.. [optional] # noqa: E501 + concurrency_key (str, none_type): Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check.. [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/models/__init__.py b/onesignal/models/__init__.py index 42e0eb4..4a54d63 100644 --- a/onesignal/models/__init__.py +++ b/onesignal/models/__init__.py @@ -24,6 +24,7 @@ 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_journey_request import CreateJourneyRequest 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 @@ -46,6 +47,29 @@ 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.journey import Journey +from onesignal.model.journey_audience import JourneyAudience +from onesignal.model.journey_branch import JourneyBranch +from onesignal.model.journey_branch_stats import JourneyBranchStats +from onesignal.model.journey_condition import JourneyCondition +from onesignal.model.journey_early_exit import JourneyEarlyExit +from onesignal.model.journey_early_exit_rules import JourneyEarlyExitRules +from onesignal.model.journey_early_exit_rules_on_event import JourneyEarlyExitRulesOnEvent +from onesignal.model.journey_early_exit_rules_on_segment import JourneyEarlyExitRulesOnSegment +from onesignal.model.journey_event_attribute import JourneyEventAttribute +from onesignal.model.journey_event_trigger_attributes import JourneyEventTriggerAttributes +from onesignal.model.journey_list_audience import JourneyListAudience +from onesignal.model.journey_list_item import JourneyListItem +from onesignal.model.journey_list_response import JourneyListResponse +from onesignal.model.journey_message_stats import JourneyMessageStats +from onesignal.model.journey_node import JourneyNode +from onesignal.model.journey_node_stats import JourneyNodeStats +from onesignal.model.journey_reentry_rules import JourneyReentryRules +from onesignal.model.journey_schedule import JourneySchedule +from onesignal.model.journey_stats import JourneyStats +from onesignal.model.journey_time_point import JourneyTimePoint +from onesignal.model.journey_time_window import JourneyTimeWindow +from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration from onesignal.model.language_string_map import LanguageStringMap from onesignal.model.list_audit_logs_success_response import ListAuditLogsSuccessResponse from onesignal.model.notification import Notification @@ -79,6 +103,8 @@ 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_journey_node_request import UpdateJourneyNodeRequest +from onesignal.model.update_journey_request import UpdateJourneyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse from onesignal.model.update_segment_request import UpdateSegmentRequest diff --git a/setup.py b/setup.py index ff2f2f1..b9eec62 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onesignal_python_api" -VERSION = "5.11.3" +VERSION = "5.12.0" # To install the library, run the following # # python setup.py install diff --git a/test/test_create_journey_request.py b/test/test_create_journey_request.py new file mode 100644 index 0000000..5a0867e --- /dev/null +++ b/test/test_create_journey_request.py @@ -0,0 +1,45 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_audience import JourneyAudience +from onesignal.model.journey_early_exit import JourneyEarlyExit +from onesignal.model.journey_node import JourneyNode +from onesignal.model.journey_reentry_rules import JourneyReentryRules +from onesignal.model.journey_schedule import JourneySchedule +globals()['JourneyAudience'] = JourneyAudience +globals()['JourneyEarlyExit'] = JourneyEarlyExit +globals()['JourneyNode'] = JourneyNode +globals()['JourneyReentryRules'] = JourneyReentryRules +globals()['JourneySchedule'] = JourneySchedule +from onesignal.model.create_journey_request import CreateJourneyRequest + + +class TestCreateJourneyRequest(unittest.TestCase): + """CreateJourneyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateJourneyRequest(self): + """Test CreateJourneyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateJourneyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_default_api.py b/test/test_default_api.py index ec7a357..22729aa 100644 --- a/test/test_default_api.py +++ b/test/test_default_api.py @@ -70,6 +70,13 @@ def test_create_custom_events(self): """ pass + def test_create_journey(self): + """Test case for create_journey + + Create journey # noqa: E501 + """ + pass + def test_create_notification(self): """Test case for create_notification @@ -116,6 +123,13 @@ def test_delete_api_key(self): """ pass + def test_delete_journey(self): + """Test case for delete_journey + + Delete journey # noqa: E501 + """ + pass + def test_delete_segment(self): """Test case for delete_segment @@ -278,6 +292,20 @@ def test_update_app(self): """ pass + def test_update_journey(self): + """Test case for update_journey + + Update journey # noqa: E501 + """ + pass + + def test_update_journey_node(self): + """Test case for update_journey_node + + Update journey node # noqa: E501 + """ + pass + def test_update_live_activity(self): """Test case for update_live_activity @@ -325,6 +353,27 @@ def test_view_api_keys(self): """ pass + def test_view_journey(self): + """Test case for view_journey + + View journey # noqa: E501 + """ + pass + + def test_view_journey_stats(self): + """Test case for view_journey_stats + + View journey stats # noqa: E501 + """ + pass + + def test_view_journeys(self): + """Test case for view_journeys + + View journeys # noqa: E501 + """ + pass + def test_view_template(self): """Test case for view_template diff --git a/test/test_journey.py b/test/test_journey.py new file mode 100644 index 0000000..32dc59c --- /dev/null +++ b/test/test_journey.py @@ -0,0 +1,45 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_audience import JourneyAudience +from onesignal.model.journey_early_exit import JourneyEarlyExit +from onesignal.model.journey_node import JourneyNode +from onesignal.model.journey_reentry_rules import JourneyReentryRules +from onesignal.model.journey_schedule import JourneySchedule +globals()['JourneyAudience'] = JourneyAudience +globals()['JourneyEarlyExit'] = JourneyEarlyExit +globals()['JourneyNode'] = JourneyNode +globals()['JourneyReentryRules'] = JourneyReentryRules +globals()['JourneySchedule'] = JourneySchedule +from onesignal.model.journey import Journey + + +class TestJourney(unittest.TestCase): + """Journey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourney(self): + """Test Journey""" + # FIXME: construct object with mandatory attributes with example values + # model = Journey() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_audience.py b/test/test_journey_audience.py new file mode 100644 index 0000000..a0899f3 --- /dev/null +++ b/test/test_journey_audience.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_event_trigger_attributes import JourneyEventTriggerAttributes +globals()['JourneyEventTriggerAttributes'] = JourneyEventTriggerAttributes +from onesignal.model.journey_audience import JourneyAudience + + +class TestJourneyAudience(unittest.TestCase): + """JourneyAudience unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyAudience(self): + """Test JourneyAudience""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyAudience() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_branch.py b/test/test_journey_branch.py new file mode 100644 index 0000000..04c9a19 --- /dev/null +++ b/test/test_journey_branch.py @@ -0,0 +1,39 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_condition import JourneyCondition +from onesignal.model.journey_node import JourneyNode +globals()['JourneyCondition'] = JourneyCondition +globals()['JourneyNode'] = JourneyNode +from onesignal.model.journey_branch import JourneyBranch + + +class TestJourneyBranch(unittest.TestCase): + """JourneyBranch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyBranch(self): + """Test JourneyBranch""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyBranch() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_branch_stats.py b/test/test_journey_branch_stats.py new file mode 100644 index 0000000..6b72b11 --- /dev/null +++ b/test/test_journey_branch_stats.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_branch_stats import JourneyBranchStats + + +class TestJourneyBranchStats(unittest.TestCase): + """JourneyBranchStats unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyBranchStats(self): + """Test JourneyBranchStats""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyBranchStats() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_condition.py b/test/test_journey_condition.py new file mode 100644 index 0000000..d858682 --- /dev/null +++ b/test/test_journey_condition.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_event_trigger_attributes import JourneyEventTriggerAttributes +globals()['JourneyEventTriggerAttributes'] = JourneyEventTriggerAttributes +from onesignal.model.journey_condition import JourneyCondition + + +class TestJourneyCondition(unittest.TestCase): + """JourneyCondition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyCondition(self): + """Test JourneyCondition""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyCondition() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_early_exit.py b/test/test_journey_early_exit.py new file mode 100644 index 0000000..36dcbc4 --- /dev/null +++ b/test/test_journey_early_exit.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_early_exit_rules import JourneyEarlyExitRules +globals()['JourneyEarlyExitRules'] = JourneyEarlyExitRules +from onesignal.model.journey_early_exit import JourneyEarlyExit + + +class TestJourneyEarlyExit(unittest.TestCase): + """JourneyEarlyExit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEarlyExit(self): + """Test JourneyEarlyExit""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEarlyExit() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_early_exit_rules.py b/test/test_journey_early_exit_rules.py new file mode 100644 index 0000000..e39308f --- /dev/null +++ b/test/test_journey_early_exit_rules.py @@ -0,0 +1,39 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_early_exit_rules_on_event import JourneyEarlyExitRulesOnEvent +from onesignal.model.journey_early_exit_rules_on_segment import JourneyEarlyExitRulesOnSegment +globals()['JourneyEarlyExitRulesOnEvent'] = JourneyEarlyExitRulesOnEvent +globals()['JourneyEarlyExitRulesOnSegment'] = JourneyEarlyExitRulesOnSegment +from onesignal.model.journey_early_exit_rules import JourneyEarlyExitRules + + +class TestJourneyEarlyExitRules(unittest.TestCase): + """JourneyEarlyExitRules unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEarlyExitRules(self): + """Test JourneyEarlyExitRules""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEarlyExitRules() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_early_exit_rules_on_event.py b/test/test_journey_early_exit_rules_on_event.py new file mode 100644 index 0000000..5782035 --- /dev/null +++ b/test/test_journey_early_exit_rules_on_event.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_early_exit_rules_on_event import JourneyEarlyExitRulesOnEvent + + +class TestJourneyEarlyExitRulesOnEvent(unittest.TestCase): + """JourneyEarlyExitRulesOnEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEarlyExitRulesOnEvent(self): + """Test JourneyEarlyExitRulesOnEvent""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEarlyExitRulesOnEvent() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_early_exit_rules_on_segment.py b/test/test_journey_early_exit_rules_on_segment.py new file mode 100644 index 0000000..4004bb4 --- /dev/null +++ b/test/test_journey_early_exit_rules_on_segment.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_early_exit_rules_on_segment import JourneyEarlyExitRulesOnSegment + + +class TestJourneyEarlyExitRulesOnSegment(unittest.TestCase): + """JourneyEarlyExitRulesOnSegment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEarlyExitRulesOnSegment(self): + """Test JourneyEarlyExitRulesOnSegment""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEarlyExitRulesOnSegment() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_event_attribute.py b/test/test_journey_event_attribute.py new file mode 100644 index 0000000..4ac1024 --- /dev/null +++ b/test/test_journey_event_attribute.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_event_attribute import JourneyEventAttribute + + +class TestJourneyEventAttribute(unittest.TestCase): + """JourneyEventAttribute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEventAttribute(self): + """Test JourneyEventAttribute""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEventAttribute() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_event_trigger_attributes.py b/test/test_journey_event_trigger_attributes.py new file mode 100644 index 0000000..bd09af3 --- /dev/null +++ b/test/test_journey_event_trigger_attributes.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_event_attribute import JourneyEventAttribute +globals()['JourneyEventAttribute'] = JourneyEventAttribute +from onesignal.model.journey_event_trigger_attributes import JourneyEventTriggerAttributes + + +class TestJourneyEventTriggerAttributes(unittest.TestCase): + """JourneyEventTriggerAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyEventTriggerAttributes(self): + """Test JourneyEventTriggerAttributes""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyEventTriggerAttributes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_list_audience.py b/test/test_journey_list_audience.py new file mode 100644 index 0000000..311a0e9 --- /dev/null +++ b/test/test_journey_list_audience.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_list_audience import JourneyListAudience + + +class TestJourneyListAudience(unittest.TestCase): + """JourneyListAudience unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyListAudience(self): + """Test JourneyListAudience""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyListAudience() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_list_item.py b/test/test_journey_list_item.py new file mode 100644 index 0000000..b032745 --- /dev/null +++ b/test/test_journey_list_item.py @@ -0,0 +1,41 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_list_audience import JourneyListAudience +from onesignal.model.journey_reentry_rules import JourneyReentryRules +from onesignal.model.journey_schedule import JourneySchedule +globals()['JourneyListAudience'] = JourneyListAudience +globals()['JourneyReentryRules'] = JourneyReentryRules +globals()['JourneySchedule'] = JourneySchedule +from onesignal.model.journey_list_item import JourneyListItem + + +class TestJourneyListItem(unittest.TestCase): + """JourneyListItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyListItem(self): + """Test JourneyListItem""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyListItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_list_response.py b/test/test_journey_list_response.py new file mode 100644 index 0000000..d796efe --- /dev/null +++ b/test/test_journey_list_response.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_list_item import JourneyListItem +globals()['JourneyListItem'] = JourneyListItem +from onesignal.model.journey_list_response import JourneyListResponse + + +class TestJourneyListResponse(unittest.TestCase): + """JourneyListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyListResponse(self): + """Test JourneyListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_message_stats.py b/test/test_journey_message_stats.py new file mode 100644 index 0000000..39d7d09 --- /dev/null +++ b/test/test_journey_message_stats.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_message_stats import JourneyMessageStats + + +class TestJourneyMessageStats(unittest.TestCase): + """JourneyMessageStats unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyMessageStats(self): + """Test JourneyMessageStats""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyMessageStats() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_node.py b/test/test_journey_node.py new file mode 100644 index 0000000..3b88295 --- /dev/null +++ b/test/test_journey_node.py @@ -0,0 +1,41 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_branch import JourneyBranch +from onesignal.model.journey_time_window import JourneyTimeWindow +from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration +globals()['JourneyBranch'] = JourneyBranch +globals()['JourneyTimeWindow'] = JourneyTimeWindow +globals()['JourneyWaitUntilExpiration'] = JourneyWaitUntilExpiration +from onesignal.model.journey_node import JourneyNode + + +class TestJourneyNode(unittest.TestCase): + """JourneyNode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyNode(self): + """Test JourneyNode""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyNode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_node_stats.py b/test/test_journey_node_stats.py new file mode 100644 index 0000000..b03b8a3 --- /dev/null +++ b/test/test_journey_node_stats.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_message_stats import JourneyMessageStats +globals()['JourneyMessageStats'] = JourneyMessageStats +from onesignal.model.journey_node_stats import JourneyNodeStats + + +class TestJourneyNodeStats(unittest.TestCase): + """JourneyNodeStats unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyNodeStats(self): + """Test JourneyNodeStats""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyNodeStats() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_reentry_rules.py b/test/test_journey_reentry_rules.py new file mode 100644 index 0000000..582b517 --- /dev/null +++ b/test/test_journey_reentry_rules.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_reentry_rules import JourneyReentryRules + + +class TestJourneyReentryRules(unittest.TestCase): + """JourneyReentryRules unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyReentryRules(self): + """Test JourneyReentryRules""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyReentryRules() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_schedule.py b/test/test_journey_schedule.py new file mode 100644 index 0000000..d5f2353 --- /dev/null +++ b/test/test_journey_schedule.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_schedule import JourneySchedule + + +class TestJourneySchedule(unittest.TestCase): + """JourneySchedule unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneySchedule(self): + """Test JourneySchedule""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneySchedule() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_stats.py b/test/test_journey_stats.py new file mode 100644 index 0000000..7c77d37 --- /dev/null +++ b/test/test_journey_stats.py @@ -0,0 +1,39 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_branch_stats import JourneyBranchStats +from onesignal.model.journey_node_stats import JourneyNodeStats +globals()['JourneyBranchStats'] = JourneyBranchStats +globals()['JourneyNodeStats'] = JourneyNodeStats +from onesignal.model.journey_stats import JourneyStats + + +class TestJourneyStats(unittest.TestCase): + """JourneyStats unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyStats(self): + """Test JourneyStats""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyStats() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_time_point.py b/test/test_journey_time_point.py new file mode 100644 index 0000000..d14ad38 --- /dev/null +++ b/test/test_journey_time_point.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_time_point import JourneyTimePoint + + +class TestJourneyTimePoint(unittest.TestCase): + """JourneyTimePoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyTimePoint(self): + """Test JourneyTimePoint""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyTimePoint() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_time_window.py b/test/test_journey_time_window.py new file mode 100644 index 0000000..6de74b6 --- /dev/null +++ b/test/test_journey_time_window.py @@ -0,0 +1,37 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_time_point import JourneyTimePoint +globals()['JourneyTimePoint'] = JourneyTimePoint +from onesignal.model.journey_time_window import JourneyTimeWindow + + +class TestJourneyTimeWindow(unittest.TestCase): + """JourneyTimeWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyTimeWindow(self): + """Test JourneyTimeWindow""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyTimeWindow() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_journey_wait_until_expiration.py b/test/test_journey_wait_until_expiration.py new file mode 100644 index 0000000..ff63356 --- /dev/null +++ b/test/test_journey_wait_until_expiration.py @@ -0,0 +1,35 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration + + +class TestJourneyWaitUntilExpiration(unittest.TestCase): + """JourneyWaitUntilExpiration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testJourneyWaitUntilExpiration(self): + """Test JourneyWaitUntilExpiration""" + # FIXME: construct object with mandatory attributes with example values + # model = JourneyWaitUntilExpiration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_journey_node_request.py b/test/test_update_journey_node_request.py new file mode 100644 index 0000000..70ba91c --- /dev/null +++ b/test/test_update_journey_node_request.py @@ -0,0 +1,41 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_branch import JourneyBranch +from onesignal.model.journey_time_window import JourneyTimeWindow +from onesignal.model.journey_wait_until_expiration import JourneyWaitUntilExpiration +globals()['JourneyBranch'] = JourneyBranch +globals()['JourneyTimeWindow'] = JourneyTimeWindow +globals()['JourneyWaitUntilExpiration'] = JourneyWaitUntilExpiration +from onesignal.model.update_journey_node_request import UpdateJourneyNodeRequest + + +class TestUpdateJourneyNodeRequest(unittest.TestCase): + """UpdateJourneyNodeRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateJourneyNodeRequest(self): + """Test UpdateJourneyNodeRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateJourneyNodeRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_journey_request.py b/test/test_update_journey_request.py new file mode 100644 index 0000000..0f4464a --- /dev/null +++ b/test/test_update_journey_request.py @@ -0,0 +1,45 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.journey_audience import JourneyAudience +from onesignal.model.journey_early_exit import JourneyEarlyExit +from onesignal.model.journey_node import JourneyNode +from onesignal.model.journey_reentry_rules import JourneyReentryRules +from onesignal.model.journey_schedule import JourneySchedule +globals()['JourneyAudience'] = JourneyAudience +globals()['JourneyEarlyExit'] = JourneyEarlyExit +globals()['JourneyNode'] = JourneyNode +globals()['JourneyReentryRules'] = JourneyReentryRules +globals()['JourneySchedule'] = JourneySchedule +from onesignal.model.update_journey_request import UpdateJourneyRequest + + +class TestUpdateJourneyRequest(unittest.TestCase): + """UpdateJourneyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateJourneyRequest(self): + """Test UpdateJourneyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateJourneyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()