diff --git a/README.md b/README.md index 74851cb..2e2702f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > **Building with an AI agent or LLM?** See [AGENTS.md](https://github.com/OneSignal/onesignal-java-api/blob/main/AGENTS.md) for an agent-oriented integration guide — authentication, calling conventions, idempotent retries, and the full API reference. OneSignal -- API version: 5.10.0 +- API version: 5.11.0 A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com @@ -21,14 +21,14 @@ Building the API client library requires: com.onesignal onesignal-java-client - 5.10.0 + 5.11.0 ``` ### Gradle ```groovy -implementation "com.onesignal:onesignal-java-client:5.10.0" +implementation "com.onesignal:onesignal-java-client:5.11.0" ``` ## Configuration diff --git a/api/openapi.yaml b/api/openapi.yaml index 41b0fe8..dc7a687 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8,7 +8,7 @@ info: customer engagement strategies. Learn more at onesignal.com termsOfService: https://onesignal.com/tos title: OneSignal - version: 5.10.0 + version: 5.11.0 servers: - url: https://api.onesignal.com paths: @@ -721,6 +721,147 @@ paths: - rest_api_key: [] summary: Delete Segment x-accepts: application/json + get: + description: "Retrieve details for a single segment by its ID, including subscriber\ + \ count and optionally segment metadata and filters." + operationId: get_segment + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: 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. + explode: false + in: path + name: segment_id + required: true + schema: + example: d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e + type: string + style: simple + - description: Set to true to include segment metadata and filters in the response. + explode: true + in: query + name: include-segment-detail + required: false + schema: + example: true + type: boolean + style: form + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetSegmentSuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: View Segment + x-accepts: application/json + patch: + description: "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." + operationId: update_segment + parameters: + - description: The OneSignal App ID for your app. Available in Keys & IDs. + explode: false + in: path + name: app_id + required: true + schema: + example: YOUR_APP_ID + type: string + style: simple + - description: 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. + explode: false + in: path + name: segment_id + required: true + schema: + example: d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSegmentRequest' + required: false + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSegmentSuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - rest_api_key: [] + summary: Update Segment + x-content-type: application/json + x-accepts: application/json /apps/{app_id}/outcomes: get: description: "View the details of all the outcomes associated with your app\n\ @@ -2713,6 +2854,183 @@ paths: summary: Create custom events x-content-type: application/json x-accepts: application/json + /organizations/{organization_id}/audit_logs: + get: + description: "Retrieve a paginated, time-scoped list of audit log events for\ + \ an organization. Requires an Enterprise plan with the audit logs entitlement\ + \ enabled." + operationId: list_audit_logs + parameters: + - description: The UUID of the organization to retrieve audit logs for. Must + match the authenticated Organization API Key. + explode: false + in: path + name: organization_id + required: true + schema: + example: YOUR_ORG_ID + type: string + style: simple + - description: 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. + explode: true + in: query + name: start_time + required: false + schema: + type: string + style: form + - description: End of the time range in ISO 8601 format. Defaults to the current + time. Must be after start_time. + explode: true + in: query + name: end_time + required: false + schema: + type: string + style: form + - description: "Pagination cursor returned in a previous response as next_cursor.\ + \ When provided, start_time and end_time are ignored." + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: "Maximum number of events to return per page. Minimum 1, maximum\ + \ 100. Values outside this range are clamped automatically by the server." + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - description: Filter events by app UUID. Accepts up to 10 values. Org-level + events are always included. + explode: true + in: query + name: app_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: "Filter by action type (e.g. notification.sent, segment.created).\ + \ Accepts up to 20 values." + explode: true + in: query + name: actions + required: false + schema: + items: + type: string + maxItems: 20 + type: array + style: form + - description: Filter by actor UUID (the user or service that performed the + action). Accepts up to 10 values. + explode: true + in: query + name: actor_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by actor email address. Accepts up to 10 values. + explode: true + in: query + name: actor_emails + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: "Filter by the type of resource the action was performed on (e.g.\ + \ notification, segment, journey). Accepts up to 10 values." + explode: true + in: query + name: target_types + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by the UUID of the resource the action was performed on. + Accepts up to 10 values. + explode: true + in: query + name: target_ids + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + - description: Filter by the IP address the action originated from. Accepts + up to 10 values. + explode: true + in: query + name: ip_addresses + required: false + schema: + items: + type: string + maxItems: 10 + type: array + style: form + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Unexpected error + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListAuditLogsSuccessResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Not Found + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/RateLimitError' + description: Rate Limit Exceeded + security: + - organization_api_key: [] + summary: List audit logs + x-accepts: application/json components: requestBodies: get_notification_history_request_body: @@ -3574,6 +3892,107 @@ components: $ref: '#/components/schemas/SegmentData' type: array type: object + SegmentDetails: + description: Segment details. Only included when the include-segment-detail + query parameter is set to true. + example: + name: name + description: description + created_at: 6 + id: id + source: default + filters: + - null + - null + properties: + id: + description: The unique identifier for the segment (UUID v4). + type: string + name: + description: The segment name. + type: string + description: + description: Human-readable description for the segment. `null` when unset. + Maximum 255 characters. + nullable: true + type: string + created_at: + description: Unix timestamp when the segment was created. + type: integer + source: + description: The source of the segment. + enum: + - default + - custom + - quickstart + type: string + filters: + description: "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." + items: + $ref: '#/components/schemas/FilterExpression' + type: array + type: object + GetSegmentSuccessResponse: + example: + payload: + name: name + description: description + created_at: 6 + id: id + source: default + filters: + - null + - null + subscriber_count: 0 + properties: + subscriber_count: + description: The number of subscribers matching this segment. + type: integer + payload: + $ref: '#/components/schemas/SegmentDetails' + type: object + UpdateSegmentRequest: + example: + name: name + description: description + filters: + - null + - null + properties: + name: + description: Required. The segment name. Maximum 128 characters. + maxLength: 128 + type: string + description: + description: Optional human-readable description for the segment. Maximum + 255 characters. Pass an empty string to clear; omit to leave unchanged. + maxLength: 255 + type: string + filters: + description: "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." + items: + $ref: '#/components/schemas/FilterExpression' + type: array + required: + - name + type: object + UpdateSegmentSuccessResponse: + example: + success: true + id: id + properties: + success: + description: "true if the segment was updated successfully, false otherwise." + type: boolean + id: + description: UUID of the updated segment. + type: string + type: object UpdateLiveActivityRequest: example: event_updates: "{}" @@ -5038,6 +5457,214 @@ components: type: string type: array type: object + AuditLogActor: + description: The user or service that performed the action. Absent if the actor + is unknown. + example: + metadata: "{}" + name: name + id: id + type: type + email: email + properties: + email: + description: Email address of the actor. Absent if unavailable. + type: string + id: + description: UUID of the actor. + type: string + metadata: + description: Additional actor-specific data. + type: object + name: + description: Display name of the actor. Absent if unavailable. + type: string + type: + description: "Actor type (e.g. member, api_key, system)." + type: string + type: object + AuditLogTarget: + description: A resource the action was performed on. + example: + metadata: "{}" + name: name + id: id + type: type + properties: + id: + description: UUID of the resource. + type: string + metadata: + description: Additional resource-specific data. + type: object + name: + description: Display name of the resource. Absent if unavailable. + type: string + type: + description: "Resource type (e.g. notification, segment, journey, app)." + type: string + type: object + AuditLogContext: + description: Request context at the time of the event. Absent if context was + not captured. + example: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + properties: + country: + description: Country code derived from the request IP. + type: string + ip: + description: IP address the request originated from. + type: string + metadata: + description: Additional context-specific data. + type: object + user_agent: + description: User agent of the client that made the request. + type: string + type: object + AuditLogEvent: + example: + actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action + id: id + app_id: app_id + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 + properties: + action: + description: "The action that was performed (e.g. notification.sent, segment.created,\ + \ member.invited)." + type: string + actor: + $ref: '#/components/schemas/AuditLogActor' + app_id: + description: UUID of the app the event is associated with. Absent for org-level + events. + type: string + context: + $ref: '#/components/schemas/AuditLogContext' + id: + description: UUID of the audit log event. + type: string + metadata: + description: Additional event-specific data that does not fit into the standard + fields. + type: object + occurred_at: + description: RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). + type: string + organization_id: + description: UUID of the organization the event belongs to. + type: string + targets: + description: The resources the action was performed on. May be empty for + org-level events. + items: + $ref: '#/components/schemas/AuditLogTarget' + type: array + version: + description: Schema version of the event payload. + type: integer + type: object + ListAuditLogsSuccessResponse: + example: + next_cursor: next_cursor + has_more: true + audit_logs: + - actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action + id: id + app_id: app_id + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 + - actor: + metadata: "{}" + name: name + id: id + type: type + email: email + occurred_at: occurred_at + metadata: "{}" + organization_id: organization_id + context: + country: country + metadata: "{}" + ip: ip + user_agent: user_agent + action: action + id: id + app_id: app_id + targets: + - metadata: "{}" + name: name + id: id + type: type + - metadata: "{}" + name: name + id: id + type: type + version: 0 + properties: + audit_logs: + description: "Array of audit log events, ordered by occurred_at ascending." + items: + $ref: '#/components/schemas/AuditLogEvent' + type: array + has_more: + description: True if additional events exist beyond this page. Use next_cursor + to fetch the next page. + type: boolean + next_cursor: + description: Opaque cursor to pass as cursor in the next request. Only present + when has_more is true. + type: string + type: object get_notification_history_request_body: properties: events: diff --git a/build.gradle b/build.gradle index 36a41eb..95c28c4 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'com.vanniktech.maven.publish' group = 'com.onesignal' -version = '5.10.0' +version = '5.11.0' buildscript { repositories { diff --git a/build.sbt b/build.sbt index d47c0e4..aa4d0da 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.onesignal", name := "onesignal-java-client", - version := "5.10.0", + version := "5.11.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/AuditLogActor.md b/docs/AuditLogActor.md new file mode 100644 index 0000000..f5bf77d --- /dev/null +++ b/docs/AuditLogActor.md @@ -0,0 +1,18 @@ + + +# AuditLogActor + +The user or service that performed the action. Absent if the actor is unknown. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**email** | **String** | Email address of the actor. Absent if unavailable. | [optional] | +|**id** | **String** | UUID of the actor. | [optional] | +|**metadata** | **Object** | Additional actor-specific data. | [optional] | +|**name** | **String** | Display name of the actor. Absent if unavailable. | [optional] | +|**type** | **String** | Actor type (e.g. member, api_key, system). | [optional] | + + + diff --git a/docs/AuditLogContext.md b/docs/AuditLogContext.md new file mode 100644 index 0000000..e84e71a --- /dev/null +++ b/docs/AuditLogContext.md @@ -0,0 +1,17 @@ + + +# AuditLogContext + +Request context at the time of the event. Absent if context was not captured. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**country** | **String** | Country code derived from the request IP. | [optional] | +|**ip** | **String** | IP address the request originated from. | [optional] | +|**metadata** | **Object** | Additional context-specific data. | [optional] | +|**userAgent** | **String** | User agent of the client that made the request. | [optional] | + + + diff --git a/docs/AuditLogEvent.md b/docs/AuditLogEvent.md new file mode 100644 index 0000000..0f47d7c --- /dev/null +++ b/docs/AuditLogEvent.md @@ -0,0 +1,22 @@ + + +# AuditLogEvent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**action** | **String** | The action that was performed (e.g. notification.sent, segment.created, member.invited). | [optional] | +|**actor** | [**AuditLogActor**](AuditLogActor.md) | | [optional] | +|**appId** | **String** | UUID of the app the event is associated with. Absent for org-level events. | [optional] | +|**context** | [**AuditLogContext**](AuditLogContext.md) | | [optional] | +|**id** | **String** | UUID of the audit log event. | [optional] | +|**metadata** | **Object** | Additional event-specific data that does not fit into the standard fields. | [optional] | +|**occurredAt** | **String** | RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). | [optional] | +|**organizationId** | **String** | UUID of the organization the event belongs to. | [optional] | +|**targets** | [**List<AuditLogTarget>**](AuditLogTarget.md) | The resources the action was performed on. May be empty for org-level events. | [optional] | +|**version** | **Integer** | Schema version of the event payload. | [optional] | + + + diff --git a/docs/AuditLogTarget.md b/docs/AuditLogTarget.md new file mode 100644 index 0000000..0363c2b --- /dev/null +++ b/docs/AuditLogTarget.md @@ -0,0 +1,17 @@ + + +# AuditLogTarget + +A resource the action was performed on. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | UUID of the resource. | [optional] | +|**metadata** | **Object** | Additional resource-specific data. | [optional] | +|**name** | **String** | Display name of the resource. Absent if unavailable. | [optional] | +|**type** | **String** | Resource type (e.g. notification, segment, journey, app). | [optional] | + + + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 97db482..6bd60f0 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -32,8 +32,10 @@ All URIs are relative to *https://api.onesignal.com* | [**getNotificationHistory**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History | | [**getNotifications**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications | | [**getOutcomes**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | +| [**getSegment**](DefaultApi.md#getSegment) | **GET** /apps/{app_id}/segments/{segment_id} | View Segment | | [**getSegments**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments | | [**getUser**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**listAuditLogs**](DefaultApi.md#listAuditLogs) | **GET** /organizations/{organization_id}/audit_logs | List audit logs | | [**rotateApiKey**](DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key | | [**startLiveActivity**](DefaultApi.md#startLiveActivity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity | | [**transferSubscription**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | @@ -41,6 +43,7 @@ All URIs are relative to *https://api.onesignal.com* | [**updateApiKey**](DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key | | [**updateApp**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app | | [**updateLiveActivity**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | +| [**updateSegment**](DefaultApi.md#updateSegment) | **PATCH** /apps/{app_id}/segments/{segment_id} | Update Segment | | [**updateSubscription**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | | [**updateSubscriptionByToken**](DefaultApi.md#updateSubscriptionByToken) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token | | [**updateTemplate**](DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template | @@ -2330,6 +2333,84 @@ public class Example { | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **getSegment** +> GetSegmentSuccessResponse getSegment(appId, segmentId, includeSegmentDetail) + +View Segment + +Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + +### Example +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // 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. + Boolean includeSegmentDetail = true; // Boolean | Set to true to include segment metadata and filters in the response. + try { + GetSegmentSuccessResponse result = apiInstance.getSegment(appId, segmentId, includeSegmentDetail); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSegment"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segmentId** | **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. | | +| **includeSegmentDetail** | **Boolean**| Set to true to include segment metadata and filters in the response. | [optional] | + +### Return type + +[**GetSegmentSuccessResponse**](GetSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **getSegments** > GetSegmentsSuccessResponse getSegments(appId, offset, limit) @@ -2485,6 +2566,103 @@ public class Example { | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **listAuditLogs** +> ListAuditLogsSuccessResponse listAuditLogs(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses) + +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 +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: organization_api_key + HttpBearerAuth organization_api_key = (HttpBearerAuth) defaultClient.getAuthentication("organization_api_key"); + organization_api_key.setBearerToken("YOUR_ORGANIZATION_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String organizationId = "YOUR_ORG_ID"; // String | The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. + String startTime = "startTime_example"; // 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. + String endTime = "endTime_example"; // String | End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. + String cursor = "cursor_example"; // String | Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. + Integer limit = 56; // Integer | Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. + List appIds = Arrays.asList(); // List | Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. + List actions = Arrays.asList(); // List | Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. + List actorIds = Arrays.asList(); // List | Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. + List actorEmails = Arrays.asList(); // List | Filter by actor email address. Accepts up to 10 values. + List targetTypes = Arrays.asList(); // List | Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. + List targetIds = Arrays.asList(); // List | Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. + List ipAddresses = Arrays.asList(); // List | Filter by the IP address the action originated from. Accepts up to 10 values. + try { + ListAuditLogsSuccessResponse result = apiInstance.listAuditLogs(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#listAuditLogs"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **organizationId** | **String**| The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. | | +| **startTime** | **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. | [optional] | +| **endTime** | **String**| End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. | [optional] | +| **cursor** | **String**| Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. | [optional] | +| **limit** | **Integer**| Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. | [optional] | +| **appIds** | [**List<String>**](String.md)| Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. | [optional] | +| **actions** | [**List<String>**](String.md)| Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. | [optional] | +| **actorIds** | [**List<String>**](String.md)| Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. | [optional] | +| **actorEmails** | [**List<String>**](String.md)| Filter by actor email address. Accepts up to 10 values. | [optional] | +| **targetTypes** | [**List<String>**](String.md)| Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. | [optional] | +| **targetIds** | [**List<String>**](String.md)| Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. | [optional] | +| **ipAddresses** | [**List<String>**](String.md)| Filter by the IP address the action originated from. Accepts up to 10 values. | [optional] | + +### Return type + +[**ListAuditLogsSuccessResponse**](ListAuditLogsSuccessResponse.md) + +### Authorization + +[organization_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **rotateApiKey** > CreateApiKeyResponse rotateApiKey(appId, tokenId) @@ -3020,6 +3198,85 @@ public class Example { | **429** | Rate Limit Exceeded | - | | **0** | Unexpected error | - | + +# **updateSegment** +> UpdateSegmentSuccessResponse updateSegment(appId, segmentId, updateSegmentRequest) + +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 +```java +// Import classes: +import com.onesignal.client.ApiClient; +import com.onesignal.client.ApiException; +import com.onesignal.client.Configuration; +import com.onesignal.client.auth.*; +import com.onesignal.client.model.*; +import com.onesignal.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.onesignal.com"); + + // Configure HTTP bearer authorization: rest_api_key + HttpBearerAuth rest_api_key = (HttpBearerAuth) defaultClient.getAuthentication("rest_api_key"); + rest_api_key.setBearerToken("YOUR_REST_API_KEY"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + String appId = "YOUR_APP_ID"; // String | The OneSignal App ID for your app. Available in Keys & IDs. + String segmentId = "d6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e"; // 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. + UpdateSegmentRequest updateSegmentRequest = new UpdateSegmentRequest(); // UpdateSegmentRequest | + try { + UpdateSegmentSuccessResponse result = apiInstance.updateSegment(appId, segmentId, updateSegmentRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#updateSegment"); + System.err.println("Status code: " + e.getCode()); + // getErrorMessages() flattens any error-envelope shape to a List; + // the raw body remains on getResponseBody(). + System.err.println("Error messages: " + e.getErrorMessages()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segmentId** | **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. | | +| **updateSegmentRequest** | [**UpdateSegmentRequest**](UpdateSegmentRequest.md)| | [optional] | + +### Return type + +[**UpdateSegmentSuccessResponse**](UpdateSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-java-api#configuration) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **429** | Rate Limit Exceeded | - | +| **0** | Unexpected error | - | + # **updateSubscription** > updateSubscription(appId, subscriptionId, subscriptionBody) diff --git a/docs/GetSegmentSuccessResponse.md b/docs/GetSegmentSuccessResponse.md new file mode 100644 index 0000000..357b214 --- /dev/null +++ b/docs/GetSegmentSuccessResponse.md @@ -0,0 +1,14 @@ + + +# GetSegmentSuccessResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriberCount** | **Integer** | The number of subscribers matching this segment. | [optional] | +|**payload** | [**SegmentDetails**](SegmentDetails.md) | | [optional] | + + + diff --git a/docs/ListAuditLogsSuccessResponse.md b/docs/ListAuditLogsSuccessResponse.md new file mode 100644 index 0000000..226856a --- /dev/null +++ b/docs/ListAuditLogsSuccessResponse.md @@ -0,0 +1,15 @@ + + +# ListAuditLogsSuccessResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**auditLogs** | [**List<AuditLogEvent>**](AuditLogEvent.md) | Array of audit log events, ordered by occurred_at ascending. | [optional] | +|**hasMore** | **Boolean** | True if additional events exist beyond this page. Use next_cursor to fetch the next page. | [optional] | +|**nextCursor** | **String** | Opaque cursor to pass as cursor in the next request. Only present when has_more is true. | [optional] | + + + diff --git a/docs/SegmentDetails.md b/docs/SegmentDetails.md new file mode 100644 index 0000000..d2ed261 --- /dev/null +++ b/docs/SegmentDetails.md @@ -0,0 +1,29 @@ + + +# SegmentDetails + +Segment details. Only included when the include-segment-detail query parameter is set to true. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The unique identifier for the segment (UUID v4). | [optional] | +|**name** | **String** | The segment name. | [optional] | +|**description** | **String** | Human-readable description for the segment. `null` when unset. Maximum 255 characters. | [optional] | +|**createdAt** | **Integer** | Unix timestamp when the segment was created. | [optional] | +|**source** | [**SourceEnum**](#SourceEnum) | The source of the segment. | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment. | [optional] | + + + +## Enum: SourceEnum + +| Name | Value | +|---- | -----| +| DEFAULT | "default" | +| CUSTOM | "custom" | +| QUICKSTART | "quickstart" | + + + diff --git a/docs/UpdateSegmentRequest.md b/docs/UpdateSegmentRequest.md new file mode 100644 index 0000000..e94863e --- /dev/null +++ b/docs/UpdateSegmentRequest.md @@ -0,0 +1,15 @@ + + +# UpdateSegmentRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Required. The segment name. Maximum 128 characters. | | +|**description** | **String** | Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. | [optional] | +|**filters** | [**List<FilterExpression>**](FilterExpression.md) | Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. | [optional] | + + + diff --git a/docs/UpdateSegmentSuccessResponse.md b/docs/UpdateSegmentSuccessResponse.md new file mode 100644 index 0000000..28a7619 --- /dev/null +++ b/docs/UpdateSegmentSuccessResponse.md @@ -0,0 +1,14 @@ + + +# UpdateSegmentSuccessResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | true if the segment was updated successfully, false otherwise. | [optional] | +|**id** | **String** | UUID of the updated segment. | [optional] | + + + diff --git a/pom.xml b/pom.xml index 1344396..a1444e8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ onesignal-java-client jar onesignal-java-client - 5.10.0 + 5.11.0 https://github.com/OneSignal/onesignal-java-api OneSignal Java API Client diff --git a/src/main/java/com/onesignal/client/ApiCallback.java b/src/main/java/com/onesignal/client/ApiCallback.java index f9742be..abdf454 100644 --- a/src/main/java/com/onesignal/client/ApiCallback.java +++ b/src/main/java/com/onesignal/client/ApiCallback.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ApiClient.java b/src/main/java/com/onesignal/client/ApiClient.java index a359dc8..ee5eb79 100644 --- a/src/main/java/com/onesignal/client/ApiClient.java +++ b/src/main/java/com/onesignal/client/ApiClient.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -133,7 +133,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/5.10.0/java"); + setUserAgent("OpenAPI-Generator/5.11.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/onesignal/client/ApiException.java b/src/main/java/com/onesignal/client/ApiException.java index 821a932..236cbf8 100644 --- a/src/main/java/com/onesignal/client/ApiException.java +++ b/src/main/java/com/onesignal/client/ApiException.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ApiResponse.java b/src/main/java/com/onesignal/client/ApiResponse.java index ff9991a..fff0a7a 100644 --- a/src/main/java/com/onesignal/client/ApiResponse.java +++ b/src/main/java/com/onesignal/client/ApiResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/Configuration.java b/src/main/java/com/onesignal/client/Configuration.java index 0165cee..4ef221e 100644 --- a/src/main/java/com/onesignal/client/Configuration.java +++ b/src/main/java/com/onesignal/client/Configuration.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java index c081375..5d7c31c 100644 --- a/src/main/java/com/onesignal/client/GzipRequestInterceptor.java +++ b/src/main/java/com/onesignal/client/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java index de56d9d..42b4b83 100644 --- a/src/main/java/com/onesignal/client/JSON.java +++ b/src/main/java/com/onesignal/client/JSON.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -96,6 +96,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.ApiKeyToken.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.ApiKeyTokensListResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.App.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.AuditLogActor.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.AuditLogContext.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.AuditLogEvent.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.AuditLogTarget.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotification.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.BasicNotificationAllOfAndroidBackgroundLayout.CustomTypeAdapterFactory()) @@ -121,8 +125,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.GenericError.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GenericSuccessBoolResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GetNotificationHistoryRequestBody.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.GetSegmentSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.GetSegmentsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.LanguageStringMap.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.ListAuditLogsSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Notification.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.NotificationHistorySuccessResponse.CustomTypeAdapterFactory()) @@ -143,6 +149,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.RateLimitError.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.Segment.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentData.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentDetails.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.SegmentNotificationTarget.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.StartLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.StartLiveActivitySuccessResponse.CustomTypeAdapterFactory()) @@ -155,6 +162,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateApiKeyRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivityRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateLiveActivitySuccessResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateSegmentRequest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateSegmentSuccessResponse.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateTemplateRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.UpdateUserRequest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new com.onesignal.client.model.User.CustomTypeAdapterFactory()) diff --git a/src/main/java/com/onesignal/client/Pair.java b/src/main/java/com/onesignal/client/Pair.java index 97a8705..623e764 100644 --- a/src/main/java/com/onesignal/client/Pair.java +++ b/src/main/java/com/onesignal/client/Pair.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ProgressRequestBody.java b/src/main/java/com/onesignal/client/ProgressRequestBody.java index 6d01bd3..7d19b9d 100644 --- a/src/main/java/com/onesignal/client/ProgressRequestBody.java +++ b/src/main/java/com/onesignal/client/ProgressRequestBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/ProgressResponseBody.java b/src/main/java/com/onesignal/client/ProgressResponseBody.java index bab0b3a..b644073 100644 --- a/src/main/java/com/onesignal/client/ProgressResponseBody.java +++ b/src/main/java/com/onesignal/client/ProgressResponseBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/StringUtil.java b/src/main/java/com/onesignal/client/StringUtil.java index 7c69113..0a01a7f 100644 --- a/src/main/java/com/onesignal/client/StringUtil.java +++ b/src/main/java/com/onesignal/client/StringUtil.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java index 338f401..40a11df 100644 --- a/src/main/java/com/onesignal/client/api/DefaultApi.java +++ b/src/main/java/com/onesignal/client/api/DefaultApi.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -44,7 +44,9 @@ import com.onesignal.client.model.GenericError; import com.onesignal.client.model.GenericSuccessBoolResponse; import com.onesignal.client.model.GetNotificationHistoryRequestBody; +import com.onesignal.client.model.GetSegmentSuccessResponse; import com.onesignal.client.model.GetSegmentsSuccessResponse; +import com.onesignal.client.model.ListAuditLogsSuccessResponse; import com.onesignal.client.model.Notification; import com.onesignal.client.model.NotificationHistorySuccessResponse; import com.onesignal.client.model.NotificationSlice; @@ -62,6 +64,8 @@ import com.onesignal.client.model.UpdateApiKeyRequest; import com.onesignal.client.model.UpdateLiveActivityRequest; import com.onesignal.client.model.UpdateLiveActivitySuccessResponse; +import com.onesignal.client.model.UpdateSegmentRequest; +import com.onesignal.client.model.UpdateSegmentSuccessResponse; import com.onesignal.client.model.UpdateTemplateRequest; import com.onesignal.client.model.UpdateUserRequest; import com.onesignal.client.model.User; @@ -155,7 +159,7 @@ public okhttp3.Call cancelNotificationCall(String appId, String notificationId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -313,7 +317,7 @@ public okhttp3.Call copyTemplateToAppCall(String templateId, String appId, CopyT Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -479,7 +483,7 @@ public okhttp3.Call createAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -656,7 +660,7 @@ public okhttp3.Call createAliasBySubscriptionCall(String appId, String subscript Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -820,7 +824,7 @@ public okhttp3.Call createApiKeyCall(String appId, CreateApiKeyRequest createApi Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -966,7 +970,7 @@ public okhttp3.Call createAppCall(App app, final ApiCallback _callback) throws A Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1110,7 +1114,7 @@ public okhttp3.Call createCustomEventsCall(String appId, CustomEventsRequest cus Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1262,7 +1266,7 @@ public okhttp3.Call createNotificationCall(Notification notification, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1406,7 +1410,7 @@ public okhttp3.Call createSegmentCall(String appId, Segment segment, final ApiCa Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1562,7 +1566,7 @@ public okhttp3.Call createSubscriptionCall(String appId, String aliasLabel, Stri Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1736,7 +1740,7 @@ public okhttp3.Call createTemplateCall(CreateTemplateRequest createTemplateReque Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -1882,7 +1886,7 @@ public okhttp3.Call createUserCall(String appId, User user, final ApiCallback _c Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -2049,7 +2053,7 @@ public okhttp3.Call deleteAliasCall(String appId, String aliasLabel, String alia Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -2222,7 +2226,7 @@ public okhttp3.Call deleteApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -2372,7 +2376,7 @@ public okhttp3.Call deleteSegmentCall(String appId, String segmentId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -2529,7 +2533,7 @@ public okhttp3.Call deleteSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -2682,7 +2686,7 @@ public okhttp3.Call deleteTemplateCall(String templateId, String appId, final Ap Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -2841,7 +2845,7 @@ public okhttp3.Call deleteUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3000,7 +3004,7 @@ public okhttp3.Call exportEventsCall(String notificationId, String appId, final Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -3158,7 +3162,7 @@ public okhttp3.Call exportSubscriptionsCall(String appId, ExportSubscriptionsReq Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3308,7 +3312,7 @@ public okhttp3.Call getAliasesCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3471,7 +3475,7 @@ public okhttp3.Call getAliasesBySubscriptionCall(String appId, String subscripti Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3621,7 +3625,7 @@ public okhttp3.Call getAppCall(String appId, final ApiCallback _callback) throws Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3761,7 +3765,7 @@ public okhttp3.Call getAppsCall(final ApiCallback _callback) throws ApiException Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -3897,7 +3901,7 @@ public okhttp3.Call getNotificationCall(String appId, String notificationId, fin Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4056,7 +4060,7 @@ public okhttp3.Call getNotificationHistoryCall(String notificationId, GetNotific Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -4212,7 +4216,7 @@ public okhttp3.Call getNotificationsCall(String appId, Integer limit, Integer of Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -4391,7 +4395,7 @@ public okhttp3.Call getOutcomesCall(String appId, String outcomeNames, String ou Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (outcomeNames != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("outcome_names", outcomeNames)); @@ -4531,6 +4535,170 @@ public okhttp3.Call getOutcomesAsync(String appId, String outcomeNames, String o localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getSegment + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param includeSegmentDetail Set to true to include segment metadata and filters in the response. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getSegmentCall(String appId, String segmentId, Boolean includeSegmentDetail, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apps/{app_id}/segments/{segment_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); + + if (includeSegmentDetail != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include-segment-detail", includeSegmentDetail)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSegmentValidateBeforeCall(String appId, String segmentId, Boolean includeSegmentDetail, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getSegment(Async)"); + } + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling getSegment(Async)"); + } + + + okhttp3.Call localVarCall = getSegmentCall(appId, segmentId, includeSegmentDetail, _callback); + return localVarCall; + + } + + /** + * View Segment + * Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param includeSegmentDetail Set to true to include segment metadata and filters in the response. (optional) + * @return GetSegmentSuccessResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public GetSegmentSuccessResponse getSegment(String appId, String segmentId, Boolean includeSegmentDetail) throws ApiException { + ApiResponse localVarResp = getSegmentWithHttpInfo(appId, segmentId, includeSegmentDetail); + return localVarResp.getData(); + } + + /** + * View Segment + * Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param includeSegmentDetail Set to true to include segment metadata and filters in the response. (optional) + * @return ApiResponse<GetSegmentSuccessResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse getSegmentWithHttpInfo(String appId, String segmentId, Boolean includeSegmentDetail) throws ApiException { + okhttp3.Call localVarCall = getSegmentValidateBeforeCall(appId, segmentId, includeSegmentDetail, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * View Segment (asynchronously) + * Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param includeSegmentDetail Set to true to include segment metadata and filters in the response. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call getSegmentAsync(String appId, String segmentId, Boolean includeSegmentDetail, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSegmentValidateBeforeCall(appId, segmentId, includeSegmentDetail, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getSegments * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) @@ -4575,7 +4743,7 @@ public okhttp3.Call getSegmentsCall(String appId, Integer offset, Integer limit, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (offset != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); @@ -4736,7 +4904,7 @@ public okhttp3.Call getUserCall(String appId, String aliasLabel, String aliasId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -4855,6 +5023,244 @@ public okhttp3.Call getUserAsync(String appId, String aliasLabel, String aliasId localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listAuditLogs + * @param organizationId The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param startTime Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param endTime End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param appIds Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param actorIds Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param actorEmails Filter by actor email address. Accepts up to 10 values. (optional) + * @param targetTypes Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param targetIds Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param ipAddresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call listAuditLogsCall(String organizationId, String startTime, String endTime, String cursor, Integer limit, List appIds, List actions, List actorIds, List actorEmails, List targetTypes, List targetIds, List ipAddresses, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/organizations/{organization_id}/audit_logs" + .replaceAll("\\{" + "organization_id" + "\\}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (appIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "app_ids", appIds)); + } + + if (actions != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "actions", actions)); + } + + if (actorIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "actor_ids", actorIds)); + } + + if (actorEmails != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "actor_emails", actorEmails)); + } + + if (targetTypes != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "target_types", targetTypes)); + } + + if (targetIds != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "target_ids", targetIds)); + } + + if (ipAddresses != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ip_addresses", ipAddresses)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "organization_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAuditLogsValidateBeforeCall(String organizationId, String startTime, String endTime, String cursor, Integer limit, List appIds, List actions, List actorIds, List actorEmails, List targetTypes, List targetIds, List ipAddresses, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling listAuditLogs(Async)"); + } + + + okhttp3.Call localVarCall = listAuditLogsCall(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses, _callback); + return localVarCall; + + } + + /** + * 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. + * @param organizationId The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param startTime Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param endTime End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param appIds Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param actorIds Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param actorEmails Filter by actor email address. Accepts up to 10 values. (optional) + * @param targetTypes Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param targetIds Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param ipAddresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) + * @return ListAuditLogsSuccessResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ListAuditLogsSuccessResponse listAuditLogs(String organizationId, String startTime, String endTime, String cursor, Integer limit, List appIds, List actions, List actorIds, List actorEmails, List targetTypes, List targetIds, List ipAddresses) throws ApiException { + ApiResponse localVarResp = listAuditLogsWithHttpInfo(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses); + return localVarResp.getData(); + } + + /** + * 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. + * @param organizationId The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param startTime Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param endTime End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param appIds Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param actorIds Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param actorEmails Filter by actor email address. Accepts up to 10 values. (optional) + * @param targetTypes Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param targetIds Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param ipAddresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) + * @return ApiResponse<ListAuditLogsSuccessResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse listAuditLogsWithHttpInfo(String organizationId, String startTime, String endTime, String cursor, Integer limit, List appIds, List actions, List actorIds, List actorEmails, List targetTypes, List targetIds, List ipAddresses) throws ApiException { + okhttp3.Call localVarCall = listAuditLogsValidateBeforeCall(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List audit logs (asynchronously) + * Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled. + * @param organizationId The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param startTime Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param endTime End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param appIds Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param actorIds Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param actorEmails Filter by actor email address. Accepts up to 10 values. (optional) + * @param targetTypes Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param targetIds Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param ipAddresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call listAuditLogsAsync(String organizationId, String startTime, String endTime, String cursor, Integer limit, List appIds, List actions, List actorIds, List actorEmails, List targetTypes, List targetIds, List ipAddresses, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listAuditLogsValidateBeforeCall(organizationId, startTime, endTime, cursor, limit, appIds, actions, actorIds, actorEmails, targetTypes, targetIds, ipAddresses, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for rotateApiKey * @param appId (required) @@ -4898,7 +5304,7 @@ public okhttp3.Call rotateApiKeyCall(String appId, String tokenId, final ApiCall Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5048,7 +5454,7 @@ public okhttp3.Call startLiveActivityCall(String appId, String activityType, Sta Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5211,7 +5617,7 @@ public okhttp3.Call transferSubscriptionCall(String appId, String subscriptionId Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5378,7 +5784,7 @@ public okhttp3.Call unsubscribeEmailWithTokenCall(String appId, String notificat Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (token != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); @@ -5542,7 +5948,7 @@ public okhttp3.Call updateApiKeyCall(String appId, String tokenId, UpdateApiKeyR Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5698,7 +6104,7 @@ public okhttp3.Call updateAppCall(String appId, App app, final ApiCallback _call Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5851,7 +6257,7 @@ public okhttp3.Call updateLiveActivityCall(String appId, String activityId, Upda Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -5967,6 +6373,170 @@ public okhttp3.Call updateLiveActivityAsync(String appId, String activityId, Upd localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateSegment + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param updateSegmentRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateSegmentCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSegmentRequest; + + // create path and map variables + String localVarPath = "/apps/{app_id}/segments/{segment_id}" + .replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "segment_id" + "\\}", localVarApiClient.escapeString(segmentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Adds client sdk version header + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "rest_api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSegmentValidateBeforeCall(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling updateSegment(Async)"); + } + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException("Missing the required parameter 'segmentId' when calling updateSegment(Async)"); + } + + + okhttp3.Call localVarCall = updateSegmentCall(appId, segmentId, updateSegmentRequest, _callback); + return localVarCall; + + } + + /** + * 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. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param updateSegmentRequest (optional) + * @return UpdateSegmentSuccessResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public UpdateSegmentSuccessResponse updateSegment(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { + ApiResponse localVarResp = updateSegmentWithHttpInfo(appId, segmentId, updateSegmentRequest); + return localVarResp.getData(); + } + + /** + * 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. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param updateSegmentRequest (optional) + * @return ApiResponse<UpdateSegmentSuccessResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public ApiResponse updateSegmentWithHttpInfo(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest) throws ApiException { + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Segment (asynchronously) + * 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. + * @param appId The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param segmentId 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) + * @param updateSegmentRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Rate Limit Exceeded -
0 Unexpected error -
+ */ + public okhttp3.Call updateSegmentAsync(String appId, String segmentId, UpdateSegmentRequest updateSegmentRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSegmentValidateBeforeCall(appId, segmentId, updateSegmentRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for updateSubscription * @param appId (required) @@ -6014,7 +6584,7 @@ public okhttp3.Call updateSubscriptionCall(String appId, String subscriptionId, Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -6179,7 +6749,7 @@ public okhttp3.Call updateSubscriptionByTokenCall(String appId, String tokenType Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -6346,7 +6916,7 @@ public okhttp3.Call updateTemplateCall(String templateId, String appId, UpdateTe Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -6511,7 +7081,7 @@ public okhttp3.Call updateUserCall(String appId, String aliasLabel, String alias Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -6679,7 +7249,7 @@ public okhttp3.Call viewApiKeysCall(String appId, final ApiCallback _callback) t Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); final String[] localVarAccepts = { "application/json" @@ -6819,7 +7389,7 @@ public okhttp3.Call viewTemplateCall(String templateId, String appId, final ApiC Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); @@ -6975,7 +7545,7 @@ public okhttp3.Call viewTemplatesCall(String appId, Integer limit, Integer offse Map localVarFormParams = new HashMap(); // Adds client sdk version header - localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.10.0"); + localVarHeaderParams.put("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-java, version=5.11.0"); if (appId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("app_id", appId)); diff --git a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java index fa20dd0..73fa04d 100644 --- a/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java +++ b/src/main/java/com/onesignal/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/Authentication.java b/src/main/java/com/onesignal/client/auth/Authentication.java index f2d6349..12ab606 100644 --- a/src/main/java/com/onesignal/client/auth/Authentication.java +++ b/src/main/java/com/onesignal/client/auth/Authentication.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java index e460c6e..dd032d7 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java index 4072abf..6e7b964 100644 --- a/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java +++ b/src/main/java/com/onesignal/client/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java index bcc8de9..ec9c85a 100644 --- a/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/onesignal/client/model/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ApiKeyToken.java b/src/main/java/com/onesignal/client/model/ApiKeyToken.java index b612696..8ac0e96 100644 --- a/src/main/java/com/onesignal/client/model/ApiKeyToken.java +++ b/src/main/java/com/onesignal/client/model/ApiKeyToken.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java b/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java index ba7a796..7a711ba 100644 --- a/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java +++ b/src/main/java/com/onesignal/client/model/ApiKeyTokensListResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/App.java b/src/main/java/com/onesignal/client/model/App.java index 37a78af..82e4ae1 100644 --- a/src/main/java/com/onesignal/client/model/App.java +++ b/src/main/java/com/onesignal/client/model/App.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/AuditLogActor.java b/src/main/java/com/onesignal/client/model/AuditLogActor.java new file mode 100644 index 0000000..39e66fb --- /dev/null +++ b/src/main/java/com/onesignal/client/model/AuditLogActor.java @@ -0,0 +1,306 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * The user or service that performed the action. Absent if the actor is unknown. + */ +@ApiModel(description = "The user or service that performed the action. Absent if the actor is unknown.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuditLogActor { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Object metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public AuditLogActor() { + } + + public AuditLogActor email(String email) { + + this.email = email; + return this; + } + + /** + * Email address of the actor. Absent if unavailable. + * @return email + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Email address of the actor. Absent if unavailable.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public AuditLogActor id(String id) { + + this.id = id; + return this; + } + + /** + * UUID of the actor. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the actor.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public AuditLogActor metadata(Object metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Additional actor-specific data. + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional actor-specific data.") + + public Object getMetadata() { + return metadata; + } + + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + + public AuditLogActor name(String name) { + + this.name = name; + return this; + } + + /** + * Display name of the actor. Absent if unavailable. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Display name of the actor. Absent if unavailable.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public AuditLogActor type(String type) { + + this.type = type; + return this; + } + + /** + * Actor type (e.g. member, api_key, system). + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Actor type (e.g. member, api_key, system).") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditLogActor auditLogActor = (AuditLogActor) o; + return Objects.equals(this.email, auditLogActor.email) && + Objects.equals(this.id, auditLogActor.id) && + Objects.equals(this.metadata, auditLogActor.metadata) && + Objects.equals(this.name, auditLogActor.name) && + Objects.equals(this.type, auditLogActor.type); + } + + @Override + public int hashCode() { + return Objects.hash(email, id, metadata, name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditLogActor {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("id"); + openapiFields.add("metadata"); + openapiFields.add("name"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditLogActor.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditLogActor' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuditLogActor.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditLogActor value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuditLogActor read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuditLogActor given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditLogActor + * @throws IOException if the JSON string is invalid with respect to AuditLogActor + */ + public static AuditLogActor fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditLogActor.class); + } + + /** + * Convert an instance of AuditLogActor to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/AuditLogContext.java b/src/main/java/com/onesignal/client/model/AuditLogContext.java new file mode 100644 index 0000000..65bade8 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/AuditLogContext.java @@ -0,0 +1,276 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Request context at the time of the event. Absent if context was not captured. + */ +@ApiModel(description = "Request context at the time of the event. Absent if context was not captured.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuditLogContext { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_IP = "ip"; + @SerializedName(SERIALIZED_NAME_IP) + private String ip; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Object metadata; + + public static final String SERIALIZED_NAME_USER_AGENT = "user_agent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + private String userAgent; + + public AuditLogContext() { + } + + public AuditLogContext country(String country) { + + this.country = country; + return this; + } + + /** + * Country code derived from the request IP. + * @return country + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Country code derived from the request IP.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public AuditLogContext ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * IP address the request originated from. + * @return ip + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "IP address the request originated from.") + + public String getIp() { + return ip; + } + + + public void setIp(String ip) { + this.ip = ip; + } + + + public AuditLogContext metadata(Object metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Additional context-specific data. + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional context-specific data.") + + public Object getMetadata() { + return metadata; + } + + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + + public AuditLogContext userAgent(String userAgent) { + + this.userAgent = userAgent; + return this; + } + + /** + * User agent of the client that made the request. + * @return userAgent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "User agent of the client that made the request.") + + public String getUserAgent() { + return userAgent; + } + + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditLogContext auditLogContext = (AuditLogContext) o; + return Objects.equals(this.country, auditLogContext.country) && + Objects.equals(this.ip, auditLogContext.ip) && + Objects.equals(this.metadata, auditLogContext.metadata) && + Objects.equals(this.userAgent, auditLogContext.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(country, ip, metadata, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditLogContext {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("country"); + openapiFields.add("ip"); + openapiFields.add("metadata"); + openapiFields.add("user_agent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditLogContext.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditLogContext' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuditLogContext.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditLogContext value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuditLogContext read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuditLogContext given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditLogContext + * @throws IOException if the JSON string is invalid with respect to AuditLogContext + */ + public static AuditLogContext fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditLogContext.class); + } + + /** + * Convert an instance of AuditLogContext to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/AuditLogEvent.java b/src/main/java/com/onesignal/client/model/AuditLogEvent.java new file mode 100644 index 0000000..37a938d --- /dev/null +++ b/src/main/java/com/onesignal/client/model/AuditLogEvent.java @@ -0,0 +1,468 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.AuditLogActor; +import com.onesignal.client.model.AuditLogContext; +import com.onesignal.client.model.AuditLogTarget; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * AuditLogEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuditLogEvent { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_ACTOR = "actor"; + @SerializedName(SERIALIZED_NAME_ACTOR) + private AuditLogActor actor; + + public static final String SERIALIZED_NAME_APP_ID = "app_id"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + private AuditLogContext context; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Object metadata; + + public static final String SERIALIZED_NAME_OCCURRED_AT = "occurred_at"; + @SerializedName(SERIALIZED_NAME_OCCURRED_AT) + private String occurredAt; + + public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organization_id"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) + private String organizationId; + + public static final String SERIALIZED_NAME_TARGETS = "targets"; + @SerializedName(SERIALIZED_NAME_TARGETS) + private List targets = null; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private Integer version; + + public AuditLogEvent() { + } + + public AuditLogEvent action(String action) { + + this.action = action; + return this; + } + + /** + * The action that was performed (e.g. notification.sent, segment.created, member.invited). + * @return action + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The action that was performed (e.g. notification.sent, segment.created, member.invited).") + + public String getAction() { + return action; + } + + + public void setAction(String action) { + this.action = action; + } + + + public AuditLogEvent actor(AuditLogActor actor) { + + this.actor = actor; + return this; + } + + /** + * Get actor + * @return actor + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AuditLogActor getActor() { + return actor; + } + + + public void setActor(AuditLogActor actor) { + this.actor = actor; + } + + + public AuditLogEvent appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * UUID of the app the event is associated with. Absent for org-level events. + * @return appId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the app the event is associated with. Absent for org-level events.") + + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public AuditLogEvent context(AuditLogContext context) { + + this.context = context; + return this; + } + + /** + * Get context + * @return context + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AuditLogContext getContext() { + return context; + } + + + public void setContext(AuditLogContext context) { + this.context = context; + } + + + public AuditLogEvent id(String id) { + + this.id = id; + return this; + } + + /** + * UUID of the audit log event. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the audit log event.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public AuditLogEvent metadata(Object metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Additional event-specific data that does not fit into the standard fields. + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional event-specific data that does not fit into the standard fields.") + + public Object getMetadata() { + return metadata; + } + + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + + public AuditLogEvent occurredAt(String occurredAt) { + + this.occurredAt = occurredAt; + return this; + } + + /** + * RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). + * @return occurredAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z).") + + public String getOccurredAt() { + return occurredAt; + } + + + public void setOccurredAt(String occurredAt) { + this.occurredAt = occurredAt; + } + + + public AuditLogEvent organizationId(String organizationId) { + + this.organizationId = organizationId; + return this; + } + + /** + * UUID of the organization the event belongs to. + * @return organizationId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the organization the event belongs to.") + + public String getOrganizationId() { + return organizationId; + } + + + public void setOrganizationId(String organizationId) { + this.organizationId = organizationId; + } + + + public AuditLogEvent targets(List targets) { + + this.targets = targets; + return this; + } + + public AuditLogEvent addTargetsItem(AuditLogTarget targetsItem) { + if (this.targets == null) { + this.targets = new ArrayList<>(); + } + this.targets.add(targetsItem); + return this; + } + + /** + * The resources the action was performed on. May be empty for org-level events. + * @return targets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The resources the action was performed on. May be empty for org-level events.") + + public List getTargets() { + return targets; + } + + + public void setTargets(List targets) { + this.targets = targets; + } + + + public AuditLogEvent version(Integer version) { + + this.version = version; + return this; + } + + /** + * Schema version of the event payload. + * @return version + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Schema version of the event payload.") + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditLogEvent auditLogEvent = (AuditLogEvent) o; + return Objects.equals(this.action, auditLogEvent.action) && + Objects.equals(this.actor, auditLogEvent.actor) && + Objects.equals(this.appId, auditLogEvent.appId) && + Objects.equals(this.context, auditLogEvent.context) && + Objects.equals(this.id, auditLogEvent.id) && + Objects.equals(this.metadata, auditLogEvent.metadata) && + Objects.equals(this.occurredAt, auditLogEvent.occurredAt) && + Objects.equals(this.organizationId, auditLogEvent.organizationId) && + Objects.equals(this.targets, auditLogEvent.targets) && + Objects.equals(this.version, auditLogEvent.version); + } + + @Override + public int hashCode() { + return Objects.hash(action, actor, appId, context, id, metadata, occurredAt, organizationId, targets, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditLogEvent {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" actor: ").append(toIndentedString(actor)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" occurredAt: ").append(toIndentedString(occurredAt)).append("\n"); + sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); + sb.append(" targets: ").append(toIndentedString(targets)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("action"); + openapiFields.add("actor"); + openapiFields.add("app_id"); + openapiFields.add("context"); + openapiFields.add("id"); + openapiFields.add("metadata"); + openapiFields.add("occurred_at"); + openapiFields.add("organization_id"); + openapiFields.add("targets"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditLogEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditLogEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuditLogEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditLogEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuditLogEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuditLogEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditLogEvent + * @throws IOException if the JSON string is invalid with respect to AuditLogEvent + */ + public static AuditLogEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditLogEvent.class); + } + + /** + * Convert an instance of AuditLogEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/AuditLogTarget.java b/src/main/java/com/onesignal/client/model/AuditLogTarget.java new file mode 100644 index 0000000..1858718 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/AuditLogTarget.java @@ -0,0 +1,276 @@ +/* + * OneSignal + * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com + * + * The version of the OpenAPI document: 5.11.0 + * Contact: devrel@onesignal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * A resource the action was performed on. + */ +@ApiModel(description = "A resource the action was performed on.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AuditLogTarget { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Object metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public AuditLogTarget() { + } + + public AuditLogTarget id(String id) { + + this.id = id; + return this; + } + + /** + * UUID of the resource. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public AuditLogTarget metadata(Object metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Additional resource-specific data. + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional resource-specific data.") + + public Object getMetadata() { + return metadata; + } + + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + + public AuditLogTarget name(String name) { + + this.name = name; + return this; + } + + /** + * Display name of the resource. Absent if unavailable. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Display name of the resource. Absent if unavailable.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public AuditLogTarget type(String type) { + + this.type = type; + return this; + } + + /** + * Resource type (e.g. notification, segment, journey, app). + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Resource type (e.g. notification, segment, journey, app).") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditLogTarget auditLogTarget = (AuditLogTarget) o; + return Objects.equals(this.id, auditLogTarget.id) && + Objects.equals(this.metadata, auditLogTarget.metadata) && + Objects.equals(this.name, auditLogTarget.name) && + Objects.equals(this.type, auditLogTarget.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, metadata, name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditLogTarget {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("metadata"); + openapiFields.add("name"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditLogTarget.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditLogTarget' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuditLogTarget.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditLogTarget value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuditLogTarget read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuditLogTarget given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditLogTarget + * @throws IOException if the JSON string is invalid with respect to AuditLogTarget + */ + public static AuditLogTarget fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditLogTarget.class); + } + + /** + * Convert an instance of AuditLogTarget to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/BasicNotification.java b/src/main/java/com/onesignal/client/model/BasicNotification.java index d7ca0e4..a2e2548 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotification.java +++ b/src/main/java/com/onesignal/client/model/BasicNotification.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java index 26c306e..95eb0dc 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java +++ b/src/main/java/com/onesignal/client/model/BasicNotificationAllOf.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java b/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java index 3167a45..5cd7eeb 100644 --- a/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java +++ b/src/main/java/com/onesignal/client/model/BasicNotificationAllOfAndroidBackgroundLayout.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Button.java b/src/main/java/com/onesignal/client/model/Button.java index b578528..2a5db72 100644 --- a/src/main/java/com/onesignal/client/model/Button.java +++ b/src/main/java/com/onesignal/client/model/Button.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java b/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java index 14b3015..1065fe1 100644 --- a/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java +++ b/src/main/java/com/onesignal/client/model/CopyTemplateRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java b/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java index 76862d1..0bea7e3 100644 --- a/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java +++ b/src/main/java/com/onesignal/client/model/CreateApiKeyRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java b/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java index 8be7ca5..ba68240 100644 --- a/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateApiKeyResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java b/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java index 2d8b252..786da16 100644 --- a/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateNotificationSuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java b/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java index c559d73..f52441f 100644 --- a/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateSegmentConflictResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java b/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java index b252068..97c4522 100644 --- a/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateSegmentSuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java b/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java index 190ef39..d8e69b3 100644 --- a/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java +++ b/src/main/java/com/onesignal/client/model/CreateTemplateRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java index d304b4f..bf1cce9 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java index 318acb7..a462997 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsInner.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java index c46cce6..47f8708 100644 --- a/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java +++ b/src/main/java/com/onesignal/client/model/CreateUserConflictResponseErrorsItemsMeta.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CustomEvent.java b/src/main/java/com/onesignal/client/model/CustomEvent.java index a8fe26b..3cbe22a 100644 --- a/src/main/java/com/onesignal/client/model/CustomEvent.java +++ b/src/main/java/com/onesignal/client/model/CustomEvent.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/CustomEventsRequest.java b/src/main/java/com/onesignal/client/model/CustomEventsRequest.java index 83383b2..5099508 100644 --- a/src/main/java/com/onesignal/client/model/CustomEventsRequest.java +++ b/src/main/java/com/onesignal/client/model/CustomEventsRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/DeliveryData.java b/src/main/java/com/onesignal/client/model/DeliveryData.java index e5acfcd..984c735 100644 --- a/src/main/java/com/onesignal/client/model/DeliveryData.java +++ b/src/main/java/com/onesignal/client/model/DeliveryData.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java b/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java index cc8f04d..e831ed9 100644 --- a/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/ExportEventsSuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java b/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java index 01f7792..886d782 100644 --- a/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java +++ b/src/main/java/com/onesignal/client/model/ExportSubscriptionsRequestBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java b/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java index 1f93eea..1bfec75 100644 --- a/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/ExportSubscriptionsSuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Filter.java b/src/main/java/com/onesignal/client/model/Filter.java index 7000698..4833fd3 100644 --- a/src/main/java/com/onesignal/client/model/Filter.java +++ b/src/main/java/com/onesignal/client/model/Filter.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/FilterExpression.java b/src/main/java/com/onesignal/client/model/FilterExpression.java index af5d4bb..8fa4521 100644 --- a/src/main/java/com/onesignal/client/model/FilterExpression.java +++ b/src/main/java/com/onesignal/client/model/FilterExpression.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GenericError.java b/src/main/java/com/onesignal/client/model/GenericError.java index 096e29f..7eecd6d 100644 --- a/src/main/java/com/onesignal/client/model/GenericError.java +++ b/src/main/java/com/onesignal/client/model/GenericError.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java b/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java index c827468..0ec29f8 100644 --- a/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java +++ b/src/main/java/com/onesignal/client/model/GenericSuccessBoolResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java b/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java index cb6faa1..e07026e 100644 --- a/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java +++ b/src/main/java/com/onesignal/client/model/GetNotificationHistoryRequestBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/GetSegmentSuccessResponse.java b/src/main/java/com/onesignal/client/model/GetSegmentSuccessResponse.java new file mode 100644 index 0000000..8384f6b --- /dev/null +++ b/src/main/java/com/onesignal/client/model/GetSegmentSuccessResponse.java @@ -0,0 +1,216 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.SegmentDetails; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * GetSegmentSuccessResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSegmentSuccessResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_SUBSCRIBER_COUNT = "subscriber_count"; + @SerializedName(SERIALIZED_NAME_SUBSCRIBER_COUNT) + private Integer subscriberCount; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private SegmentDetails payload; + + public GetSegmentSuccessResponse() { + } + + public GetSegmentSuccessResponse subscriberCount(Integer subscriberCount) { + + this.subscriberCount = subscriberCount; + return this; + } + + /** + * The number of subscribers matching this segment. + * @return subscriberCount + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The number of subscribers matching this segment.") + + public Integer getSubscriberCount() { + return subscriberCount; + } + + + public void setSubscriberCount(Integer subscriberCount) { + this.subscriberCount = subscriberCount; + } + + + public GetSegmentSuccessResponse payload(SegmentDetails payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public SegmentDetails getPayload() { + return payload; + } + + + public void setPayload(SegmentDetails payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSegmentSuccessResponse getSegmentSuccessResponse = (GetSegmentSuccessResponse) o; + return Objects.equals(this.subscriberCount, getSegmentSuccessResponse.subscriberCount) && + Objects.equals(this.payload, getSegmentSuccessResponse.payload); + } + + @Override + public int hashCode() { + return Objects.hash(subscriberCount, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSegmentSuccessResponse {\n"); + sb.append(" subscriberCount: ").append(toIndentedString(subscriberCount)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscriber_count"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSegmentSuccessResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSegmentSuccessResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSegmentSuccessResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSegmentSuccessResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSegmentSuccessResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSegmentSuccessResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSegmentSuccessResponse + * @throws IOException if the JSON string is invalid with respect to GetSegmentSuccessResponse + */ + public static GetSegmentSuccessResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSegmentSuccessResponse.class); + } + + /** + * Convert an instance of GetSegmentSuccessResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java b/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java index 5f8d9ed..8820e7c 100644 --- a/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/GetSegmentsSuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/LanguageStringMap.java b/src/main/java/com/onesignal/client/model/LanguageStringMap.java index f59216a..30e7cd2 100644 --- a/src/main/java/com/onesignal/client/model/LanguageStringMap.java +++ b/src/main/java/com/onesignal/client/model/LanguageStringMap.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/ListAuditLogsSuccessResponse.java b/src/main/java/com/onesignal/client/model/ListAuditLogsSuccessResponse.java new file mode 100644 index 0000000..d56206b --- /dev/null +++ b/src/main/java/com/onesignal/client/model/ListAuditLogsSuccessResponse.java @@ -0,0 +1,256 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.AuditLogEvent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * ListAuditLogsSuccessResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListAuditLogsSuccessResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_AUDIT_LOGS = "audit_logs"; + @SerializedName(SERIALIZED_NAME_AUDIT_LOGS) + private List auditLogs = null; + + public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; + @SerializedName(SERIALIZED_NAME_HAS_MORE) + private Boolean hasMore; + + public static final String SERIALIZED_NAME_NEXT_CURSOR = "next_cursor"; + @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) + private String nextCursor; + + public ListAuditLogsSuccessResponse() { + } + + public ListAuditLogsSuccessResponse auditLogs(List auditLogs) { + + this.auditLogs = auditLogs; + return this; + } + + public ListAuditLogsSuccessResponse addAuditLogsItem(AuditLogEvent auditLogsItem) { + if (this.auditLogs == null) { + this.auditLogs = new ArrayList<>(); + } + this.auditLogs.add(auditLogsItem); + return this; + } + + /** + * Array of audit log events, ordered by occurred_at ascending. + * @return auditLogs + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Array of audit log events, ordered by occurred_at ascending.") + + public List getAuditLogs() { + return auditLogs; + } + + + public void setAuditLogs(List auditLogs) { + this.auditLogs = auditLogs; + } + + + public ListAuditLogsSuccessResponse hasMore(Boolean hasMore) { + + this.hasMore = hasMore; + return this; + } + + /** + * True if additional events exist beyond this page. Use next_cursor to fetch the next page. + * @return hasMore + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if additional events exist beyond this page. Use next_cursor to fetch the next page.") + + public Boolean getHasMore() { + return hasMore; + } + + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + + public ListAuditLogsSuccessResponse nextCursor(String nextCursor) { + + this.nextCursor = nextCursor; + return this; + } + + /** + * Opaque cursor to pass as cursor in the next request. Only present when has_more is true. + * @return nextCursor + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Opaque cursor to pass as cursor in the next request. Only present when has_more is true.") + + public String getNextCursor() { + return nextCursor; + } + + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAuditLogsSuccessResponse listAuditLogsSuccessResponse = (ListAuditLogsSuccessResponse) o; + return Objects.equals(this.auditLogs, listAuditLogsSuccessResponse.auditLogs) && + Objects.equals(this.hasMore, listAuditLogsSuccessResponse.hasMore) && + Objects.equals(this.nextCursor, listAuditLogsSuccessResponse.nextCursor); + } + + @Override + public int hashCode() { + return Objects.hash(auditLogs, hasMore, nextCursor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAuditLogsSuccessResponse {\n"); + sb.append(" auditLogs: ").append(toIndentedString(auditLogs)).append("\n"); + sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audit_logs"); + openapiFields.add("has_more"); + openapiFields.add("next_cursor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAuditLogsSuccessResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAuditLogsSuccessResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListAuditLogsSuccessResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAuditLogsSuccessResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAuditLogsSuccessResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListAuditLogsSuccessResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAuditLogsSuccessResponse + * @throws IOException if the JSON string is invalid with respect to ListAuditLogsSuccessResponse + */ + public static ListAuditLogsSuccessResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAuditLogsSuccessResponse.class); + } + + /** + * Convert an instance of ListAuditLogsSuccessResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/Notification.java b/src/main/java/com/onesignal/client/model/Notification.java index 804ef13..7c587e2 100644 --- a/src/main/java/com/onesignal/client/model/Notification.java +++ b/src/main/java/com/onesignal/client/model/Notification.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationAllOf.java b/src/main/java/com/onesignal/client/model/NotificationAllOf.java index 743c8e9..7b26648 100644 --- a/src/main/java/com/onesignal/client/model/NotificationAllOf.java +++ b/src/main/java/com/onesignal/client/model/NotificationAllOf.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java b/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java index 4ab5035..dd300b5 100644 --- a/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/NotificationHistorySuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationSlice.java b/src/main/java/com/onesignal/client/model/NotificationSlice.java index 233372d..d03225b 100644 --- a/src/main/java/com/onesignal/client/model/NotificationSlice.java +++ b/src/main/java/com/onesignal/client/model/NotificationSlice.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationTarget.java b/src/main/java/com/onesignal/client/model/NotificationTarget.java index d70c691..43135cd 100644 --- a/src/main/java/com/onesignal/client/model/NotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/NotificationTarget.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java index 5384c10..2b1d3d3 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMeta.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMeta.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java index 4f94248..c3fbba6 100644 --- a/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java +++ b/src/main/java/com/onesignal/client/model/NotificationWithMetaAllOf.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Operator.java b/src/main/java/com/onesignal/client/model/Operator.java index 989a6ed..5d2e3c2 100644 --- a/src/main/java/com/onesignal/client/model/Operator.java +++ b/src/main/java/com/onesignal/client/model/Operator.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/OutcomeData.java b/src/main/java/com/onesignal/client/model/OutcomeData.java index 20fee7d..72121c6 100644 --- a/src/main/java/com/onesignal/client/model/OutcomeData.java +++ b/src/main/java/com/onesignal/client/model/OutcomeData.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/OutcomesData.java b/src/main/java/com/onesignal/client/model/OutcomesData.java index fc9d52d..b6727ad 100644 --- a/src/main/java/com/onesignal/client/model/OutcomesData.java +++ b/src/main/java/com/onesignal/client/model/OutcomesData.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java index 01f35be..ab9ba41 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryData.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java index da5519a..239939b 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataEmailAllOf.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java index 4139836..7be7a0f 100644 --- a/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java +++ b/src/main/java/com/onesignal/client/model/PlatformDeliveryDataSmsAllOf.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesBody.java b/src/main/java/com/onesignal/client/model/PropertiesBody.java index 990a736..7486389 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesBody.java +++ b/src/main/java/com/onesignal/client/model/PropertiesBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesDeltas.java b/src/main/java/com/onesignal/client/model/PropertiesDeltas.java index ea44502..db80ced 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesDeltas.java +++ b/src/main/java/com/onesignal/client/model/PropertiesDeltas.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/PropertiesObject.java b/src/main/java/com/onesignal/client/model/PropertiesObject.java index 242086b..14eb67f 100644 --- a/src/main/java/com/onesignal/client/model/PropertiesObject.java +++ b/src/main/java/com/onesignal/client/model/PropertiesObject.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Purchase.java b/src/main/java/com/onesignal/client/model/Purchase.java index 7cc1878..4d72b6d 100644 --- a/src/main/java/com/onesignal/client/model/Purchase.java +++ b/src/main/java/com/onesignal/client/model/Purchase.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/RateLimitError.java b/src/main/java/com/onesignal/client/model/RateLimitError.java index 7bbc97f..c7d4441 100644 --- a/src/main/java/com/onesignal/client/model/RateLimitError.java +++ b/src/main/java/com/onesignal/client/model/RateLimitError.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Segment.java b/src/main/java/com/onesignal/client/model/Segment.java index f54ef71..69409a1 100644 --- a/src/main/java/com/onesignal/client/model/Segment.java +++ b/src/main/java/com/onesignal/client/model/Segment.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SegmentData.java b/src/main/java/com/onesignal/client/model/SegmentData.java index f9e8857..2f67fb6 100644 --- a/src/main/java/com/onesignal/client/model/SegmentData.java +++ b/src/main/java/com/onesignal/client/model/SegmentData.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SegmentDetails.java b/src/main/java/com/onesignal/client/model/SegmentDetails.java new file mode 100644 index 0000000..5ed7b70 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/SegmentDetails.java @@ -0,0 +1,408 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.FilterExpression; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * Segment details. Only included when the include-segment-detail query parameter is set to true. + */ +@ApiModel(description = "Segment details. Only included when the include-segment-detail query parameter is set to true.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SegmentDetails { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private Integer createdAt; + + /** + * The source of the segment. + */ + @JsonAdapter(SourceEnum.Adapter.class) + public enum SourceEnum { + DEFAULT("default"), + + CUSTOM("custom"), + + QUICKSTART("quickstart"); + + private String value; + + SourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SourceEnum fromValue(String value) { + for (SourceEnum b : SourceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SourceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private SourceEnum source; + + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private List filters = null; + + public SegmentDetails() { + } + + public SegmentDetails id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for the segment (UUID v4). + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The unique identifier for the segment (UUID v4).") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public SegmentDetails name(String name) { + + this.name = name; + return this; + } + + /** + * The segment name. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The segment name.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SegmentDetails description(String description) { + + this.description = description; + return this; + } + + /** + * Human-readable description for the segment. `null` when unset. Maximum 255 characters. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Human-readable description for the segment. `null` when unset. Maximum 255 characters.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public SegmentDetails createdAt(Integer createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp when the segment was created. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Unix timestamp when the segment was created.") + + public Integer getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public SegmentDetails source(SourceEnum source) { + + this.source = source; + return this; + } + + /** + * The source of the segment. + * @return source + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The source of the segment.") + + public SourceEnum getSource() { + return source; + } + + + public void setSource(SourceEnum source) { + this.source = source; + } + + + public SegmentDetails filters(List filters) { + + this.filters = filters; + return this; + } + + public SegmentDetails addFiltersItem(FilterExpression filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * 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. + * @return filters + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "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.") + + public List getFilters() { + return filters; + } + + + public void setFilters(List filters) { + this.filters = filters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SegmentDetails segmentDetails = (SegmentDetails) o; + return Objects.equals(this.id, segmentDetails.id) && + Objects.equals(this.name, segmentDetails.name) && + Objects.equals(this.description, segmentDetails.description) && + Objects.equals(this.createdAt, segmentDetails.createdAt) && + Objects.equals(this.source, segmentDetails.source) && + Objects.equals(this.filters, segmentDetails.filters); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, createdAt, source, filters); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SegmentDetails {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("created_at"); + openapiFields.add("source"); + openapiFields.add("filters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SegmentDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SegmentDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SegmentDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SegmentDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SegmentDetails read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SegmentDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of SegmentDetails + * @throws IOException if the JSON string is invalid with respect to SegmentDetails + */ + public static SegmentDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SegmentDetails.class); + } + + /** + * Convert an instance of SegmentDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java index 2277354..b4f18f6 100644 --- a/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/SegmentNotificationTarget.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java b/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java index 6a34629..cb35ff9 100644 --- a/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java +++ b/src/main/java/com/onesignal/client/model/StartLiveActivityRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java b/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java index 0b32cfc..fb2f81b 100644 --- a/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/StartLiveActivitySuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/Subscription.java b/src/main/java/com/onesignal/client/model/Subscription.java index 54186e0..7c40f3f 100644 --- a/src/main/java/com/onesignal/client/model/Subscription.java +++ b/src/main/java/com/onesignal/client/model/Subscription.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SubscriptionBody.java b/src/main/java/com/onesignal/client/model/SubscriptionBody.java index c0dd7cf..84b6517 100644 --- a/src/main/java/com/onesignal/client/model/SubscriptionBody.java +++ b/src/main/java/com/onesignal/client/model/SubscriptionBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java b/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java index 2d2d57f..94557c3 100644 --- a/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java +++ b/src/main/java/com/onesignal/client/model/SubscriptionNotificationTarget.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/TemplateResource.java b/src/main/java/com/onesignal/client/model/TemplateResource.java index e0d8459..8f60ecb 100644 --- a/src/main/java/com/onesignal/client/model/TemplateResource.java +++ b/src/main/java/com/onesignal/client/model/TemplateResource.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/TemplatesListResponse.java b/src/main/java/com/onesignal/client/model/TemplatesListResponse.java index 2970b51..d064181 100644 --- a/src/main/java/com/onesignal/client/model/TemplatesListResponse.java +++ b/src/main/java/com/onesignal/client/model/TemplatesListResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java b/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java index f0d28d9..37d7788 100644 --- a/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java +++ b/src/main/java/com/onesignal/client/model/TransferSubscriptionRequestBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java b/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java index def3171..45d9a36 100644 --- a/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateApiKeyRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java b/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java index affac33..1e5db3d 100644 --- a/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateLiveActivityRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java b/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java index 1eca6c6..db56ae9 100644 --- a/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java +++ b/src/main/java/com/onesignal/client/model/UpdateLiveActivitySuccessResponse.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateSegmentRequest.java b/src/main/java/com/onesignal/client/model/UpdateSegmentRequest.java new file mode 100644 index 0000000..46d9e5e --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateSegmentRequest.java @@ -0,0 +1,257 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.onesignal.client.model.FilterExpression; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * UpdateSegmentRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSegmentRequest { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private List filters = null; + + public UpdateSegmentRequest() { + } + + public UpdateSegmentRequest name(String name) { + + this.name = name; + return this; + } + + /** + * Required. The segment name. Maximum 128 characters. + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Required. The segment name. Maximum 128 characters.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateSegmentRequest description(String description) { + + this.description = description; + return this; + } + + /** + * Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public UpdateSegmentRequest filters(List filters) { + + this.filters = filters; + return this; + } + + public UpdateSegmentRequest addFiltersItem(FilterExpression filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * 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. + * @return filters + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "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.") + + public List getFilters() { + return filters; + } + + + public void setFilters(List filters) { + this.filters = filters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSegmentRequest updateSegmentRequest = (UpdateSegmentRequest) o; + return Objects.equals(this.name, updateSegmentRequest.name) && + Objects.equals(this.description, updateSegmentRequest.description) && + Objects.equals(this.filters, updateSegmentRequest.filters); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, filters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSegmentRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("filters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSegmentRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSegmentRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSegmentRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSegmentRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSegmentRequest + * @throws IOException if the JSON string is invalid with respect to UpdateSegmentRequest + */ + public static UpdateSegmentRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSegmentRequest.class); + } + + /** + * Convert an instance of UpdateSegmentRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/UpdateSegmentSuccessResponse.java b/src/main/java/com/onesignal/client/model/UpdateSegmentSuccessResponse.java new file mode 100644 index 0000000..9b89f94 --- /dev/null +++ b/src/main/java/com/onesignal/client/model/UpdateSegmentSuccessResponse.java @@ -0,0 +1,215 @@ +/* + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.onesignal.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.onesignal.client.JSON; + +/** + * UpdateSegmentSuccessResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UpdateSegmentSuccessResponse { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public UpdateSegmentSuccessResponse() { + } + + public UpdateSegmentSuccessResponse success(Boolean success) { + + this.success = success; + return this; + } + + /** + * true if the segment was updated successfully, false otherwise. + * @return success + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "true if the segment was updated successfully, false otherwise.") + + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public UpdateSegmentSuccessResponse id(String id) { + + this.id = id; + return this; + } + + /** + * UUID of the updated segment. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "UUID of the updated segment.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSegmentSuccessResponse updateSegmentSuccessResponse = (UpdateSegmentSuccessResponse) o; + return Objects.equals(this.success, updateSegmentSuccessResponse.success) && + Objects.equals(this.id, updateSegmentSuccessResponse.id); + } + + @Override + public int hashCode() { + return Objects.hash(success, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSegmentSuccessResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSegmentSuccessResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSegmentSuccessResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSegmentSuccessResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSegmentSuccessResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSegmentSuccessResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSegmentSuccessResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSegmentSuccessResponse + * @throws IOException if the JSON string is invalid with respect to UpdateSegmentSuccessResponse + */ + public static UpdateSegmentSuccessResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSegmentSuccessResponse.class); + } + + /** + * Convert an instance of UpdateSegmentSuccessResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java b/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java index 8311499..78c45f9 100644 --- a/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateTemplateRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UpdateUserRequest.java b/src/main/java/com/onesignal/client/model/UpdateUserRequest.java index d4f7dee..ea6a53d 100644 --- a/src/main/java/com/onesignal/client/model/UpdateUserRequest.java +++ b/src/main/java/com/onesignal/client/model/UpdateUserRequest.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/User.java b/src/main/java/com/onesignal/client/model/User.java index f381172..2ca8fd5 100644 --- a/src/main/java/com/onesignal/client/model/User.java +++ b/src/main/java/com/onesignal/client/model/User.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/UserIdentityBody.java b/src/main/java/com/onesignal/client/model/UserIdentityBody.java index f48f797..c769f42 100644 --- a/src/main/java/com/onesignal/client/model/UserIdentityBody.java +++ b/src/main/java/com/onesignal/client/model/UserIdentityBody.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/onesignal/client/model/WebButton.java b/src/main/java/com/onesignal/client/model/WebButton.java index fc60298..f8b33c3 100644 --- a/src/main/java/com/onesignal/client/model/WebButton.java +++ b/src/main/java/com/onesignal/client/model/WebButton.java @@ -2,7 +2,7 @@ * 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 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).