From 364724553babdba4d3520c01a85fa534db147278 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 28 Jul 2026 18:47:12 +0000 Subject: [PATCH] feat: add v5.11.0 package updates --- Cargo.toml | 2 +- README.md | 6 +- docs/AuditLogActor.md | 15 + docs/AuditLogContext.md | 14 + docs/AuditLogEvent.md | 20 ++ docs/AuditLogTarget.md | 14 + docs/DefaultApi.md | 209 +++++++++++++ docs/GetSegmentSuccessResponse.md | 12 + docs/ListAuditLogsSuccessResponse.md | 13 + docs/SegmentDetails.md | 16 + docs/UpdateSegmentRequest.md | 13 + docs/UpdateSegmentSuccessResponse.md | 12 + src/apis/configuration.rs | 4 +- src/apis/default_api.rs | 288 +++++++++++++++--- src/models/api_key_token.rs | 2 +- src/models/api_key_tokens_list_response.rs | 2 +- src/models/app.rs | 2 +- src/models/audit_log_actor.rs | 47 +++ src/models/audit_log_context.rs | 43 +++ src/models/audit_log_event.rs | 63 ++++ src/models/audit_log_target.rs | 43 +++ src/models/basic_notification.rs | 2 +- src/models/basic_notification_all_of.rs | 2 +- ...cation_all_of_android_background_layout.rs | 2 +- src/models/button.rs | 2 +- src/models/copy_template_request.rs | 2 +- src/models/create_api_key_request.rs | 2 +- src/models/create_api_key_response.rs | 2 +- .../create_notification_success_response.rs | 2 +- .../create_segment_conflict_response.rs | 2 +- src/models/create_segment_success_response.rs | 2 +- src/models/create_template_request.rs | 2 +- src/models/create_user_conflict_response.rs | 2 +- ...ate_user_conflict_response_errors_inner.rs | 2 +- ...ser_conflict_response_errors_items_meta.rs | 2 +- src/models/custom_event.rs | 2 +- src/models/custom_events_request.rs | 2 +- src/models/delivery_data.rs | 2 +- src/models/export_events_success_response.rs | 2 +- .../export_subscriptions_request_body.rs | 2 +- .../export_subscriptions_success_response.rs | 2 +- src/models/filter.rs | 2 +- src/models/filter_expression.rs | 2 +- src/models/generic_error.rs | 2 +- src/models/generic_success_bool_response.rs | 2 +- .../get_notification_history_request_body.rs | 2 +- src/models/get_segment_success_response.rs | 32 ++ src/models/get_segments_success_response.rs | 2 +- src/models/language_string_map.rs | 2 +- .../list_audit_logs_success_response.rs | 37 +++ src/models/mod.rs | 18 ++ src/models/notification.rs | 2 +- src/models/notification_all_of.rs | 2 +- .../notification_history_success_response.rs | 2 +- src/models/notification_slice.rs | 2 +- src/models/notification_target.rs | 2 +- src/models/notification_with_meta.rs | 2 +- src/models/notification_with_meta_all_of.rs | 2 +- src/models/operator.rs | 2 +- src/models/outcome_data.rs | 2 +- src/models/outcomes_data.rs | 2 +- src/models/platform_delivery_data.rs | 2 +- .../platform_delivery_data_email_all_of.rs | 2 +- .../platform_delivery_data_sms_all_of.rs | 2 +- src/models/properties_body.rs | 2 +- src/models/properties_deltas.rs | 2 +- src/models/properties_object.rs | 2 +- src/models/purchase.rs | 2 +- src/models/rate_limit_error.rs | 2 +- src/models/segment.rs | 2 +- src/models/segment_data.rs | 2 +- src/models/segment_details.rs | 67 ++++ src/models/segment_notification_target.rs | 2 +- src/models/start_live_activity_request.rs | 2 +- .../start_live_activity_success_response.rs | 2 +- src/models/subscription.rs | 2 +- src/models/subscription_body.rs | 2 +- .../subscription_notification_target.rs | 2 +- src/models/template_resource.rs | 2 +- src/models/templates_list_response.rs | 2 +- .../transfer_subscription_request_body.rs | 2 +- src/models/update_api_key_request.rs | 2 +- src/models/update_live_activity_request.rs | 2 +- .../update_live_activity_success_response.rs | 2 +- src/models/update_segment_request.rs | 37 +++ src/models/update_segment_success_response.rs | 33 ++ src/models/update_template_request.rs | 2 +- src/models/update_user_request.rs | 2 +- src/models/user.rs | 2 +- src/models/user_identity_body.rs | 2 +- src/models/web_button.rs | 2 +- 91 files changed, 1074 insertions(+), 118 deletions(-) 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 src/models/audit_log_actor.rs create mode 100644 src/models/audit_log_context.rs create mode 100644 src/models/audit_log_event.rs create mode 100644 src/models/audit_log_target.rs create mode 100644 src/models/get_segment_success_response.rs create mode 100644 src/models/list_audit_logs_success_response.rs create mode 100644 src/models/segment_details.rs create mode 100644 src/models/update_segment_request.rs create mode 100644 src/models/update_segment_success_response.rs diff --git a/Cargo.toml b/Cargo.toml index 0b2d99c..b152341 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "onesignal-rust-api" -version = "5.10.0" +version = "5.11.0" authors = ["devrel@onesignal.com"] edition = "2018" description = "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com" diff --git a/README.md b/README.md index 77346fb..e213e5c 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,15 @@ A powerful way to send personalized messages at scale and build effective custom For more information, please visit [https://onesignal.com](https://onesignal.com) -- API version: 5.10.0 -- Package version: 5.10.0 +- API version: 5.11.0 +- Package version: 5.11.0 ## Installation Add to `Cargo.toml` under `[dependencies]`: ```toml -onesignal-rust-api = "5.10.0" +onesignal-rust-api = "5.11.0" ``` ## Configuration diff --git a/docs/AuditLogActor.md b/docs/AuditLogActor.md new file mode 100644 index 0000000..5a6f335 --- /dev/null +++ b/docs/AuditLogActor.md @@ -0,0 +1,15 @@ +# AuditLogActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | Email address of the actor. Absent if unavailable. | [optional] +**id** | Option<**String**> | UUID of the actor. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Additional actor-specific data. | [optional] +**name** | Option<**String**> | Display name of the actor. Absent if unavailable. | [optional] +**_type** | Option<**String**> | Actor type (e.g. member, api_key, system). | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/AuditLogContext.md b/docs/AuditLogContext.md new file mode 100644 index 0000000..d3db5c6 --- /dev/null +++ b/docs/AuditLogContext.md @@ -0,0 +1,14 @@ +# AuditLogContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | Option<**String**> | Country code derived from the request IP. | [optional] +**ip** | Option<**String**> | IP address the request originated from. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Additional context-specific data. | [optional] +**user_agent** | Option<**String**> | User agent of the client that made the request. | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/AuditLogEvent.md b/docs/AuditLogEvent.md new file mode 100644 index 0000000..0c03fb7 --- /dev/null +++ b/docs/AuditLogEvent.md @@ -0,0 +1,20 @@ +# AuditLogEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | Option<**String**> | The action that was performed (e.g. notification.sent, segment.created, member.invited). | [optional] +**actor** | Option<[**crate::models::AuditLogActor**](AuditLogActor.md)> | | [optional] +**app_id** | Option<**String**> | UUID of the app the event is associated with. Absent for org-level events. | [optional] +**context** | Option<[**crate::models::AuditLogContext**](AuditLogContext.md)> | | [optional] +**id** | Option<**String**> | UUID of the audit log event. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Additional event-specific data that does not fit into the standard fields. | [optional] +**occurred_at** | Option<**String**> | RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). | [optional] +**organization_id** | Option<**String**> | UUID of the organization the event belongs to. | [optional] +**targets** | Option<[**Vec**](AuditLogTarget.md)> | The resources the action was performed on. May be empty for org-level events. | [optional] +**version** | Option<**i32**> | Schema version of the event payload. | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/AuditLogTarget.md b/docs/AuditLogTarget.md new file mode 100644 index 0000000..6041740 --- /dev/null +++ b/docs/AuditLogTarget.md @@ -0,0 +1,14 @@ +# AuditLogTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | UUID of the resource. | [optional] +**metadata** | Option<[**serde_json::Value**](.md)> | Additional resource-specific data. | [optional] +**name** | Option<**String**> | Display name of the resource. Absent if unavailable. | [optional] +**_type** | Option<**String**> | Resource type (e.g. notification, segment, journey, app). | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 3507eeb..ca1da89 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 @@ -1908,6 +1911,68 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) +## get_segment + +> crate::models::GetSegmentSuccessResponse get_segment(app_id, segment_id, include_segment_detail) +View Segment + +Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + +### Example + +```rust +use onesignal_rust_api::apis::configuration::Configuration; +use onesignal_rust_api::apis::default_api; + + +#[tokio::main] +async fn main() { + let mut configuration = Configuration::new(); + configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string()); + + + // Realistic values are pulled from the spec's `example:` fields where present. + let app_id: &str = "YOUR_APP_ID"; + let segment_id: &str = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; + let include_segment_detail: Option = None; + + match default_api::get_segment(&configuration, app_id, segment_id, include_segment_detail).await { + Ok(resp) => println!("{:?}", resp), + Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => { + // `e.error_messages()` flattens any error-envelope shape to a Vec; + // the raw response remains on the ResponseError variant. + eprintln!("get_segment failed: {:?}", e.error_messages()); + } + Err(e) => eprintln!("get_segment failed: {:?}", e), + } +} +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | [required] | +**segment_id** | **String** | 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. | [required] | +**include_segment_detail** | Option<**bool**> | Set to true to include segment metadata and filters in the response. | | + +### Return type + +[**crate::models::GetSegmentSuccessResponse**](GetSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + ## get_segments > crate::models::GetSegmentsSuccessResponse get_segments(app_id, offset, limit) @@ -2032,6 +2097,86 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) +## list_audit_logs + +> crate::models::ListAuditLogsSuccessResponse list_audit_logs(organization_id, start_time, end_time, cursor, limit, app_ids, actions, actor_ids, actor_emails, target_types, target_ids, ip_addresses) +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 + +```rust +use onesignal_rust_api::apis::configuration::Configuration; +use onesignal_rust_api::apis::default_api; + + +#[tokio::main] +async fn main() { + let mut configuration = Configuration::new(); + configuration.organization_api_key_token = Some("YOUR_ORGANIZATION_API_KEY".to_string()); + + + // Realistic values are pulled from the spec's `example:` fields where present. + let organization_id: &str = "YOUR_ORG_ID"; + let start_time: Option<&str> = None; + let end_time: Option<&str> = None; + let cursor: Option<&str> = None; + let limit: Option = None; + let app_ids: Option> = None; + let actions: Option> = None; + let actor_ids: Option> = None; + let actor_emails: Option> = None; + let target_types: Option> = None; + let target_ids: Option> = None; + let ip_addresses: Option> = None; + + match default_api::list_audit_logs(&configuration, organization_id, start_time, end_time, cursor, limit, app_ids, actions, actor_ids, actor_emails, target_types, target_ids, ip_addresses).await { + Ok(resp) => println!("{:?}", resp), + Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => { + // `e.error_messages()` flattens any error-envelope shape to a Vec; + // the raw response remains on the ResponseError variant. + eprintln!("list_audit_logs failed: {:?}", e.error_messages()); + } + Err(e) => eprintln!("list_audit_logs failed: {:?}", e), + } +} +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**organization_id** | **String** | The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. | [required] | +**start_time** | Option<**String**> | 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. | | +**end_time** | Option<**String**> | End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. | | +**cursor** | Option<**String**> | Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. | | +**limit** | Option<**i32**> | Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. | | +**app_ids** | Option<[**Vec**](String.md)> | Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. | | +**actions** | Option<[**Vec**](String.md)> | Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. | | +**actor_ids** | Option<[**Vec**](String.md)> | Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. | | +**actor_emails** | Option<[**Vec**](String.md)> | Filter by actor email address. Accepts up to 10 values. | | +**target_types** | Option<[**Vec**](String.md)> | Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. | | +**target_ids** | Option<[**Vec**](String.md)> | Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. | | +**ip_addresses** | Option<[**Vec**](String.md)> | Filter by the IP address the action originated from. Accepts up to 10 values. | | + +### Return type + +[**crate::models::ListAuditLogsSuccessResponse**](ListAuditLogsSuccessResponse.md) + +### Authorization + +[organization_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + ## rotate_api_key > crate::models::CreateApiKeyResponse rotate_api_key(app_id, token_id) @@ -2472,6 +2617,70 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) +## update_segment + +> crate::models::UpdateSegmentSuccessResponse update_segment(app_id, segment_id, update_segment_request) +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 + +```rust +use onesignal_rust_api::apis::configuration::Configuration; +use onesignal_rust_api::apis::default_api; + +use onesignal_rust_api::models; + + +#[tokio::main] +async fn main() { + let mut configuration = Configuration::new(); + configuration.rest_api_key_token = Some("YOUR_REST_API_KEY".to_string()); + + + // Realistic values are pulled from the spec's `example:` fields where present. + let app_id: &str = "YOUR_APP_ID"; + let segment_id: &str = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; + let update_segment_request: Option = None; + + match default_api::update_segment(&configuration, app_id, segment_id, update_segment_request).await { + Ok(resp) => println!("{:?}", resp), + Err(e @ onesignal_rust_api::apis::Error::ResponseError(_)) => { + // `e.error_messages()` flattens any error-envelope shape to a Vec; + // the raw response remains on the ResponseError variant. + eprintln!("update_segment failed: {:?}", e.error_messages()); + } + Err(e) => eprintln!("update_segment failed: {:?}", e), + } +} +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | [required] | +**segment_id** | **String** | 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. | [required] | +**update_segment_request** | Option<[**UpdateSegmentRequest**](UpdateSegmentRequest.md)> | | | + +### Return type + +[**crate::models::UpdateSegmentSuccessResponse**](UpdateSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-rust-api#configuration) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-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..28492f9 --- /dev/null +++ b/docs/GetSegmentSuccessResponse.md @@ -0,0 +1,12 @@ +# GetSegmentSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscriber_count** | Option<**i32**> | The number of subscribers matching this segment. | [optional] +**payload** | Option<[**crate::models::SegmentDetails**](SegmentDetails.md)> | | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/ListAuditLogsSuccessResponse.md b/docs/ListAuditLogsSuccessResponse.md new file mode 100644 index 0000000..74515ec --- /dev/null +++ b/docs/ListAuditLogsSuccessResponse.md @@ -0,0 +1,13 @@ +# ListAuditLogsSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**audit_logs** | Option<[**Vec**](AuditLogEvent.md)> | Array of audit log events, ordered by occurred_at ascending. | [optional] +**has_more** | Option<**bool**> | True if additional events exist beyond this page. Use next_cursor to fetch the next page. | [optional] +**next_cursor** | Option<**String**> | Opaque cursor to pass as cursor in the next request. Only present when has_more is true. | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/SegmentDetails.md b/docs/SegmentDetails.md new file mode 100644 index 0000000..7694fbf --- /dev/null +++ b/docs/SegmentDetails.md @@ -0,0 +1,16 @@ +# SegmentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | The unique identifier for the segment (UUID v4). | [optional] +**name** | Option<**String**> | The segment name. | [optional] +**description** | Option<**String**> | Human-readable description for the segment. `null` when unset. Maximum 255 characters. | [optional] +**created_at** | Option<**i32**> | Unix timestamp when the segment was created. | [optional] +**source** | Option<**String**> | The source of the segment. | [optional] +**filters** | Option<[**Vec**](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] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/UpdateSegmentRequest.md b/docs/UpdateSegmentRequest.md new file mode 100644 index 0000000..f9ca20c --- /dev/null +++ b/docs/UpdateSegmentRequest.md @@ -0,0 +1,13 @@ +# UpdateSegmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Required. The segment name. Maximum 128 characters. | +**description** | Option<**String**> | Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. | [optional] +**filters** | Option<[**Vec**](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] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/docs/UpdateSegmentSuccessResponse.md b/docs/UpdateSegmentSuccessResponse.md new file mode 100644 index 0000000..45f31cc --- /dev/null +++ b/docs/UpdateSegmentSuccessResponse.md @@ -0,0 +1,12 @@ +# UpdateSegmentSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | Option<**bool**> | true if the segment was updated successfully, false otherwise. | [optional] +**id** | Option<**String**> | UUID of the updated segment. | [optional] + +[[Back to API list]](https://github.com/OneSignal/onesignal-rust-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-rust-api) + + diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index 71068dd..11b1d71 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ @@ -45,7 +45,7 @@ impl Default for Configuration { fn default() -> Self { Configuration { base_path: "https://api.onesignal.com".to_owned(), - user_agent: Some("OpenAPI-Generator/5.10.0/rust".to_owned()), + user_agent: Some("OpenAPI-Generator/5.11.0/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/src/apis/default_api.rs b/src/apis/default_api.rs index 48e01ce..2d8f936 100644 --- a/src/apis/default_api.rs +++ b/src/apis/default_api.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ @@ -312,6 +312,17 @@ pub enum GetOutcomesError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_segment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSegmentError { + Status400(crate::models::GenericError), + Status404(crate::models::GenericError), + Status429(crate::models::RateLimitError), + DefaultResponse(crate::models::GenericError), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`get_segments`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -333,6 +344,18 @@ pub enum GetUserError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`list_audit_logs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAuditLogsError { + Status400(crate::models::GenericError), + Status403(crate::models::GenericError), + Status404(crate::models::GenericError), + Status429(crate::models::RateLimitError), + DefaultResponse(crate::models::GenericError), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`rotate_api_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -403,6 +426,18 @@ pub enum UpdateLiveActivityError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`update_segment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateSegmentError { + Status400(crate::models::GenericError), + Status403(crate::models::GenericError), + Status404(crate::models::GenericError), + Status429(crate::models::RateLimitError), + DefaultResponse(crate::models::GenericError), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`update_subscription`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -490,7 +525,7 @@ pub async fn cancel_notification(configuration: &configuration::Configuration, a } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -526,7 +561,7 @@ pub async fn copy_template_to_app(configuration: &configuration::Configuration, } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -562,7 +597,7 @@ pub async fn create_alias(configuration: &configuration::Configuration, app_id: } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -598,7 +633,7 @@ pub async fn create_alias_by_subscription(configuration: &configuration::Configu } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -634,7 +669,7 @@ pub async fn create_api_key(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -670,7 +705,7 @@ pub async fn create_app(configuration: &configuration::Configuration, app: crate } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -706,7 +741,7 @@ pub async fn create_custom_events(configuration: &configuration::Configuration, } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -742,7 +777,7 @@ pub async fn create_notification(configuration: &configuration::Configuration, n } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -778,7 +813,7 @@ pub async fn create_segment(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -814,7 +849,7 @@ pub async fn create_subscription(configuration: &configuration::Configuration, a } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -850,7 +885,7 @@ pub async fn create_template(configuration: &configuration::Configuration, creat } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -886,7 +921,7 @@ pub async fn create_user(configuration: &configuration::Configuration, app_id: & } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -922,7 +957,7 @@ pub async fn delete_alias(configuration: &configuration::Configuration, app_id: } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -957,7 +992,7 @@ pub async fn delete_api_key(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -992,7 +1027,7 @@ pub async fn delete_segment(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1027,7 +1062,7 @@ pub async fn delete_subscription(configuration: &configuration::Configuration, a } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1063,7 +1098,7 @@ pub async fn delete_template(configuration: &configuration::Configuration, templ } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1098,7 +1133,7 @@ pub async fn delete_user(configuration: &configuration::Configuration, app_id: & } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1134,7 +1169,7 @@ pub async fn export_events(configuration: &configuration::Configuration, notific } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1169,7 +1204,7 @@ pub async fn export_subscriptions(configuration: &configuration::Configuration, } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1205,7 +1240,7 @@ pub async fn get_aliases(configuration: &configuration::Configuration, app_id: & } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1240,7 +1275,7 @@ pub async fn get_aliases_by_subscription(configuration: &configuration::Configur } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1275,7 +1310,7 @@ pub async fn get_app(configuration: &configuration::Configuration, app_id: &str) } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1310,7 +1345,7 @@ pub async fn get_apps(configuration: &configuration::Configuration, ) -> Result< } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1346,7 +1381,7 @@ pub async fn get_notification(configuration: &configuration::Configuration, app_ } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1381,7 +1416,7 @@ pub async fn get_notification_history(configuration: &configuration::Configurati } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1430,7 +1465,7 @@ pub async fn get_notifications(configuration: &configuration::Configuration, app } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1478,7 +1513,7 @@ pub async fn get_outcomes(configuration: &configuration::Configuration, app_id: } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1499,6 +1534,44 @@ pub async fn get_outcomes(configuration: &configuration::Configuration, app_id: } } +/// Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. +pub async fn get_segment(configuration: &configuration::Configuration, app_id: &str, segment_id: &str, include_segment_detail: Option) -> Result> { + let configuration = configuration; + + let client = &configuration.client; + + let uri_str = format!("{}/apps/{app_id}/segments/{segment_id}", configuration.base_path, app_id=crate::apis::urlencode(app_id), segment_id=crate::apis::urlencode(segment_id)); + let mut req_builder = client.request(reqwest::Method::GET, uri_str.as_str()); + + if let Some(ref str) = include_segment_detail { + req_builder = req_builder.query(&[("include-segment-detail", &str.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + // Adds a telemetry header + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); + + if let Some(ref token) = configuration.rest_api_key_token { + req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); + } + + let req = req_builder.build()?; + let resp = client.execute(req).await?; + + let status = resp.status(); + let content = resp.text().await?; + + if !status.is_client_error() && !status.is_server_error() { + serde_json::from_str(&content).map_err(Error::from) + } else { + let entity: Option = serde_json::from_str(&content).ok(); + let error = ResponseContent { status: status, content: content, entity: entity }; + Err(Error::ResponseError(error)) + } +} + /// Returns an array of segments from an app. pub async fn get_segments(configuration: &configuration::Configuration, app_id: &str, offset: Option, limit: Option) -> Result> { let configuration = configuration; @@ -1519,7 +1592,7 @@ pub async fn get_segments(configuration: &configuration::Configuration, app_id: } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1554,7 +1627,7 @@ pub async fn get_user(configuration: &configuration::Configuration, app_id: &str } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1575,6 +1648,95 @@ pub async fn get_user(configuration: &configuration::Configuration, app_id: &str } } +/// Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled. +pub async fn list_audit_logs(configuration: &configuration::Configuration, organization_id: &str, start_time: Option<&str>, end_time: Option<&str>, cursor: Option<&str>, limit: Option, app_ids: Option>, actions: Option>, actor_ids: Option>, actor_emails: Option>, target_types: Option>, target_ids: Option>, ip_addresses: Option>) -> Result> { + let configuration = configuration; + + let client = &configuration.client; + + let uri_str = format!("{}/organizations/{organization_id}/audit_logs", configuration.base_path, organization_id=crate::apis::urlencode(organization_id)); + let mut req_builder = client.request(reqwest::Method::GET, uri_str.as_str()); + + if let Some(ref str) = start_time { + req_builder = req_builder.query(&[("start_time", &str.to_string())]); + } + if let Some(ref str) = end_time { + req_builder = req_builder.query(&[("end_time", &str.to_string())]); + } + if let Some(ref str) = cursor { + req_builder = req_builder.query(&[("cursor", &str.to_string())]); + } + if let Some(ref str) = limit { + req_builder = req_builder.query(&[("limit", &str.to_string())]); + } + if let Some(ref str) = app_ids { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("app_ids".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("app_ids", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = actions { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("actions".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("actions", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = actor_ids { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("actor_ids".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("actor_ids", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = actor_emails { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("actor_emails".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("actor_emails", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = target_types { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("target_types".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("target_types", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = target_ids { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("target_ids".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("target_ids", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref str) = ip_addresses { + req_builder = match "multi" { + "multi" => req_builder.query(&str.into_iter().map(|p| ("ip_addresses".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("ip_addresses", &str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + // Adds a telemetry header + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); + + if let Some(ref token) = configuration.organization_api_key_token { + req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); + } + + let req = req_builder.build()?; + let resp = client.execute(req).await?; + + let status = resp.status(); + let content = resp.text().await?; + + if !status.is_client_error() && !status.is_server_error() { + serde_json::from_str(&content).map_err(Error::from) + } else { + let entity: Option = serde_json::from_str(&content).ok(); + let error = ResponseContent { status: status, content: content, entity: entity }; + Err(Error::ResponseError(error)) + } +} + /// Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch. pub async fn rotate_api_key(configuration: &configuration::Configuration, app_id: &str, token_id: &str) -> Result> { let configuration = configuration; @@ -1589,7 +1751,7 @@ pub async fn rotate_api_key(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1624,7 +1786,7 @@ pub async fn start_live_activity(configuration: &configuration::Configuration, a } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1660,7 +1822,7 @@ pub async fn transfer_subscription(configuration: &configuration::Configuration, } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1697,7 +1859,7 @@ pub async fn unsubscribe_email_with_token(configuration: &configuration::Configu } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1732,7 +1894,7 @@ pub async fn update_api_key(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1768,7 +1930,7 @@ pub async fn update_app(configuration: &configuration::Configuration, app_id: &s } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1804,7 +1966,7 @@ pub async fn update_live_activity(configuration: &configuration::Configuration, } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1826,6 +1988,42 @@ pub async fn update_live_activity(configuration: &configuration::Configuration, } } +/// 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. +pub async fn update_segment(configuration: &configuration::Configuration, app_id: &str, segment_id: &str, update_segment_request: Option) -> Result> { + let configuration = configuration; + + let client = &configuration.client; + + let uri_str = format!("{}/apps/{app_id}/segments/{segment_id}", configuration.base_path, app_id=crate::apis::urlencode(app_id), segment_id=crate::apis::urlencode(segment_id)); + let mut req_builder = client.request(reqwest::Method::PATCH, uri_str.as_str()); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + // Adds a telemetry header + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); + + if let Some(ref token) = configuration.rest_api_key_token { + req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); + } + req_builder = req_builder.json(&update_segment_request); + + let req = req_builder.build()?; + let resp = client.execute(req).await?; + + let status = resp.status(); + let content = resp.text().await?; + + if !status.is_client_error() && !status.is_server_error() { + serde_json::from_str(&content).map_err(Error::from) + } else { + let entity: Option = serde_json::from_str(&content).ok(); + let error = ResponseContent { status: status, content: content, entity: entity }; + Err(Error::ResponseError(error)) + } +} + /// Updates an existing Subscription’s properties. pub async fn update_subscription(configuration: &configuration::Configuration, app_id: &str, subscription_id: &str, subscription_body: crate::models::SubscriptionBody) -> Result<(), Error> { let configuration = configuration; @@ -1840,7 +2038,7 @@ pub async fn update_subscription(configuration: &configuration::Configuration, a } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1876,7 +2074,7 @@ pub async fn update_subscription_by_token(configuration: &configuration::Configu } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1913,7 +2111,7 @@ pub async fn update_template(configuration: &configuration::Configuration, templ } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1949,7 +2147,7 @@ pub async fn update_user(configuration: &configuration::Configuration, app_id: & } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -1985,7 +2183,7 @@ pub async fn view_api_keys(configuration: &configuration::Configuration, app_id: } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.organization_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -2021,7 +2219,7 @@ pub async fn view_template(configuration: &configuration::Configuration, templat } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); @@ -2066,7 +2264,7 @@ pub async fn view_templates(configuration: &configuration::Configuration, app_id } // Adds a telemetry header - req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.10.0"); + req_builder = req_builder.header("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-rust, version=5.11.0"); if let Some(ref token) = configuration.rest_api_key_token { req_builder = req_builder.header("Authorization", format!("Key {}", token.to_owned())); diff --git a/src/models/api_key_token.rs b/src/models/api_key_token.rs index 194784d..ae7fa82 100644 --- a/src/models/api_key_token.rs +++ b/src/models/api_key_token.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/api_key_tokens_list_response.rs b/src/models/api_key_tokens_list_response.rs index 33f3fae..ec5745e 100644 --- a/src/models/api_key_tokens_list_response.rs +++ b/src/models/api_key_tokens_list_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/app.rs b/src/models/app.rs index 727e96e..68a9dc6 100644 --- a/src/models/app.rs +++ b/src/models/app.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/audit_log_actor.rs b/src/models/audit_log_actor.rs new file mode 100644 index 0000000..76b4847 --- /dev/null +++ b/src/models/audit_log_actor.rs @@ -0,0 +1,47 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + +/// AuditLogActor : The user or service that performed the action. Absent if the actor is unknown. + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AuditLogActor { + /// Email address of the actor. Absent if unavailable. + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// UUID of the actor. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Additional actor-specific data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Display name of the actor. Absent if unavailable. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Actor type (e.g. member, api_key, system). + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option, +} + +impl AuditLogActor { + /// The user or service that performed the action. Absent if the actor is unknown. + pub fn new() -> AuditLogActor { + AuditLogActor { + email: None, + id: None, + metadata: None, + name: None, + _type: None, + } + } +} + + diff --git a/src/models/audit_log_context.rs b/src/models/audit_log_context.rs new file mode 100644 index 0000000..653a069 --- /dev/null +++ b/src/models/audit_log_context.rs @@ -0,0 +1,43 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + +/// AuditLogContext : Request context at the time of the event. Absent if context was not captured. + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AuditLogContext { + /// Country code derived from the request IP. + #[serde(rename = "country", skip_serializing_if = "Option::is_none")] + pub country: Option, + /// IP address the request originated from. + #[serde(rename = "ip", skip_serializing_if = "Option::is_none")] + pub ip: Option, + /// Additional context-specific data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// User agent of the client that made the request. + #[serde(rename = "user_agent", skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} + +impl AuditLogContext { + /// Request context at the time of the event. Absent if context was not captured. + pub fn new() -> AuditLogContext { + AuditLogContext { + country: None, + ip: None, + metadata: None, + user_agent: None, + } + } +} + + diff --git a/src/models/audit_log_event.rs b/src/models/audit_log_event.rs new file mode 100644 index 0000000..c023b37 --- /dev/null +++ b/src/models/audit_log_event.rs @@ -0,0 +1,63 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AuditLogEvent { + /// The action that was performed (e.g. notification.sent, segment.created, member.invited). + #[serde(rename = "action", skip_serializing_if = "Option::is_none")] + pub action: Option, + #[serde(rename = "actor", skip_serializing_if = "Option::is_none")] + pub actor: Option>, + /// UUID of the app the event is associated with. Absent for org-level events. + #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + /// UUID of the audit log event. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Additional event-specific data that does not fit into the standard fields. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). + #[serde(rename = "occurred_at", skip_serializing_if = "Option::is_none")] + pub occurred_at: Option, + /// UUID of the organization the event belongs to. + #[serde(rename = "organization_id", skip_serializing_if = "Option::is_none")] + pub organization_id: Option, + /// The resources the action was performed on. May be empty for org-level events. + #[serde(rename = "targets", skip_serializing_if = "Option::is_none")] + pub targets: Option>, + /// Schema version of the event payload. + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl AuditLogEvent { + pub fn new() -> AuditLogEvent { + AuditLogEvent { + action: None, + actor: None, + app_id: None, + context: None, + id: None, + metadata: None, + occurred_at: None, + organization_id: None, + targets: None, + version: None, + } + } +} + + diff --git a/src/models/audit_log_target.rs b/src/models/audit_log_target.rs new file mode 100644 index 0000000..fab7459 --- /dev/null +++ b/src/models/audit_log_target.rs @@ -0,0 +1,43 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + +/// AuditLogTarget : A resource the action was performed on. + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AuditLogTarget { + /// UUID of the resource. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Additional resource-specific data. + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Display name of the resource. Absent if unavailable. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Resource type (e.g. notification, segment, journey, app). + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option, +} + +impl AuditLogTarget { + /// A resource the action was performed on. + pub fn new() -> AuditLogTarget { + AuditLogTarget { + id: None, + metadata: None, + name: None, + _type: None, + } + } +} + + diff --git a/src/models/basic_notification.rs b/src/models/basic_notification.rs index 87d8e1b..173f313 100644 --- a/src/models/basic_notification.rs +++ b/src/models/basic_notification.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/basic_notification_all_of.rs b/src/models/basic_notification_all_of.rs index ab30367..7029b32 100644 --- a/src/models/basic_notification_all_of.rs +++ b/src/models/basic_notification_all_of.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/basic_notification_all_of_android_background_layout.rs b/src/models/basic_notification_all_of_android_background_layout.rs index 05d86fc..b942b8a 100644 --- a/src/models/basic_notification_all_of_android_background_layout.rs +++ b/src/models/basic_notification_all_of_android_background_layout.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/button.rs b/src/models/button.rs index e34b4d3..fda8b13 100644 --- a/src/models/button.rs +++ b/src/models/button.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/copy_template_request.rs b/src/models/copy_template_request.rs index 0e31f23..4aa44dc 100644 --- a/src/models/copy_template_request.rs +++ b/src/models/copy_template_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_api_key_request.rs b/src/models/create_api_key_request.rs index ddc36f9..740ddbd 100644 --- a/src/models/create_api_key_request.rs +++ b/src/models/create_api_key_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_api_key_response.rs b/src/models/create_api_key_response.rs index 4f781b8..e05fdde 100644 --- a/src/models/create_api_key_response.rs +++ b/src/models/create_api_key_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_notification_success_response.rs b/src/models/create_notification_success_response.rs index 4877021..d03260c 100644 --- a/src/models/create_notification_success_response.rs +++ b/src/models/create_notification_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_segment_conflict_response.rs b/src/models/create_segment_conflict_response.rs index d0e2641..61391c2 100644 --- a/src/models/create_segment_conflict_response.rs +++ b/src/models/create_segment_conflict_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_segment_success_response.rs b/src/models/create_segment_success_response.rs index fec8ca2..9fad12f 100644 --- a/src/models/create_segment_success_response.rs +++ b/src/models/create_segment_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_template_request.rs b/src/models/create_template_request.rs index e9239d5..44bd4fd 100644 --- a/src/models/create_template_request.rs +++ b/src/models/create_template_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_user_conflict_response.rs b/src/models/create_user_conflict_response.rs index 25c56f3..8040fcb 100644 --- a/src/models/create_user_conflict_response.rs +++ b/src/models/create_user_conflict_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_user_conflict_response_errors_inner.rs b/src/models/create_user_conflict_response_errors_inner.rs index ffb24aa..4988443 100644 --- a/src/models/create_user_conflict_response_errors_inner.rs +++ b/src/models/create_user_conflict_response_errors_inner.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/create_user_conflict_response_errors_items_meta.rs b/src/models/create_user_conflict_response_errors_items_meta.rs index 6883d31..5648f3f 100644 --- a/src/models/create_user_conflict_response_errors_items_meta.rs +++ b/src/models/create_user_conflict_response_errors_items_meta.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/custom_event.rs b/src/models/custom_event.rs index 39ecfa2..3d13b35 100644 --- a/src/models/custom_event.rs +++ b/src/models/custom_event.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/custom_events_request.rs b/src/models/custom_events_request.rs index 467fde6..c3878ab 100644 --- a/src/models/custom_events_request.rs +++ b/src/models/custom_events_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/delivery_data.rs b/src/models/delivery_data.rs index 90f0d5a..0451042 100644 --- a/src/models/delivery_data.rs +++ b/src/models/delivery_data.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/export_events_success_response.rs b/src/models/export_events_success_response.rs index 3ebbe83..3312759 100644 --- a/src/models/export_events_success_response.rs +++ b/src/models/export_events_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/export_subscriptions_request_body.rs b/src/models/export_subscriptions_request_body.rs index 605374f..5f089dd 100644 --- a/src/models/export_subscriptions_request_body.rs +++ b/src/models/export_subscriptions_request_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/export_subscriptions_success_response.rs b/src/models/export_subscriptions_success_response.rs index 52f6341..a225d55 100644 --- a/src/models/export_subscriptions_success_response.rs +++ b/src/models/export_subscriptions_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/filter.rs b/src/models/filter.rs index cd42590..2d7ec79 100644 --- a/src/models/filter.rs +++ b/src/models/filter.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/filter_expression.rs b/src/models/filter_expression.rs index ae5854f..15e1bf5 100644 --- a/src/models/filter_expression.rs +++ b/src/models/filter_expression.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/generic_error.rs b/src/models/generic_error.rs index ba9e528..bdcc3ba 100644 --- a/src/models/generic_error.rs +++ b/src/models/generic_error.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/generic_success_bool_response.rs b/src/models/generic_success_bool_response.rs index 03c0ccc..45c615b 100644 --- a/src/models/generic_success_bool_response.rs +++ b/src/models/generic_success_bool_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/get_notification_history_request_body.rs b/src/models/get_notification_history_request_body.rs index e2e7701..63e3e13 100644 --- a/src/models/get_notification_history_request_body.rs +++ b/src/models/get_notification_history_request_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/get_segment_success_response.rs b/src/models/get_segment_success_response.rs new file mode 100644 index 0000000..a486fb1 --- /dev/null +++ b/src/models/get_segment_success_response.rs @@ -0,0 +1,32 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GetSegmentSuccessResponse { + /// The number of subscribers matching this segment. + #[serde(rename = "subscriber_count", skip_serializing_if = "Option::is_none")] + pub subscriber_count: Option, + #[serde(rename = "payload", skip_serializing_if = "Option::is_none")] + pub payload: Option>, +} + +impl GetSegmentSuccessResponse { + pub fn new() -> GetSegmentSuccessResponse { + GetSegmentSuccessResponse { + subscriber_count: None, + payload: None, + } + } +} + + diff --git a/src/models/get_segments_success_response.rs b/src/models/get_segments_success_response.rs index e164c23..0c94c8e 100644 --- a/src/models/get_segments_success_response.rs +++ b/src/models/get_segments_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/language_string_map.rs b/src/models/language_string_map.rs index cf39ee3..3ef2e93 100644 --- a/src/models/language_string_map.rs +++ b/src/models/language_string_map.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/list_audit_logs_success_response.rs b/src/models/list_audit_logs_success_response.rs new file mode 100644 index 0000000..32dd6f6 --- /dev/null +++ b/src/models/list_audit_logs_success_response.rs @@ -0,0 +1,37 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ListAuditLogsSuccessResponse { + /// Array of audit log events, ordered by occurred_at ascending. + #[serde(rename = "audit_logs", skip_serializing_if = "Option::is_none")] + pub audit_logs: Option>, + /// True if additional events exist beyond this page. Use next_cursor to fetch the next page. + #[serde(rename = "has_more", skip_serializing_if = "Option::is_none")] + pub has_more: Option, + /// Opaque cursor to pass as cursor in the next request. Only present when has_more is true. + #[serde(rename = "next_cursor", skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, +} + +impl ListAuditLogsSuccessResponse { + pub fn new() -> ListAuditLogsSuccessResponse { + ListAuditLogsSuccessResponse { + audit_logs: None, + has_more: None, + next_cursor: None, + } + } +} + + diff --git a/src/models/mod.rs b/src/models/mod.rs index ebde249..bec6ea8 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -4,6 +4,14 @@ pub mod api_key_tokens_list_response; pub use self::api_key_tokens_list_response::ApiKeyTokensListResponse; pub mod app; pub use self::app::App; +pub mod audit_log_actor; +pub use self::audit_log_actor::AuditLogActor; +pub mod audit_log_context; +pub use self::audit_log_context::AuditLogContext; +pub mod audit_log_event; +pub use self::audit_log_event::AuditLogEvent; +pub mod audit_log_target; +pub use self::audit_log_target::AuditLogTarget; pub mod basic_notification; pub use self::basic_notification::BasicNotification; pub mod basic_notification_all_of; @@ -54,10 +62,14 @@ pub mod generic_success_bool_response; pub use self::generic_success_bool_response::GenericSuccessBoolResponse; pub mod get_notification_history_request_body; pub use self::get_notification_history_request_body::GetNotificationHistoryRequestBody; +pub mod get_segment_success_response; +pub use self::get_segment_success_response::GetSegmentSuccessResponse; pub mod get_segments_success_response; pub use self::get_segments_success_response::GetSegmentsSuccessResponse; pub mod language_string_map; pub use self::language_string_map::LanguageStringMap; +pub mod list_audit_logs_success_response; +pub use self::list_audit_logs_success_response::ListAuditLogsSuccessResponse; pub mod notification; pub use self::notification::Notification; pub mod notification_all_of; @@ -98,6 +110,8 @@ pub mod segment; pub use self::segment::Segment; pub mod segment_data; pub use self::segment_data::SegmentData; +pub mod segment_details; +pub use self::segment_details::SegmentDetails; pub mod segment_notification_target; pub use self::segment_notification_target::SegmentNotificationTarget; pub mod start_live_activity_request; @@ -122,6 +136,10 @@ pub mod update_live_activity_request; pub use self::update_live_activity_request::UpdateLiveActivityRequest; pub mod update_live_activity_success_response; pub use self::update_live_activity_success_response::UpdateLiveActivitySuccessResponse; +pub mod update_segment_request; +pub use self::update_segment_request::UpdateSegmentRequest; +pub mod update_segment_success_response; +pub use self::update_segment_success_response::UpdateSegmentSuccessResponse; pub mod update_template_request; pub use self::update_template_request::UpdateTemplateRequest; pub mod update_user_request; diff --git a/src/models/notification.rs b/src/models/notification.rs index 8738d1a..6f336e0 100644 --- a/src/models/notification.rs +++ b/src/models/notification.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_all_of.rs b/src/models/notification_all_of.rs index af050c5..3a6e4cf 100644 --- a/src/models/notification_all_of.rs +++ b/src/models/notification_all_of.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_history_success_response.rs b/src/models/notification_history_success_response.rs index 560e4f3..efc8719 100644 --- a/src/models/notification_history_success_response.rs +++ b/src/models/notification_history_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_slice.rs b/src/models/notification_slice.rs index d9960d9..0329af0 100644 --- a/src/models/notification_slice.rs +++ b/src/models/notification_slice.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_target.rs b/src/models/notification_target.rs index 044ce32..f7dd705 100644 --- a/src/models/notification_target.rs +++ b/src/models/notification_target.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_with_meta.rs b/src/models/notification_with_meta.rs index 397e71b..8d19fcc 100644 --- a/src/models/notification_with_meta.rs +++ b/src/models/notification_with_meta.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/notification_with_meta_all_of.rs b/src/models/notification_with_meta_all_of.rs index 50ff860..54d377b 100644 --- a/src/models/notification_with_meta_all_of.rs +++ b/src/models/notification_with_meta_all_of.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/operator.rs b/src/models/operator.rs index dd06b31..695ea04 100644 --- a/src/models/operator.rs +++ b/src/models/operator.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/outcome_data.rs b/src/models/outcome_data.rs index 57dcb08..85a1339 100644 --- a/src/models/outcome_data.rs +++ b/src/models/outcome_data.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/outcomes_data.rs b/src/models/outcomes_data.rs index 283da24..19bdccc 100644 --- a/src/models/outcomes_data.rs +++ b/src/models/outcomes_data.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/platform_delivery_data.rs b/src/models/platform_delivery_data.rs index dfb5d9b..90ebe98 100644 --- a/src/models/platform_delivery_data.rs +++ b/src/models/platform_delivery_data.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/platform_delivery_data_email_all_of.rs b/src/models/platform_delivery_data_email_all_of.rs index 9f4796c..ac9824c 100644 --- a/src/models/platform_delivery_data_email_all_of.rs +++ b/src/models/platform_delivery_data_email_all_of.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/platform_delivery_data_sms_all_of.rs b/src/models/platform_delivery_data_sms_all_of.rs index 367f828..01896cf 100644 --- a/src/models/platform_delivery_data_sms_all_of.rs +++ b/src/models/platform_delivery_data_sms_all_of.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/properties_body.rs b/src/models/properties_body.rs index bca148f..4611498 100644 --- a/src/models/properties_body.rs +++ b/src/models/properties_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/properties_deltas.rs b/src/models/properties_deltas.rs index f371968..44e7542 100644 --- a/src/models/properties_deltas.rs +++ b/src/models/properties_deltas.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/properties_object.rs b/src/models/properties_object.rs index 6bdf815..ebd4ade 100644 --- a/src/models/properties_object.rs +++ b/src/models/properties_object.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/purchase.rs b/src/models/purchase.rs index e786357..3bdd040 100644 --- a/src/models/purchase.rs +++ b/src/models/purchase.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/rate_limit_error.rs b/src/models/rate_limit_error.rs index 2b951bd..37f6c8c 100644 --- a/src/models/rate_limit_error.rs +++ b/src/models/rate_limit_error.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/segment.rs b/src/models/segment.rs index d168352..45f048e 100644 --- a/src/models/segment.rs +++ b/src/models/segment.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/segment_data.rs b/src/models/segment_data.rs index d0335c1..e461e3a 100644 --- a/src/models/segment_data.rs +++ b/src/models/segment_data.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/segment_details.rs b/src/models/segment_details.rs new file mode 100644 index 0000000..4bcc748 --- /dev/null +++ b/src/models/segment_details.rs @@ -0,0 +1,67 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + +/// SegmentDetails : Segment details. Only included when the include-segment-detail query parameter is set to true. + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SegmentDetails { + /// The unique identifier for the segment (UUID v4). + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The segment name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Human-readable description for the segment. `null` when unset. Maximum 255 characters. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Unix timestamp when the segment was created. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// The source of the segment. + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + /// 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. + #[serde(rename = "filters", skip_serializing_if = "Option::is_none")] + pub filters: Option>, +} + +impl SegmentDetails { + /// Segment details. Only included when the include-segment-detail query parameter is set to true. + pub fn new() -> SegmentDetails { + SegmentDetails { + id: None, + name: None, + description: None, + created_at: None, + source: None, + filters: None, + } + } +} + +/// The source of the segment. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SourceType { + #[serde(rename = "default")] + Default, + #[serde(rename = "custom")] + Custom, + #[serde(rename = "quickstart")] + Quickstart, +} + +impl Default for SourceType { + fn default() -> SourceType { + Self::Default + } +} + diff --git a/src/models/segment_notification_target.rs b/src/models/segment_notification_target.rs index c0eff03..8b6f8a8 100644 --- a/src/models/segment_notification_target.rs +++ b/src/models/segment_notification_target.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/start_live_activity_request.rs b/src/models/start_live_activity_request.rs index 1e36245..564b539 100644 --- a/src/models/start_live_activity_request.rs +++ b/src/models/start_live_activity_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/start_live_activity_success_response.rs b/src/models/start_live_activity_success_response.rs index 0099606..2a5bce7 100644 --- a/src/models/start_live_activity_success_response.rs +++ b/src/models/start_live_activity_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/subscription.rs b/src/models/subscription.rs index 4017f44..f106e93 100644 --- a/src/models/subscription.rs +++ b/src/models/subscription.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/subscription_body.rs b/src/models/subscription_body.rs index 3f69959..568c861 100644 --- a/src/models/subscription_body.rs +++ b/src/models/subscription_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/subscription_notification_target.rs b/src/models/subscription_notification_target.rs index 8874545..351c843 100644 --- a/src/models/subscription_notification_target.rs +++ b/src/models/subscription_notification_target.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/template_resource.rs b/src/models/template_resource.rs index 339feb6..743fb6c 100644 --- a/src/models/template_resource.rs +++ b/src/models/template_resource.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/templates_list_response.rs b/src/models/templates_list_response.rs index 0c4db93..f4e3e5b 100644 --- a/src/models/templates_list_response.rs +++ b/src/models/templates_list_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/transfer_subscription_request_body.rs b/src/models/transfer_subscription_request_body.rs index 2720091..3dd2a28 100644 --- a/src/models/transfer_subscription_request_body.rs +++ b/src/models/transfer_subscription_request_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_api_key_request.rs b/src/models/update_api_key_request.rs index c9b8754..7a5561d 100644 --- a/src/models/update_api_key_request.rs +++ b/src/models/update_api_key_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_live_activity_request.rs b/src/models/update_live_activity_request.rs index 2341673..44f8e59 100644 --- a/src/models/update_live_activity_request.rs +++ b/src/models/update_live_activity_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_live_activity_success_response.rs b/src/models/update_live_activity_success_response.rs index 497d1b9..1170350 100644 --- a/src/models/update_live_activity_success_response.rs +++ b/src/models/update_live_activity_success_response.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_segment_request.rs b/src/models/update_segment_request.rs new file mode 100644 index 0000000..df5be52 --- /dev/null +++ b/src/models/update_segment_request.rs @@ -0,0 +1,37 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateSegmentRequest { + /// Required. The segment name. Maximum 128 characters. + #[serde(rename = "name")] + pub name: String, + /// Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// 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. + #[serde(rename = "filters", skip_serializing_if = "Option::is_none")] + pub filters: Option>, +} + +impl UpdateSegmentRequest { + pub fn new(name: String) -> UpdateSegmentRequest { + UpdateSegmentRequest { + name, + description: None, + filters: None, + } + } +} + + diff --git a/src/models/update_segment_success_response.rs b/src/models/update_segment_success_response.rs new file mode 100644 index 0000000..0bf7478 --- /dev/null +++ b/src/models/update_segment_success_response.rs @@ -0,0 +1,33 @@ +/* + * OneSignal + * + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateSegmentSuccessResponse { + /// true if the segment was updated successfully, false otherwise. + #[serde(rename = "success", skip_serializing_if = "Option::is_none")] + pub success: Option, + /// UUID of the updated segment. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, +} + +impl UpdateSegmentSuccessResponse { + pub fn new() -> UpdateSegmentSuccessResponse { + UpdateSegmentSuccessResponse { + success: None, + id: None, + } + } +} + + diff --git a/src/models/update_template_request.rs b/src/models/update_template_request.rs index 6e0a274..401367d 100644 --- a/src/models/update_template_request.rs +++ b/src/models/update_template_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/update_user_request.rs b/src/models/update_user_request.rs index 826ba24..2af1307 100644 --- a/src/models/update_user_request.rs +++ b/src/models/update_user_request.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/user.rs b/src/models/user.rs index cc3bddf..265a47b 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/user_identity_body.rs b/src/models/user_identity_body.rs index aba401b..d70f33f 100644 --- a/src/models/user_identity_body.rs +++ b/src/models/user_identity_body.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */ diff --git a/src/models/web_button.rs b/src/models/web_button.rs index 21cc58c..4be540d 100644 --- a/src/models/web_button.rs +++ b/src/models/web_button.rs @@ -3,7 +3,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech */