From d55b409ecaa623f71d3edb0d755012a444cb511d Mon Sep 17 00:00:00 2001 From: OneSignal Date: Fri, 2 Oct 2026 21:10:56 +0000 Subject: [PATCH] feat: add v5.17.0 package updates --- README.md | 4 +- docs/DefaultApi.md | 208 +++++++++++- docs/DuplicateJourneyOverrides.md | 19 ++ docs/DuplicateJourneyRequest.md | 13 + docs/Journey.md | 2 +- docs/JourneyNode.md | 4 +- docs/UpdateJourneyNodeRequest.md | 4 +- onesignal/__init__.py | 2 +- onesignal/api/default_api.py | 158 ++++++++- onesignal/api_client.py | 4 +- onesignal/configuration.py | 4 +- .../model/duplicate_journey_overrides.py | 301 ++++++++++++++++++ onesignal/model/duplicate_journey_request.py | 269 ++++++++++++++++ onesignal/model/journey_node.py | 8 +- .../model/update_journey_node_request.py | 8 +- onesignal/models/__init__.py | 2 + setup.py | 2 +- test/test_default_api.py | 7 + test/test_duplicate_journey_overrides.py | 45 +++ test/test_duplicate_journey_request.py | 37 +++ 20 files changed, 1071 insertions(+), 30 deletions(-) create mode 100644 docs/DuplicateJourneyOverrides.md create mode 100644 docs/DuplicateJourneyRequest.md create mode 100644 onesignal/model/duplicate_journey_overrides.py create mode 100644 onesignal/model/duplicate_journey_request.py create mode 100644 test/test_duplicate_journey_overrides.py create mode 100644 test/test_duplicate_journey_request.py diff --git a/README.md b/README.md index bcb7c73..3850cb1 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.16.0 -- Package version: 5.16.0 +- API version: 5.17.0 +- Package version: 5.17.0 ## Requirements diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 1635dac..452e2b2 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -24,6 +24,7 @@ Method | HTTP request | Description [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | [**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**duplicate_journey**](DefaultApi.md#duplicate_journey) | **POST** /apps/{app_id}/journeys/{journey_id}/duplicate | Duplicate journey [**estimate_notification_recipients**](DefaultApi.md#estimate_notification_recipients) | **POST** /notifications/count-unsaved | Estimate notification recipients [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions @@ -1832,7 +1833,7 @@ 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. - segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # The segment_id can be found in the URL of the segment when viewing it in the dashboard. + segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. try: # Delete Segment @@ -1850,7 +1851,7 @@ with onesignal.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | - **segment_id** | **str**| The segment_id can be found in the URL of the segment when viewing it in the dashboard. | + **segment_id** | **str**| The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. | ### Return type @@ -2107,6 +2108,201 @@ void (empty response body) [[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) +# **duplicate_journey** +> Journey duplicate_journey(app_id, journey_id) + +Duplicate journey + +The Journeys API is in beta. Endpoints and response fields can still change. Copy an existing journey into a new draft. The source does not change. The copy is always a draft, and started_at and archived_at are null. If you omit the body, or omit overrides, the copy keeps the source description, audience, nodes, early_exit, and reentry_rules. The copy takes the source name plus \" (Copy)\". The copy does not keep schedule. Send schedule under overrides to set it. Server-controlled fields are rejected with 400. 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. + journey_id = "YOUR_JOURNEY_ID" # UUID of the journey to copy. + duplicate_journey_request = DuplicateJourneyRequest( + overrides=DuplicateJourneyOverrides( + 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: + # Duplicate journey + api_response = api_instance.duplicate_journey(app_id, journey_id, duplicate_journey_request=duplicate_journey_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->duplicate_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 copy. | + **duplicate_journey_request** | [**DuplicateJourneyRequest**](DuplicateJourneyRequest.md)| | [optional] + +### 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 | - | +**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) + # **estimate_notification_recipients** > EstimateNotificationRecipientsSuccessResponse estimate_notification_recipients(estimate_notification_recipients_request) @@ -3068,7 +3264,7 @@ 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. - segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # 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. + segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. include_segment_detail = True # Set to true to include segment metadata and filters in the response. (optional) try: @@ -3087,7 +3283,7 @@ with onesignal.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | - **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. | + **segment_id** | **str**| The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. | **include_segment_detail** | **bool**| Set to true to include segment metadata and filters in the response. | [optional] ### Return type @@ -4585,7 +4781,7 @@ 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. - segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # 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. + segment_id = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e" # The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. update_segment_request = UpdateSegmentRequest( name="name_example", description="description_example", @@ -4619,7 +4815,7 @@ with onesignal.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **app_id** | **str**| The OneSignal App ID for your app. Available in Keys & IDs. | - **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. | + **segment_id** | **str**| The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. | **update_segment_request** | [**UpdateSegmentRequest**](UpdateSegmentRequest.md)| | [optional] ### Return type diff --git a/docs/DuplicateJourneyOverrides.md b/docs/DuplicateJourneyOverrides.md new file mode 100644 index 0000000..f829d1f --- /dev/null +++ b/docs/DuplicateJourneyOverrides.md @@ -0,0 +1,19 @@ +# DuplicateJourneyOverrides + +Journey fields to apply over the copy as a JSON Merge Patch (RFC 7396). Accepts the same writable fields as Create journey, and none of them are required. The patch merges into the copy, not the source. The copy starts without a schedule, so an omitted schedule leaves the copy unscheduled. An object merges key by key. A null value clears a nullable field. An array such as nodes replaces the copied array. Server-controlled fields such as id or state are rejected. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name for the copy, up to 300 characters. If you omit it, the copy takes the name of the source plus \" (Copy)\". | [optional] +**description** | **str, none_type** | Optional journey description, up to 1024 characters. If you omit it, the copy takes the description of the source. 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. Replaces the copied graph. Server-assigned id fields are rejected. | [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/DuplicateJourneyRequest.md b/docs/DuplicateJourneyRequest.md new file mode 100644 index 0000000..525b255 --- /dev/null +++ b/docs/DuplicateJourneyRequest.md @@ -0,0 +1,13 @@ +# DuplicateJourneyRequest + +Optional body for Duplicate journey. Only overrides is applied. A journey field sent at the top level is ignored. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overrides** | [**DuplicateJourneyOverrides**](DuplicateJourneyOverrides.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/Journey.md b/docs/Journey.md index 49116bf..63d60e4 100644 --- a/docs/Journey.md +++ b/docs/Journey.md @@ -1,6 +1,6 @@ # Journey -Full journey representation returned by the detail, create, and update endpoints. +Full journey representation returned by the detail, create, update, and duplicate endpoints. ## Properties Name | Type | Description | Notes diff --git a/docs/JourneyNode.md b/docs/JourneyNode.md index dbbb61c..ac8d733 100644 --- a/docs/JourneyNode.md +++ b/docs/JourneyNode.md @@ -8,7 +8,7 @@ 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] +**annotation** | **str** | Optional free-text label, up to 1024 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] @@ -20,7 +20,7 @@ Name | Type | Description | Notes **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] +**branches** | [**[JourneyBranch]**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 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] diff --git a/docs/UpdateJourneyNodeRequest.md b/docs/UpdateJourneyNodeRequest.md index 53c4784..375a266 100644 --- a/docs/UpdateJourneyNodeRequest.md +++ b/docs/UpdateJourneyNodeRequest.md @@ -6,7 +6,7 @@ Node fields to change, merged onto the current node. Send only the fields you wa 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] +**annotation** | **str** | Optional free-text label, up to 1024 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] @@ -18,7 +18,7 @@ Name | Type | Description | Notes **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] +**branches** | [**[JourneyBranch]**](JourneyBranch.md) | Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 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] diff --git a/onesignal/__init__.py b/onesignal/__init__.py index 00b59df..2cd6320 100644 --- a/onesignal/__init__.py +++ b/onesignal/__init__.py @@ -10,7 +10,7 @@ """ -__version__ = "5.16.0" +__version__ = "5.17.0" # import ApiClient from onesignal.api_client import ApiClient diff --git a/onesignal/api/default_api.py b/onesignal/api/default_api.py index 2739b71..1aba21b 100644 --- a/onesignal/api/default_api.py +++ b/onesignal/api/default_api.py @@ -34,6 +34,7 @@ from onesignal.model.create_template_request import CreateTemplateRequest from onesignal.model.create_user_conflict_response import CreateUserConflictResponse from onesignal.model.custom_events_request import CustomEventsRequest +from onesignal.model.duplicate_journey_request import DuplicateJourneyRequest from onesignal.model.email_reputation_response import EmailReputationResponse from onesignal.model.estimate_notification_recipients_request import EstimateNotificationRecipientsRequest from onesignal.model.estimate_notification_recipients_success_response import EstimateNotificationRecipientsSuccessResponse @@ -1274,6 +1275,69 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.duplicate_journey_endpoint = _Endpoint( + settings={ + 'response_type': (Journey,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/journeys/{journey_id}/duplicate', + 'operation_id': 'duplicate_journey', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'journey_id', + 'duplicate_journey_request', + ], + 'required': [ + 'app_id', + 'journey_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'journey_id': + (str,), + 'duplicate_journey_request': + (DuplicateJourneyRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'journey_id': 'journey_id', + }, + 'location_map': { + 'app_id': 'path', + 'journey_id': 'path', + 'duplicate_journey_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.estimate_notification_recipients_endpoint = _Endpoint( settings={ 'response_type': (EstimateNotificationRecipientsSuccessResponse,), @@ -4998,7 +5062,7 @@ def delete_segment( Args: app_id (str): The OneSignal App ID for your app. Available in Keys & IDs. - segment_id (str): The segment_id can be found in the URL of the segment when viewing it in the dashboard. + segment_id (str): The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. Keyword Args: _return_http_data_only (bool): response data without head status @@ -5333,6 +5397,94 @@ def delete_user( alias_id return self.delete_user_endpoint.call_with_http_info(**kwargs) + def duplicate_journey( + self, + app_id, + journey_id, + **kwargs + ): + """Duplicate journey # noqa: E501 + + The Journeys API is in beta. Endpoints and response fields can still change. Copy an existing journey into a new draft. The source does not change. The copy is always a draft, and started_at and archived_at are null. If you omit the body, or omit overrides, the copy keeps the source description, audience, nodes, early_exit, and reentry_rules. The copy takes the source name plus \" (Copy)\". The copy does not keep schedule. Send schedule under overrides to set it. Server-controlled fields are rejected with 400. 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.duplicate_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 copy. + + Keyword Args: + duplicate_journey_request (DuplicateJourneyRequest): [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: + 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 + return self.duplicate_journey_endpoint.call_with_http_info(**kwargs) + def estimate_notification_recipients( self, estimate_notification_recipients_request, @@ -6378,7 +6530,7 @@ def get_segment( 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. + segment_id (str): The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. Keyword Args: include_segment_detail (bool): Set to true to include segment metadata and filters in the response.. [optional] @@ -7551,7 +7703,7 @@ def update_segment( 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. + segment_id (str): The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard. Keyword Args: update_segment_request (UpdateSegmentRequest): [optional] diff --git a/onesignal/api_client.py b/onesignal/api_client.py index 0261412..7f3f948 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.16.0/python' + self.user_agent = 'OpenAPI-Generator/5.17.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.16.0" + header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.17.0" if self.cookie: header_params['Cookie'] = self.cookie if header_params: diff --git a/onesignal/configuration.py b/onesignal/configuration.py index f66f48e..a3b6bd1 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.16.0\n"\ - "SDK Package Version: 5.16.0".\ + "Version of the API: 5.17.0\n"\ + "SDK Package Version: 5.17.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onesignal/model/duplicate_journey_overrides.py b/onesignal/model/duplicate_journey_overrides.py new file mode 100644 index 0000000..d515e1e --- /dev/null +++ b/onesignal/model/duplicate_journey_overrides.py @@ -0,0 +1,301 @@ +""" + 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 DuplicateJourneyOverrides(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, *args, **kwargs): # noqa: E501 + """DuplicateJourneyOverrides - 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): Name for the copy, up to 300 characters. If you omit it, the copy takes the name of the source plus \" (Copy)\".. [optional] # noqa: E501 + description (str, none_type): Optional journey description, up to 1024 characters. If you omit it, the copy takes the description of the source. 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. Replaces the copied graph. Server-assigned id fields are rejected.. [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 + """DuplicateJourneyOverrides - 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): Name for the copy, up to 300 characters. If you omit it, the copy takes the name of the source plus \" (Copy)\".. [optional] # noqa: E501 + description (str, none_type): Optional journey description, up to 1024 characters. If you omit it, the copy takes the description of the source. 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. Replaces the copied graph. Server-assigned id fields are rejected.. [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/duplicate_journey_request.py b/onesignal/model/duplicate_journey_request.py new file mode 100644 index 0000000..3f871c0 --- /dev/null +++ b/onesignal/model/duplicate_journey_request.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 + + +def lazy_import(): + from onesignal.model.duplicate_journey_overrides import DuplicateJourneyOverrides + globals()['DuplicateJourneyOverrides'] = DuplicateJourneyOverrides + + +class DuplicateJourneyRequest(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 { + 'overrides': (DuplicateJourneyOverrides,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'overrides': 'overrides', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DuplicateJourneyRequest - 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,) + overrides (DuplicateJourneyOverrides): [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 + """DuplicateJourneyRequest - 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,) + overrides (DuplicateJourneyOverrides): [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 index e06f4a9..216538b 100644 --- a/onesignal/model/journey_node.py +++ b/onesignal/model/journey_node.py @@ -205,7 +205,7 @@ def _from_openapi_data(cls, kind, *args, **kwargs): # noqa: E501 _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 + annotation (str): Optional free-text label, up to 1024 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 @@ -217,7 +217,7 @@ def _from_openapi_data(cls, kind, *args, **kwargs): # 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 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches.. [optional] # noqa: E501 expiration (JourneyWaitUntilExpiration): [optional] # noqa: E501 """ @@ -310,7 +310,7 @@ def __init__(self, kind, *args, **kwargs): # noqa: E501 _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 + annotation (str): Optional free-text label, up to 1024 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 @@ -322,7 +322,7 @@ def __init__(self, kind, *args, **kwargs): # 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 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches.. [optional] # noqa: E501 expiration (JourneyWaitUntilExpiration): [optional] # noqa: E501 """ diff --git a/onesignal/model/update_journey_node_request.py b/onesignal/model/update_journey_node_request.py index 3d00b27..c502879 100644 --- a/onesignal/model/update_journey_node_request.py +++ b/onesignal/model/update_journey_node_request.py @@ -186,7 +186,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 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 + annotation (str): Optional free-text label, up to 1024 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 @@ -198,7 +198,7 @@ def _from_openapi_data(cls, *args, **kwargs): # 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 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 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 """ @@ -287,7 +287,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 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 + annotation (str): Optional free-text label, up to 1024 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 @@ -299,7 +299,7 @@ def __init__(self, *args, **kwargs): # 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 + branches ([JourneyBranch]): Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 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 """ diff --git a/onesignal/models/__init__.py b/onesignal/models/__init__.py index 69ab915..dc92adc 100644 --- a/onesignal/models/__init__.py +++ b/onesignal/models/__init__.py @@ -35,6 +35,8 @@ from onesignal.model.custom_event import CustomEvent from onesignal.model.custom_events_request import CustomEventsRequest from onesignal.model.delivery_data import DeliveryData +from onesignal.model.duplicate_journey_overrides import DuplicateJourneyOverrides +from onesignal.model.duplicate_journey_request import DuplicateJourneyRequest from onesignal.model.email_reputation_response import EmailReputationResponse from onesignal.model.email_reputation_window import EmailReputationWindow from onesignal.model.email_warm_up import EmailWarmUp diff --git a/setup.py b/setup.py index 231c933..95b8fbe 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.16.0" +VERSION = "5.17.0" # To install the library, run the following # # python setup.py install diff --git a/test/test_default_api.py b/test/test_default_api.py index 4775328..0cf95a2 100644 --- a/test/test_default_api.py +++ b/test/test_default_api.py @@ -156,6 +156,13 @@ def test_delete_user(self): """ pass + def test_duplicate_journey(self): + """Test case for duplicate_journey + + Duplicate journey # noqa: E501 + """ + pass + def test_estimate_notification_recipients(self): """Test case for estimate_notification_recipients diff --git a/test/test_duplicate_journey_overrides.py b/test/test_duplicate_journey_overrides.py new file mode 100644 index 0000000..992e1f6 --- /dev/null +++ b/test/test_duplicate_journey_overrides.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.duplicate_journey_overrides import DuplicateJourneyOverrides + + +class TestDuplicateJourneyOverrides(unittest.TestCase): + """DuplicateJourneyOverrides unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDuplicateJourneyOverrides(self): + """Test DuplicateJourneyOverrides""" + # FIXME: construct object with mandatory attributes with example values + # model = DuplicateJourneyOverrides() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_duplicate_journey_request.py b/test/test_duplicate_journey_request.py new file mode 100644 index 0000000..fa06a62 --- /dev/null +++ b/test/test_duplicate_journey_request.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.duplicate_journey_overrides import DuplicateJourneyOverrides +globals()['DuplicateJourneyOverrides'] = DuplicateJourneyOverrides +from onesignal.model.duplicate_journey_request import DuplicateJourneyRequest + + +class TestDuplicateJourneyRequest(unittest.TestCase): + """DuplicateJourneyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDuplicateJourneyRequest(self): + """Test DuplicateJourneyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = DuplicateJourneyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()