From 9a95b8543f296b73dccdf1c7e59f335a6c856a1b Mon Sep 17 00:00:00 2001 From: OneSignal Date: Mon, 27 Jul 2026 23:21:23 +0000 Subject: [PATCH] feat: add v5.10.0 package updates --- 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/default_api.rs | 198 +++++++++++++++++ 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/get_segment_success_response.rs | 32 +++ .../list_audit_logs_success_response.rs | 37 ++++ src/models/mod.rs | 18 ++ src/models/segment_details.rs | 67 ++++++ src/models/update_segment_request.rs | 37 ++++ src/models/update_segment_success_response.rs | 33 +++ 21 files changed, 956 insertions(+) create mode 100644 docs/AuditLogActor.md create mode 100644 docs/AuditLogContext.md create mode 100644 docs/AuditLogEvent.md create mode 100644 docs/AuditLogTarget.md create mode 100644 docs/GetSegmentSuccessResponse.md create mode 100644 docs/ListAuditLogsSuccessResponse.md create mode 100644 docs/SegmentDetails.md create mode 100644 docs/UpdateSegmentRequest.md create mode 100644 docs/UpdateSegmentSuccessResponse.md create mode 100644 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/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/default_api.rs b/src/apis/default_api.rs index 48e01ce..bbf3d90 100644 --- a/src/apis/default_api.rs +++ b/src/apis/default_api.rs @@ -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)] @@ -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.10.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; @@ -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.10.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; @@ -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.10.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; diff --git a/src/models/audit_log_actor.rs b/src/models/audit_log_actor.rs new file mode 100644 index 0000000..671128c --- /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.10.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..b256eed --- /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.10.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..b6686ec --- /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.10.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..2f6d3f2 --- /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.10.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/get_segment_success_response.rs b/src/models/get_segment_success_response.rs new file mode 100644 index 0000000..da24e8a --- /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.10.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/list_audit_logs_success_response.rs b/src/models/list_audit_logs_success_response.rs new file mode 100644 index 0000000..fb9576a --- /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.10.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/segment_details.rs b/src/models/segment_details.rs new file mode 100644 index 0000000..39bc9f6 --- /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.10.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/update_segment_request.rs b/src/models/update_segment_request.rs new file mode 100644 index 0000000..2253af5 --- /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.10.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..e36d195 --- /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.10.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, + } + } +} + +