From 3ab06376a21178f73dab3a61d0f3045386169fa3 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Mon, 27 Jul 2026 23:21:15 +0000 Subject: [PATCH] feat: add v5.10.0 package updates --- docs/AuditLogActor.md | 17 + docs/AuditLogContext.md | 16 + docs/AuditLogEvent.md | 21 + docs/AuditLogTarget.md | 16 + docs/DefaultApi.md | 289 +++++++++ docs/GetSegmentSuccessResponse.md | 13 + docs/ListAuditLogsSuccessResponse.md | 14 + docs/SegmentDetails.md | 18 + docs/UpdateSegmentRequest.md | 14 + docs/UpdateSegmentSuccessResponse.md | 13 + onesignal/api/default_api.py | 547 ++++++++++++++++++ onesignal/model/audit_log_actor.py | 280 +++++++++ onesignal/model/audit_log_context.py | 276 +++++++++ onesignal/model/audit_log_event.py | 310 ++++++++++ onesignal/model/audit_log_target.py | 276 +++++++++ .../model/get_segment_success_response.py | 274 +++++++++ .../model/list_audit_logs_success_response.py | 278 +++++++++ onesignal/model/segment_details.py | 295 ++++++++++ onesignal/model/update_segment_request.py | 290 ++++++++++ .../model/update_segment_success_response.py | 268 +++++++++ onesignal/models/__init__.py | 9 + test/test_audit_log_actor.py | 36 ++ test/test_audit_log_context.py | 36 ++ test/test_audit_log_event.py | 42 ++ test/test_audit_log_target.py | 36 ++ test/test_default_api.py | 21 + test/test_get_segment_success_response.py | 38 ++ test/test_list_audit_logs_success_response.py | 38 ++ test/test_segment_details.py | 38 ++ test/test_update_segment_request.py | 38 ++ test/test_update_segment_success_response.py | 36 ++ 31 files changed, 3893 insertions(+) create mode 100644 docs/AuditLogActor.md create mode 100644 docs/AuditLogContext.md create mode 100644 docs/AuditLogEvent.md create mode 100644 docs/AuditLogTarget.md create mode 100644 docs/GetSegmentSuccessResponse.md create mode 100644 docs/ListAuditLogsSuccessResponse.md create mode 100644 docs/SegmentDetails.md create mode 100644 docs/UpdateSegmentRequest.md create mode 100644 docs/UpdateSegmentSuccessResponse.md create mode 100644 onesignal/model/audit_log_actor.py create mode 100644 onesignal/model/audit_log_context.py create mode 100644 onesignal/model/audit_log_event.py create mode 100644 onesignal/model/audit_log_target.py create mode 100644 onesignal/model/get_segment_success_response.py create mode 100644 onesignal/model/list_audit_logs_success_response.py create mode 100644 onesignal/model/segment_details.py create mode 100644 onesignal/model/update_segment_request.py create mode 100644 onesignal/model/update_segment_success_response.py create mode 100644 test/test_audit_log_actor.py create mode 100644 test/test_audit_log_context.py create mode 100644 test/test_audit_log_event.py create mode 100644 test/test_audit_log_target.py create mode 100644 test/test_get_segment_success_response.py create mode 100644 test/test_list_audit_logs_success_response.py create mode 100644 test/test_segment_details.py create mode 100644 test/test_update_segment_request.py create mode 100644 test/test_update_segment_success_response.py diff --git a/docs/AuditLogActor.md b/docs/AuditLogActor.md new file mode 100644 index 0000000..3d8f26e --- /dev/null +++ b/docs/AuditLogActor.md @@ -0,0 +1,17 @@ +# AuditLogActor + +The user or service that performed the action. Absent if the actor is unknown. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Email address of the actor. Absent if unavailable. | [optional] +**id** | **str** | UUID of the actor. | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Additional actor-specific data. | [optional] +**name** | **str** | Display name of the actor. Absent if unavailable. | [optional] +**type** | **str** | Actor type (e.g. member, api_key, system). | [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/AuditLogContext.md b/docs/AuditLogContext.md new file mode 100644 index 0000000..e7047ad --- /dev/null +++ b/docs/AuditLogContext.md @@ -0,0 +1,16 @@ +# AuditLogContext + +Request context at the time of the event. Absent if context was not captured. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | Country code derived from the request IP. | [optional] +**ip** | **str** | IP address the request originated from. | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Additional context-specific data. | [optional] +**user_agent** | **str** | User agent of the client that made the request. | [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/AuditLogEvent.md b/docs/AuditLogEvent.md new file mode 100644 index 0000000..49d4640 --- /dev/null +++ b/docs/AuditLogEvent.md @@ -0,0 +1,21 @@ +# AuditLogEvent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | The action that was performed (e.g. notification.sent, segment.created, member.invited). | [optional] +**actor** | [**AuditLogActor**](AuditLogActor.md) | | [optional] +**app_id** | **str** | UUID of the app the event is associated with. Absent for org-level events. | [optional] +**context** | [**AuditLogContext**](AuditLogContext.md) | | [optional] +**id** | **str** | UUID of the audit log event. | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Additional event-specific data that does not fit into the standard fields. | [optional] +**occurred_at** | **str** | RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). | [optional] +**organization_id** | **str** | UUID of the organization the event belongs to. | [optional] +**targets** | [**[AuditLogTarget]**](AuditLogTarget.md) | The resources the action was performed on. May be empty for org-level events. | [optional] +**version** | **int** | Schema version of the event payload. | [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/AuditLogTarget.md b/docs/AuditLogTarget.md new file mode 100644 index 0000000..929483d --- /dev/null +++ b/docs/AuditLogTarget.md @@ -0,0 +1,16 @@ +# AuditLogTarget + +A resource the action was performed on. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | UUID of the resource. | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Additional resource-specific data. | [optional] +**name** | **str** | Display name of the resource. Absent if unavailable. | [optional] +**type** | **str** | Resource type (e.g. notification, segment, journey, app). | [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 17e0c0d..1723aff 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -32,8 +32,10 @@ Method | HTTP request | Description [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes +[**get_segment**](DefaultApi.md#get_segment) | **GET** /apps/{app_id}/segments/{segment_id} | View Segment [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**list_audit_logs**](DefaultApi.md#list_audit_logs) | **GET** /organizations/{organization_id}/audit_logs | List audit logs [**rotate_api_key**](DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key [**start_live_activity**](DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | @@ -41,6 +43,7 @@ Method | HTTP request | Description [**update_api_key**](DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push +[**update_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} | [**update_subscription_by_token**](DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token [**update_template**](DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template @@ -2609,6 +2612,85 @@ 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) +# **get_segment** +> GetSegmentSuccessResponse get_segment(app_id, segment_id) + +View Segment + +Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + +### 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. + 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. + include_segment_detail = True # Set to true to include segment metadata and filters in the response. (optional) + + try: + # View Segment + api_response = api_instance.get_segment(app_id, segment_id, include_segment_detail=include_segment_detail) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->get_segment: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +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. | + **include_segment_detail** | **bool**| Set to true to include segment metadata and filters in the response. | [optional] + +### Return type + +[**GetSegmentSuccessResponse**](GetSegmentSuccessResponse.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 | - | +**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) + # **get_segments** > GetSegmentsSuccessResponse get_segments(app_id) @@ -2765,6 +2847,118 @@ 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) +# **list_audit_logs** +> ListAuditLogsSuccessResponse list_audit_logs(organization_id) + +List audit logs + +Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled. + +### Example + +* Bearer Authentication (organization_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) + organization_id = "YOUR_ORG_ID" # The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. + start_time = "start_time_example" # Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + end_time = "end_time_example" # End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + cursor = "cursor_example" # Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + limit = 1 # Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + app_ids = [ + "app_ids_example", + ] # Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + actions = [ + "actions_example", + ] # Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + actor_ids = [ + "actor_ids_example", + ] # Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + actor_emails = [ + "actor_emails_example", + ] # Filter by actor email address. Accepts up to 10 values. (optional) + target_types = [ + "target_types_example", + ] # Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + target_ids = [ + "target_ids_example", + ] # Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + ip_addresses = [ + "ip_addresses_example", + ] # Filter by the IP address the action originated from. Accepts up to 10 values. (optional) + + try: + # List audit logs + api_response = api_instance.list_audit_logs(organization_id, start_time=start_time, end_time=end_time, cursor=cursor, limit=limit, app_ids=app_ids, actions=actions, actor_ids=actor_ids, actor_emails=actor_emails, target_types=target_types, target_ids=target_ids, ip_addresses=ip_addresses) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->list_audit_logs: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organization_id** | **str**| The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. | + **start_time** | **str**| Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. | [optional] + **end_time** | **str**| End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. | [optional] + **cursor** | **str**| Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. | [optional] + **limit** | **int**| Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. | [optional] + **app_ids** | **[str]**| Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. | [optional] + **actions** | **[str]**| Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. | [optional] + **actor_ids** | **[str]**| Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. | [optional] + **actor_emails** | **[str]**| Filter by actor email address. Accepts up to 10 values. | [optional] + **target_types** | **[str]**| Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. | [optional] + **target_ids** | **[str]**| Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. | [optional] + **ip_addresses** | **[str]**| Filter by the IP address the action originated from. Accepts up to 10 values. | [optional] + +### Return type + +[**ListAuditLogsSuccessResponse**](ListAuditLogsSuccessResponse.md) + +### Authorization + +[organization_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 | - | +**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) + # **rotate_api_key** > CreateApiKeyResponse rotate_api_key(app_id, token_id) @@ -3562,6 +3756,101 @@ 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_segment** +> UpdateSegmentSuccessResponse update_segment(app_id, segment_id) + +Update Segment + +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. + +### 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. + 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. + update_segment_request = UpdateSegmentRequest( + name="name_example", + description="description_example", + filters=[ + Filter( + field="tag", + key="level", + value="10", + hours_ago="24", + radius=3.14, + lat=3.14, + long=3.14, + relation=">", + ), + ], + ) + + try: + # Update Segment + api_response = api_instance.update_segment(app_id, segment_id, update_segment_request=update_segment_request) + pprint(api_response) + except onesignal.ApiException as e: + print("Exception when calling DefaultApi->update_segment: %s\n" % e) + print("Status Code: %s" % e.status) + print("Response Body: %s" % e.body) +``` + + +### Parameters + +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. | + **update_segment_request** | [**UpdateSegmentRequest**](UpdateSegmentRequest.md)| | [optional] + +### Return type + +[**UpdateSegmentSuccessResponse**](UpdateSegmentSuccessResponse.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 | - | +**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_subscription** > update_subscription(app_id, subscription_id, subscription_body) diff --git a/docs/GetSegmentSuccessResponse.md b/docs/GetSegmentSuccessResponse.md new file mode 100644 index 0000000..cc2547e --- /dev/null +++ b/docs/GetSegmentSuccessResponse.md @@ -0,0 +1,13 @@ +# GetSegmentSuccessResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscriber_count** | **int** | The number of subscribers matching this segment. | [optional] +**payload** | [**SegmentDetails**](SegmentDetails.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/ListAuditLogsSuccessResponse.md b/docs/ListAuditLogsSuccessResponse.md new file mode 100644 index 0000000..9fceebb --- /dev/null +++ b/docs/ListAuditLogsSuccessResponse.md @@ -0,0 +1,14 @@ +# ListAuditLogsSuccessResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**audit_logs** | [**[AuditLogEvent]**](AuditLogEvent.md) | Array of audit log events, ordered by occurred_at ascending. | [optional] +**has_more** | **bool** | True if additional events exist beyond this page. Use next_cursor to fetch the next page. | [optional] +**next_cursor** | **str** | Opaque cursor to pass as cursor in the next request. Only present 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/SegmentDetails.md b/docs/SegmentDetails.md new file mode 100644 index 0000000..078368f --- /dev/null +++ b/docs/SegmentDetails.md @@ -0,0 +1,18 @@ +# SegmentDetails + +Segment details. Only included when the include-segment-detail query parameter is set to true. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier for the segment (UUID v4). | [optional] +**name** | **str** | The segment name. | [optional] +**description** | **str, none_type** | Human-readable description for the segment. `null` when unset. Maximum 255 characters. | [optional] +**created_at** | **int** | Unix timestamp when the segment was created. | [optional] +**source** | **str** | The source of the segment. | [optional] +**filters** | [**[FilterExpression]**](FilterExpression.md) | Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment. | [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/UpdateSegmentRequest.md b/docs/UpdateSegmentRequest.md new file mode 100644 index 0000000..c5db80a --- /dev/null +++ b/docs/UpdateSegmentRequest.md @@ -0,0 +1,14 @@ +# UpdateSegmentRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Required. The segment name. Maximum 128 characters. | +**description** | **str** | Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. | [optional] +**filters** | [**[FilterExpression]**](FilterExpression.md) | Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. | [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/UpdateSegmentSuccessResponse.md b/docs/UpdateSegmentSuccessResponse.md new file mode 100644 index 0000000..c101e78 --- /dev/null +++ b/docs/UpdateSegmentSuccessResponse.md @@ -0,0 +1,13 @@ +# UpdateSegmentSuccessResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | true if the segment was updated successfully, false otherwise. | [optional] +**id** | **str** | UUID of the updated segment. | [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/api/default_api.py b/onesignal/api/default_api.py index 1a41164..ee57201 100644 --- a/onesignal/api/default_api.py +++ b/onesignal/api/default_api.py @@ -40,7 +40,9 @@ from onesignal.model.generic_error import GenericError from onesignal.model.generic_success_bool_response import GenericSuccessBoolResponse 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.list_audit_logs_success_response import ListAuditLogsSuccessResponse from onesignal.model.notification import Notification from onesignal.model.notification_history_success_response import NotificationHistorySuccessResponse from onesignal.model.notification_slice import NotificationSlice @@ -58,6 +60,8 @@ from onesignal.model.update_api_key_request import UpdateApiKeyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse +from onesignal.model.update_segment_request import UpdateSegmentRequest +from onesignal.model.update_segment_success_response import UpdateSegmentSuccessResponse from onesignal.model.update_template_request import UpdateTemplateRequest from onesignal.model.update_user_request import UpdateUserRequest from onesignal.model.user import User @@ -1746,6 +1750,68 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.get_segment_endpoint = _Endpoint( + settings={ + 'response_type': (GetSegmentSuccessResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/segments/{segment_id}', + 'operation_id': 'get_segment', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'segment_id', + 'include_segment_detail', + ], + 'required': [ + 'app_id', + 'segment_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'segment_id': + (str,), + 'include_segment_detail': + (bool,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'segment_id': 'segment_id', + 'include_segment_detail': 'include-segment-detail', + }, + 'location_map': { + 'app_id': 'path', + 'segment_id': 'path', + 'include_segment_detail': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.get_segments_endpoint = _Endpoint( settings={ 'response_type': (GetSegmentsSuccessResponse,), @@ -1870,6 +1936,154 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.list_audit_logs_endpoint = _Endpoint( + settings={ + 'response_type': (ListAuditLogsSuccessResponse,), + 'auth': [ + 'organization_api_key' + ], + 'endpoint_path': '/organizations/{organization_id}/audit_logs', + 'operation_id': 'list_audit_logs', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'organization_id', + 'start_time', + 'end_time', + 'cursor', + 'limit', + 'app_ids', + 'actions', + 'actor_ids', + 'actor_emails', + 'target_types', + 'target_ids', + 'ip_addresses', + ], + 'required': [ + 'organization_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'app_ids', + 'actions', + 'actor_ids', + 'actor_emails', + 'target_types', + 'target_ids', + 'ip_addresses', + ] + }, + root_map={ + 'validations': { + ('app_ids',): { + + 'max_items': 10, + }, + ('actions',): { + + 'max_items': 20, + }, + ('actor_ids',): { + + 'max_items': 10, + }, + ('actor_emails',): { + + 'max_items': 10, + }, + ('target_types',): { + + 'max_items': 10, + }, + ('target_ids',): { + + 'max_items': 10, + }, + ('ip_addresses',): { + + 'max_items': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'organization_id': + (str,), + 'start_time': + (str,), + 'end_time': + (str,), + 'cursor': + (str,), + 'limit': + (int,), + 'app_ids': + ([str],), + 'actions': + ([str],), + 'actor_ids': + ([str],), + 'actor_emails': + ([str],), + 'target_types': + ([str],), + 'target_ids': + ([str],), + 'ip_addresses': + ([str],), + }, + 'attribute_map': { + 'organization_id': 'organization_id', + 'start_time': 'start_time', + 'end_time': 'end_time', + 'cursor': 'cursor', + 'limit': 'limit', + 'app_ids': 'app_ids', + 'actions': 'actions', + 'actor_ids': 'actor_ids', + 'actor_emails': 'actor_emails', + 'target_types': 'target_types', + 'target_ids': 'target_ids', + 'ip_addresses': 'ip_addresses', + }, + 'location_map': { + 'organization_id': 'path', + 'start_time': 'query', + 'end_time': 'query', + 'cursor': 'query', + 'limit': 'query', + 'app_ids': 'query', + 'actions': 'query', + 'actor_ids': 'query', + 'actor_emails': 'query', + 'target_types': 'query', + 'target_ids': 'query', + 'ip_addresses': 'query', + }, + 'collection_format_map': { + 'app_ids': 'multi', + 'actions': 'multi', + 'actor_ids': 'multi', + 'actor_emails': 'multi', + 'target_types': 'multi', + 'target_ids': 'multi', + 'ip_addresses': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.rotate_api_key_endpoint = _Endpoint( settings={ 'response_type': (CreateApiKeyResponse,), @@ -2304,6 +2518,69 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.update_segment_endpoint = _Endpoint( + settings={ + 'response_type': (UpdateSegmentSuccessResponse,), + 'auth': [ + 'rest_api_key' + ], + 'endpoint_path': '/apps/{app_id}/segments/{segment_id}', + 'operation_id': 'update_segment', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'app_id', + 'segment_id', + 'update_segment_request', + ], + 'required': [ + 'app_id', + 'segment_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'app_id': + (str,), + 'segment_id': + (str,), + 'update_segment_request': + (UpdateSegmentRequest,), + }, + 'attribute_map': { + 'app_id': 'app_id', + 'segment_id': 'segment_id', + }, + 'location_map': { + 'app_id': 'path', + 'segment_id': 'path', + 'update_segment_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) self.update_subscription_endpoint = _Endpoint( settings={ 'response_type': None, @@ -5203,6 +5480,94 @@ def get_outcomes( outcome_names return self.get_outcomes_endpoint.call_with_http_info(**kwargs) + def get_segment( + self, + app_id, + segment_id, + **kwargs + ): + """View Segment # noqa: E501 + + Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_segment(app_id, segment_id, 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. + + Keyword Args: + include_segment_detail (bool): Set to true to include segment metadata and filters in the response.. [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: + GetSegmentSuccessResponse + 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['segment_id'] = \ + segment_id + return self.get_segment_endpoint.call_with_http_info(**kwargs) + def get_segments( self, app_id, @@ -5379,6 +5744,100 @@ def get_user( alias_id return self.get_user_endpoint.call_with_http_info(**kwargs) + def list_audit_logs( + self, + organization_id, + **kwargs + ): + """List audit logs # noqa: E501 + + Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_audit_logs(organization_id, async_req=True) + >>> result = thread.get() + + Args: + organization_id (str): The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. + + Keyword Args: + start_time (str): Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days.. [optional] + end_time (str): End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time.. [optional] + cursor (str): Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored.. [optional] + limit (int): Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server.. [optional] + app_ids ([str]): Filter events by app UUID. Accepts up to 10 values. Org-level events are always included.. [optional] + actions ([str]): Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values.. [optional] + actor_ids ([str]): Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values.. [optional] + actor_emails ([str]): Filter by actor email address. Accepts up to 10 values.. [optional] + target_types ([str]): Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values.. [optional] + target_ids ([str]): Filter by the UUID of the resource the action was performed on. Accepts up to 10 values.. [optional] + ip_addresses ([str]): Filter by the IP address the action originated from. Accepts up to 10 values.. [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: + ListAuditLogsSuccessResponse + 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['organization_id'] = \ + organization_id + return self.list_audit_logs_endpoint.call_with_http_info(**kwargs) + def rotate_api_key( self, app_id, @@ -6008,6 +6467,94 @@ def update_live_activity( update_live_activity_request return self.update_live_activity_endpoint.call_with_http_info(**kwargs) + def update_segment( + self, + app_id, + segment_id, + **kwargs + ): + """Update Segment # 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_segment(app_id, segment_id, 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. + + 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 + 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: + UpdateSegmentSuccessResponse + 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['segment_id'] = \ + segment_id + return self.update_segment_endpoint.call_with_http_info(**kwargs) + def update_subscription( self, app_id, diff --git a/onesignal/model/audit_log_actor.py b/onesignal/model/audit_log_actor.py new file mode 100644 index 0000000..9c75ae9 --- /dev/null +++ b/onesignal/model/audit_log_actor.py @@ -0,0 +1,280 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class AuditLogActor(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 { + 'email': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'email': 'email', # noqa: E501 + 'id': 'id', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AuditLogActor - 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,) + email (str): Email address of the actor. Absent if unavailable.. [optional] # noqa: E501 + id (str): UUID of the actor.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional actor-specific data.. [optional] # noqa: E501 + name (str): Display name of the actor. Absent if unavailable.. [optional] # noqa: E501 + type (str): Actor type (e.g. member, api_key, system).. [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 + """AuditLogActor - 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,) + email (str): Email address of the actor. Absent if unavailable.. [optional] # noqa: E501 + id (str): UUID of the actor.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional actor-specific data.. [optional] # noqa: E501 + name (str): Display name of the actor. Absent if unavailable.. [optional] # noqa: E501 + type (str): Actor type (e.g. member, api_key, system).. [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/audit_log_context.py b/onesignal/model/audit_log_context.py new file mode 100644 index 0000000..5972e5c --- /dev/null +++ b/onesignal/model/audit_log_context.py @@ -0,0 +1,276 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class AuditLogContext(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 { + 'country': (str,), # noqa: E501 + 'ip': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'user_agent': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'country': 'country', # noqa: E501 + 'ip': 'ip', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'user_agent': 'user_agent', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AuditLogContext - 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,) + country (str): Country code derived from the request IP.. [optional] # noqa: E501 + ip (str): IP address the request originated from.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional context-specific data.. [optional] # noqa: E501 + user_agent (str): User agent of the client that made the request.. [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 + """AuditLogContext - 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,) + country (str): Country code derived from the request IP.. [optional] # noqa: E501 + ip (str): IP address the request originated from.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional context-specific data.. [optional] # noqa: E501 + user_agent (str): User agent of the client that made the request.. [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/audit_log_event.py b/onesignal/model/audit_log_event.py new file mode 100644 index 0000000..d68b617 --- /dev/null +++ b/onesignal/model/audit_log_event.py @@ -0,0 +1,310 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.audit_log_actor import AuditLogActor + from onesignal.model.audit_log_context import AuditLogContext + from onesignal.model.audit_log_target import AuditLogTarget + globals()['AuditLogActor'] = AuditLogActor + globals()['AuditLogContext'] = AuditLogContext + globals()['AuditLogTarget'] = AuditLogTarget + + +class AuditLogEvent(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 { + 'action': (str,), # noqa: E501 + 'actor': (AuditLogActor,), # noqa: E501 + 'app_id': (str,), # noqa: E501 + 'context': (AuditLogContext,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'occurred_at': (str,), # noqa: E501 + 'organization_id': (str,), # noqa: E501 + 'targets': ([AuditLogTarget],), # noqa: E501 + 'version': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'action': 'action', # noqa: E501 + 'actor': 'actor', # noqa: E501 + 'app_id': 'app_id', # noqa: E501 + 'context': 'context', # noqa: E501 + 'id': 'id', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'occurred_at': 'occurred_at', # noqa: E501 + 'organization_id': 'organization_id', # noqa: E501 + 'targets': 'targets', # noqa: E501 + 'version': 'version', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AuditLogEvent - 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,) + action (str): The action that was performed (e.g. notification.sent, segment.created, member.invited).. [optional] # noqa: E501 + actor (AuditLogActor): [optional] # noqa: E501 + app_id (str): UUID of the app the event is associated with. Absent for org-level events.. [optional] # noqa: E501 + context (AuditLogContext): [optional] # noqa: E501 + id (str): UUID of the audit log event.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional event-specific data that does not fit into the standard fields.. [optional] # noqa: E501 + occurred_at (str): RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z).. [optional] # noqa: E501 + organization_id (str): UUID of the organization the event belongs to.. [optional] # noqa: E501 + targets ([AuditLogTarget]): The resources the action was performed on. May be empty for org-level events.. [optional] # noqa: E501 + version (int): Schema version of the event payload.. [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 + """AuditLogEvent - 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,) + action (str): The action that was performed (e.g. notification.sent, segment.created, member.invited).. [optional] # noqa: E501 + actor (AuditLogActor): [optional] # noqa: E501 + app_id (str): UUID of the app the event is associated with. Absent for org-level events.. [optional] # noqa: E501 + context (AuditLogContext): [optional] # noqa: E501 + id (str): UUID of the audit log event.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional event-specific data that does not fit into the standard fields.. [optional] # noqa: E501 + occurred_at (str): RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z).. [optional] # noqa: E501 + organization_id (str): UUID of the organization the event belongs to.. [optional] # noqa: E501 + targets ([AuditLogTarget]): The resources the action was performed on. May be empty for org-level events.. [optional] # noqa: E501 + version (int): Schema version of the event payload.. [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/audit_log_target.py b/onesignal/model/audit_log_target.py new file mode 100644 index 0000000..6b825c6 --- /dev/null +++ b/onesignal/model/audit_log_target.py @@ -0,0 +1,276 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class AuditLogTarget(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 { + 'id': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AuditLogTarget - 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 resource.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional resource-specific data.. [optional] # noqa: E501 + name (str): Display name of the resource. Absent if unavailable.. [optional] # noqa: E501 + type (str): Resource type (e.g. notification, segment, journey, app).. [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 + """AuditLogTarget - 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 resource.. [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional resource-specific data.. [optional] # noqa: E501 + name (str): Display name of the resource. Absent if unavailable.. [optional] # noqa: E501 + type (str): Resource type (e.g. notification, segment, journey, app).. [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/get_segment_success_response.py b/onesignal/model/get_segment_success_response.py new file mode 100644 index 0000000..84b0c0f --- /dev/null +++ b/onesignal/model/get_segment_success_response.py @@ -0,0 +1,274 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.segment_details import SegmentDetails + globals()['SegmentDetails'] = SegmentDetails + + +class GetSegmentSuccessResponse(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 { + 'subscriber_count': (int,), # noqa: E501 + 'payload': (SegmentDetails,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'subscriber_count': 'subscriber_count', # noqa: E501 + 'payload': 'payload', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetSegmentSuccessResponse - 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,) + subscriber_count (int): The number of subscribers matching this segment.. [optional] # noqa: E501 + payload (SegmentDetails): [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 + """GetSegmentSuccessResponse - 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,) + subscriber_count (int): The number of subscribers matching this segment.. [optional] # noqa: E501 + payload (SegmentDetails): [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/list_audit_logs_success_response.py b/onesignal/model/list_audit_logs_success_response.py new file mode 100644 index 0000000..ba8b944 --- /dev/null +++ b/onesignal/model/list_audit_logs_success_response.py @@ -0,0 +1,278 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.audit_log_event import AuditLogEvent + globals()['AuditLogEvent'] = AuditLogEvent + + +class ListAuditLogsSuccessResponse(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 { + 'audit_logs': ([AuditLogEvent],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + 'next_cursor': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'audit_logs': 'audit_logs', # 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 + """ListAuditLogsSuccessResponse - 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,) + audit_logs ([AuditLogEvent]): Array of audit log events, ordered by occurred_at ascending.. [optional] # noqa: E501 + has_more (bool): True if additional events exist beyond this page. Use next_cursor to fetch the next page.. [optional] # noqa: E501 + next_cursor (str): Opaque cursor to pass as cursor in the next request. Only present 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 + """ListAuditLogsSuccessResponse - 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,) + audit_logs ([AuditLogEvent]): Array of audit log events, ordered by occurred_at ascending.. [optional] # noqa: E501 + has_more (bool): True if additional events exist beyond this page. Use next_cursor to fetch the next page.. [optional] # noqa: E501 + next_cursor (str): Opaque cursor to pass as cursor in the next request. Only present 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/segment_details.py b/onesignal/model/segment_details.py new file mode 100644 index 0000000..e71b31a --- /dev/null +++ b/onesignal/model/segment_details.py @@ -0,0 +1,295 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.filter_expression import FilterExpression + globals()['FilterExpression'] = FilterExpression + + +class SegmentDetails(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 = { + ('source',): { + 'DEFAULT': "default", + 'CUSTOM': "custom", + 'QUICKSTART': "quickstart", + }, + } + + 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 + 'name': (str,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'created_at': (int,), # noqa: E501 + 'source': (str,), # noqa: E501 + 'filters': ([FilterExpression],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'source': 'source', # noqa: E501 + 'filters': 'filters', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SegmentDetails - 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): The unique identifier for the segment (UUID v4).. [optional] # noqa: E501 + name (str): The segment name.. [optional] # noqa: E501 + description (str, none_type): Human-readable description for the segment. `null` when unset. Maximum 255 characters.. [optional] # noqa: E501 + created_at (int): Unix timestamp when the segment was created.. [optional] # noqa: E501 + source (str): The source of the segment.. [optional] # noqa: E501 + filters ([FilterExpression]): Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment.. [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 + """SegmentDetails - 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): The unique identifier for the segment (UUID v4).. [optional] # noqa: E501 + name (str): The segment name.. [optional] # noqa: E501 + description (str, none_type): Human-readable description for the segment. `null` when unset. Maximum 255 characters.. [optional] # noqa: E501 + created_at (int): Unix timestamp when the segment was created.. [optional] # noqa: E501 + source (str): The source of the segment.. [optional] # noqa: E501 + filters ([FilterExpression]): Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment.. [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_segment_request.py b/onesignal/model/update_segment_request.py new file mode 100644 index 0000000..5bc759a --- /dev/null +++ b/onesignal/model/update_segment_request.py @@ -0,0 +1,290 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + +def lazy_import(): + from onesignal.model.filter_expression import FilterExpression + globals()['FilterExpression'] = FilterExpression + + +class UpdateSegmentRequest(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 = { + ('name',): { + 'max_length': 128, + }, + ('description',): { + 'max_length': 255, + }, + } + + @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,), # noqa: E501 + 'filters': ([FilterExpression],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'filters': 'filters', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """UpdateSegmentRequest - a model defined in OpenAPI + + Args: + name (str): Required. The segment name. Maximum 128 characters. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged.. [optional] # noqa: E501 + filters ([FilterExpression]): Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators.. [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 + """UpdateSegmentRequest - a model defined in OpenAPI + + Args: + name (str): Required. The segment name. Maximum 128 characters. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged.. [optional] # noqa: E501 + filters ([FilterExpression]): Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators.. [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/update_segment_success_response.py b/onesignal/model/update_segment_success_response.py new file mode 100644 index 0000000..6ab927b --- /dev/null +++ b/onesignal/model/update_segment_success_response.py @@ -0,0 +1,268 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from onesignal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from onesignal.exceptions import ApiAttributeError + + + +class UpdateSegmentSuccessResponse(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 { + 'success': (bool,), # noqa: E501 + 'id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success': 'success', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateSegmentSuccessResponse - 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,) + success (bool): true if the segment was updated successfully, false otherwise.. [optional] # noqa: E501 + id (str): UUID of the updated segment.. [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 + """UpdateSegmentSuccessResponse - 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,) + success (bool): true if the segment was updated successfully, false otherwise.. [optional] # noqa: E501 + id (str): UUID of the updated segment.. [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 091dcfb..42e0eb4 100644 --- a/onesignal/models/__init__.py +++ b/onesignal/models/__init__.py @@ -13,6 +13,10 @@ from onesignal.model.api_key_tokens_list_response import ApiKeyTokensListResponse from onesignal.model.app import App from onesignal.model.apps import Apps +from onesignal.model.audit_log_actor import AuditLogActor +from onesignal.model.audit_log_context import AuditLogContext +from onesignal.model.audit_log_event import AuditLogEvent +from onesignal.model.audit_log_target import AuditLogTarget from onesignal.model.basic_notification import BasicNotification from onesignal.model.basic_notification_all_of import BasicNotificationAllOf from onesignal.model.basic_notification_all_of_android_background_layout import BasicNotificationAllOfAndroidBackgroundLayout @@ -38,10 +42,12 @@ from onesignal.model.generic_error import GenericError from onesignal.model.generic_success_bool_response import GenericSuccessBoolResponse 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.identity_object import IdentityObject from onesignal.model.include_aliases import IncludeAliases from onesignal.model.language_string_map import LanguageStringMap +from onesignal.model.list_audit_logs_success_response import ListAuditLogsSuccessResponse from onesignal.model.notification import Notification from onesignal.model.notification_all_of import NotificationAllOf from onesignal.model.notification_history_success_response import NotificationHistorySuccessResponse @@ -62,6 +68,7 @@ from onesignal.model.rate_limit_error import RateLimitError from onesignal.model.segment import Segment from onesignal.model.segment_data import SegmentData +from onesignal.model.segment_details import SegmentDetails from onesignal.model.segment_notification_target import SegmentNotificationTarget from onesignal.model.start_live_activity_request import StartLiveActivityRequest from onesignal.model.start_live_activity_success_response import StartLiveActivitySuccessResponse @@ -74,6 +81,8 @@ from onesignal.model.update_api_key_request import UpdateApiKeyRequest from onesignal.model.update_live_activity_request import UpdateLiveActivityRequest from onesignal.model.update_live_activity_success_response import UpdateLiveActivitySuccessResponse +from onesignal.model.update_segment_request import UpdateSegmentRequest +from onesignal.model.update_segment_success_response import UpdateSegmentSuccessResponse from onesignal.model.update_template_request import UpdateTemplateRequest from onesignal.model.update_user_request import UpdateUserRequest from onesignal.model.user import User diff --git a/test/test_audit_log_actor.py b/test/test_audit_log_actor.py new file mode 100644 index 0000000..3cb5419 --- /dev/null +++ b/test/test_audit_log_actor.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.audit_log_actor import AuditLogActor + + +class TestAuditLogActor(unittest.TestCase): + """AuditLogActor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuditLogActor(self): + """Test AuditLogActor""" + # FIXME: construct object with mandatory attributes with example values + # model = AuditLogActor() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_audit_log_context.py b/test/test_audit_log_context.py new file mode 100644 index 0000000..531e3f9 --- /dev/null +++ b/test/test_audit_log_context.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.audit_log_context import AuditLogContext + + +class TestAuditLogContext(unittest.TestCase): + """AuditLogContext unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuditLogContext(self): + """Test AuditLogContext""" + # FIXME: construct object with mandatory attributes with example values + # model = AuditLogContext() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_audit_log_event.py b/test/test_audit_log_event.py new file mode 100644 index 0000000..24ae8d8 --- /dev/null +++ b/test/test_audit_log_event.py @@ -0,0 +1,42 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.audit_log_actor import AuditLogActor +from onesignal.model.audit_log_context import AuditLogContext +from onesignal.model.audit_log_target import AuditLogTarget +globals()['AuditLogActor'] = AuditLogActor +globals()['AuditLogContext'] = AuditLogContext +globals()['AuditLogTarget'] = AuditLogTarget +from onesignal.model.audit_log_event import AuditLogEvent + + +class TestAuditLogEvent(unittest.TestCase): + """AuditLogEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuditLogEvent(self): + """Test AuditLogEvent""" + # FIXME: construct object with mandatory attributes with example values + # model = AuditLogEvent() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_audit_log_target.py b/test/test_audit_log_target.py new file mode 100644 index 0000000..7c1c2df --- /dev/null +++ b/test/test_audit_log_target.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.audit_log_target import AuditLogTarget + + +class TestAuditLogTarget(unittest.TestCase): + """AuditLogTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuditLogTarget(self): + """Test AuditLogTarget""" + # FIXME: construct object with mandatory attributes with example values + # model = AuditLogTarget() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_default_api.py b/test/test_default_api.py index 945404e..e563040 100644 --- a/test/test_default_api.py +++ b/test/test_default_api.py @@ -211,6 +211,13 @@ def test_get_outcomes(self): """ pass + def test_get_segment(self): + """Test case for get_segment + + View Segment # noqa: E501 + """ + pass + def test_get_segments(self): """Test case for get_segments @@ -224,6 +231,13 @@ def test_get_user(self): """ pass + def test_list_audit_logs(self): + """Test case for list_audit_logs + + List audit logs # noqa: E501 + """ + pass + def test_rotate_api_key(self): """Test case for rotate_api_key @@ -272,6 +286,13 @@ def test_update_live_activity(self): """ pass + def test_update_segment(self): + """Test case for update_segment + + Update Segment # noqa: E501 + """ + pass + def test_update_subscription(self): """Test case for update_subscription diff --git a/test/test_get_segment_success_response.py b/test/test_get_segment_success_response.py new file mode 100644 index 0000000..31f5864 --- /dev/null +++ b/test/test_get_segment_success_response.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.segment_details import SegmentDetails +globals()['SegmentDetails'] = SegmentDetails +from onesignal.model.get_segment_success_response import GetSegmentSuccessResponse + + +class TestGetSegmentSuccessResponse(unittest.TestCase): + """GetSegmentSuccessResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetSegmentSuccessResponse(self): + """Test GetSegmentSuccessResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = GetSegmentSuccessResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_audit_logs_success_response.py b/test/test_list_audit_logs_success_response.py new file mode 100644 index 0000000..500d134 --- /dev/null +++ b/test/test_list_audit_logs_success_response.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.audit_log_event import AuditLogEvent +globals()['AuditLogEvent'] = AuditLogEvent +from onesignal.model.list_audit_logs_success_response import ListAuditLogsSuccessResponse + + +class TestListAuditLogsSuccessResponse(unittest.TestCase): + """ListAuditLogsSuccessResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testListAuditLogsSuccessResponse(self): + """Test ListAuditLogsSuccessResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ListAuditLogsSuccessResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_segment_details.py b/test/test_segment_details.py new file mode 100644 index 0000000..8500e4f --- /dev/null +++ b/test/test_segment_details.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.filter_expression import FilterExpression +globals()['FilterExpression'] = FilterExpression +from onesignal.model.segment_details import SegmentDetails + + +class TestSegmentDetails(unittest.TestCase): + """SegmentDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSegmentDetails(self): + """Test SegmentDetails""" + # FIXME: construct object with mandatory attributes with example values + # model = SegmentDetails() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_segment_request.py b/test/test_update_segment_request.py new file mode 100644 index 0000000..0890578 --- /dev/null +++ b/test/test_update_segment_request.py @@ -0,0 +1,38 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.filter_expression import FilterExpression +globals()['FilterExpression'] = FilterExpression +from onesignal.model.update_segment_request import UpdateSegmentRequest + + +class TestUpdateSegmentRequest(unittest.TestCase): + """UpdateSegmentRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateSegmentRequest(self): + """Test UpdateSegmentRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateSegmentRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_segment_success_response.py b/test/test_update_segment_success_response.py new file mode 100644 index 0000000..65c2dc0 --- /dev/null +++ b/test/test_update_segment_success_response.py @@ -0,0 +1,36 @@ +""" + OneSignal + + A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com # noqa: E501 + + The version of the OpenAPI document: 5.10.0 + Contact: devrel@onesignal.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import onesignal +from onesignal.model.update_segment_success_response import UpdateSegmentSuccessResponse + + +class TestUpdateSegmentSuccessResponse(unittest.TestCase): + """UpdateSegmentSuccessResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateSegmentSuccessResponse(self): + """Test UpdateSegmentSuccessResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateSegmentSuccessResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()