diff --git a/api/openapi.yaml b/api/openapi.yaml
index 41b0fe8..1ec3eb6 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -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\
@@ -3574,6 +3715,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: "{}"
diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md
index 97db482..be9cdde 100644
--- a/docs/DefaultApi.md
+++ b/docs/DefaultApi.md
@@ -32,6 +32,7 @@ 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} | |
| [**rotateApiKey**](DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key |
@@ -41,6 +42,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 +2332,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)
@@ -3020,6 +3100,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/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/src/main/java/com/onesignal/client/JSON.java b/src/main/java/com/onesignal/client/JSON.java
index de56d9d..ba71b25 100644
--- a/src/main/java/com/onesignal/client/JSON.java
+++ b/src/main/java/com/onesignal/client/JSON.java
@@ -121,6 +121,7 @@ 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.Notification.CustomTypeAdapterFactory())
@@ -143,6 +144,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 +157,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/api/DefaultApi.java b/src/main/java/com/onesignal/client/api/DefaultApi.java
index 338f401..629fe3f 100644
--- a/src/main/java/com/onesignal/client/api/DefaultApi.java
+++ b/src/main/java/com/onesignal/client/api/DefaultApi.java
@@ -44,6 +44,7 @@
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.Notification;
import com.onesignal.client.model.NotificationHistorySuccessResponse;
@@ -62,6 +63,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;
@@ -4531,6 +4534,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.10.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)
@@ -5967,6 +6134,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.10.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)
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..1b65b79
--- /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.10.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/SegmentDetails.java b/src/main/java/com/onesignal/client/model/SegmentDetails.java
new file mode 100644
index 0000000..986867e
--- /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.10.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/UpdateSegmentRequest.java b/src/main/java/com/onesignal/client/model/UpdateSegmentRequest.java
new file mode 100644
index 0000000..c134b88
--- /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.10.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..476cf4f
--- /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.10.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);
+ }
+}
+