From 50fa61cf9a547fd47800dc16e7c0f27d5b96fc51 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 7 Sep 2023 07:26:04 +0000 Subject: [PATCH] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b0107fb2. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 38 + .../segment/publicapi/api/FunctionsApi.java | 922 ++++++++++++++++-- ...eateInsertFunctionInstance200Response.java | 204 ++++ ...reateInsertFunctionInstanceAlphaInput.java | 372 +++++++ ...eateInsertFunctionInstanceAlphaOutput.java | 221 +++++ ...leteInsertFunctionInstance200Response.java | 204 ++++ ...leteInsertFunctionInstanceAlphaOutput.java | 268 +++++ .../models/InsertFunctionInstance.java | 510 ++++++++++ .../models/InsertFunctionInstance1.java | 512 ++++++++++ .../models/InsertFunctionInstanceAlpha.java | 510 ++++++++++ ...istInsertFunctionInstances200Response.java | 202 ++++ ...istInsertFunctionInstancesAlphaOutput.java | 267 +++++ ...dateInsertFunctionInstance200Response.java | 204 ++++ ...pdateInsertFunctionInstanceAlphaInput.java | 293 ++++++ ...dateInsertFunctionInstanceAlphaOutput.java | 221 +++++ 18 files changed, 4878 insertions(+), 82 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java diff --git a/README.md b/README.md index 42760f97..918c30b1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.1.0 +Latest API and SDK version: 36.1.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.1.0 + 36.1.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.1.0" + implementation "com.segment.publicapi:segment-publicapi:36.1.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.1.0.jar` +* `target/segment-publicapi-36.1.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index feb2c500..00425dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.1.0 + 36.1.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 0ac40979..6902f22d 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.1.0 (Java)"); + setUserAgent("Public API SDK 36.1.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 32b26d4f..39eed4e2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -239,6 +239,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvites200Response .CustomTypeAdapterFactory()); @@ -363,6 +372,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteInvites200Response .CustomTypeAdapterFactory()); @@ -738,6 +753,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstanceAlpha + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -820,6 +843,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstances200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstancesAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1311,6 +1340,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateGroupSubscriptionStatusResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 7ffa3443..f7b41130 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -22,16 +22,22 @@ import com.segment.publicapi.models.CreateFunction200Response; import com.segment.publicapi.models.CreateFunctionDeployment200Response; import com.segment.publicapi.models.CreateFunctionV1Input; +import com.segment.publicapi.models.CreateInsertFunctionInstance200Response; +import com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput; import com.segment.publicapi.models.DeleteFunction200Response; +import com.segment.publicapi.models.DeleteInsertFunctionInstance200Response; import com.segment.publicapi.models.GetFunction200Response; import com.segment.publicapi.models.GetFunctionVersion200Response; import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; +import com.segment.publicapi.models.ListInsertFunctionInstances200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RestoreFunctionVersion200Response; import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; +import com.segment.publicapi.models.UpdateInsertFunctionInstance200Response; +import com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -428,6 +434,189 @@ public okhttp3.Call createFunctionDeploymentAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createInsertFunctionInstance + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + 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 = createInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = "/insert-function-instances"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createInsertFunctionInstanceAlphaInput' is set + if (createInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createInsertFunctionInstanceAlphaInput' when" + + " calling createInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return CreateInsertFunctionInstance200Response + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateInsertFunctionInstance200Response createInsertFunctionInstance( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createInsertFunctionInstanceWithHttpInfo(createInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<CreateInsertFunctionInstance200Response> + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + createInsertFunctionInstanceWithHttpInfo( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Insert Function Instance (asynchronously) Creates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceAsync( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteFunction * @@ -600,6 +789,180 @@ public okhttp3.Call deleteFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for deleteInsertFunctionInstance + * + * @param instanceId (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceCall( + String instanceId, 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 = + "/insert-function-instances/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "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[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( + String instanceId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " deleteInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = deleteInsertFunctionInstanceCall(instanceId, _callback); + return localVarCall; + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return DeleteInsertFunctionInstance200Response + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance(String instanceId) + throws ApiException { + ApiResponse localVarResp = + deleteInsertFunctionInstanceWithHttpInfo(instanceId); + return localVarResp.getData(); + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return ApiResponse<DeleteInsertFunctionInstance200Response> + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + deleteInsertFunctionInstanceWithHttpInfo(String instanceId) throws ApiException { + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Insert Function Instance (asynchronously) Deletes an insert Function instance. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceAsync( + String instanceId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getFunction * @@ -1091,13 +1454,211 @@ public ListFunctionVersions200Response listFunctionVersions( } /** - * List Function Versions Lists versions for a Function in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Function Versions Lists versions for a Function in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ApiResponse<ListFunctionVersions200Response> + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsAsync( + String functionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFunctions + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionsCall( + PaginationInput pagination, String resourceType, 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 = "/functions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + if (resourceType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+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[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionsValidateBeforeCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFunctions(Async)"); + } + + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + throw new ApiException( + "Missing the required parameter 'resourceType' when calling" + + " listFunctions(Async)"); + } + + okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + return localVarCall; + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ListFunctions200Response + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) + throws ApiException { + ApiResponse localVarResp = + listFunctionsWithHttpInfo(pagination, resourceType); + return localVarResp.getData(); + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @return ApiResponse<ListFunctionVersions200Response> + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ApiResponse<ListFunctions200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1109,21 +1670,21 @@ public ListFunctionVersions200Response listFunctionVersions( * 429 Too many requests - * */ - public ApiResponse listFunctionVersionsWithHttpInfo( - String functionId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listFunctionsWithHttpInfo( + PaginationInput pagination, String resourceType) throws ApiException { + okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. + * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @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 @@ -1137,24 +1698,24 @@ public ApiResponse listFunctionVersionsWithHttp * 429 Too many requests - * */ - public okhttp3.Call listFunctionVersionsAsync( - String functionId, + public okhttp3.Call listFunctionsAsync( PaginationInput pagination, - final ApiCallback _callback) + String resourceType, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listFunctionsValidateBeforeCall(pagination, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listFunctions + * Build call for listInsertFunctionInstances * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1167,8 +1728,8 @@ public okhttp3.Call listFunctionVersionsAsync( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + public okhttp3.Call listInsertFunctionInstancesCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1186,7 +1747,7 @@ public okhttp3.Call listFunctionsCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions"; + String localVarPath = "/insert-function-instances"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1198,16 +1759,12 @@ public okhttp3.Call listFunctionsCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } - if (resourceType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("resourceType", resourceType)); + if (functionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("functionId", functionId)); } final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1238,37 +1795,39 @@ public okhttp3.Call listFunctionsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionsValidateBeforeCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling" - + " listFunctions(Async)"); + + " listInsertFunctionInstances(Async)"); } - // verify the required parameter 'resourceType' is set - if (resourceType == null) { + // verify the required parameter 'functionId' is set + if (functionId == null) { throw new ApiException( - "Missing the required parameter 'resourceType' when calling" - + " listFunctions(Async)"); + "Missing the required parameter 'functionId' when calling" + + " listInsertFunctionInstances(Async)"); } - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + okhttp3.Call localVarCall = + listInsertFunctionInstancesCall(pagination, functionId, _callback); return localVarCall; } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ListFunctions200Response + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ListInsertFunctionInstances200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1280,22 +1839,23 @@ private okhttp3.Call listFunctionsValidateBeforeCall( * 429 Too many requests - * */ - public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) - throws ApiException { - ApiResponse localVarResp = - listFunctionsWithHttpInfo(pagination, resourceType); + public ListInsertFunctionInstances200Response listInsertFunctionInstances( + PaginationInput pagination, String functionId) throws ApiException { + ApiResponse localVarResp = + listInsertFunctionInstancesWithHttpInfo(pagination, functionId); return localVarResp.getData(); } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ApiResponse<ListFunctions200Response> + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListInsertFunctionInstances200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1307,21 +1867,25 @@ public ListFunctions200Response listFunctions(PaginationInput pagination, String * 429 Too many requests - * */ - public ApiResponse listFunctionsWithHttpInfo( - PaginationInput pagination, String resourceType) throws ApiException { - okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse + listInsertFunctionInstancesWithHttpInfo(PaginationInput pagination, String functionId) + throws ApiException { + okhttp3.Call localVarCall = + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Insert Function Instances (asynchronously) Lists all insert Function instances connected + * to the given insert Function. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @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 @@ -1335,15 +1899,16 @@ public ApiResponse listFunctionsWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsAsync( + public okhttp3.Call listInsertFunctionInstancesAsync( PaginationInput pagination, - String resourceType, - final ApiCallback _callback) + String functionId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionsValidateBeforeCall(pagination, resourceType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1744,4 +2309,209 @@ public okhttp3.Call updateFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateInsertFunctionInstance + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + 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 = updateInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = + "/insert-function-instances/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " updateInsertFunctionInstance(Async)"); + } + + // verify the required parameter 'updateInsertFunctionInstanceAlphaInput' is set + if (updateInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateInsertFunctionInstanceAlphaInput' when" + + " calling updateInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return UpdateInsertFunctionInstance200Response + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateInsertFunctionInstance200Response updateInsertFunctionInstance( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateInsertFunctionInstanceWithHttpInfo( + instanceId, updateInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<UpdateInsertFunctionInstance200Response> + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateInsertFunctionInstanceWithHttpInfo( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Insert Function Instance (asynchronously) Updates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @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 -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceAsync( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..1cc532a5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** CreateInsertFunctionInstance200Response */ +public class CreateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateInsertFunctionInstanceAlphaOutput data; + + public CreateInsertFunctionInstance200Response() {} + + public CreateInsertFunctionInstance200Response data( + CreateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(CreateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstance200Response createInsertFunctionInstance200Response = + (CreateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, createInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).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("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + CreateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static CreateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..c41b9d84 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,372 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_FUNCTION_ID = "functionId"; + + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + private String functionId; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public CreateInsertFunctionInstanceAlphaInput() {} + + public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { + + this.functionId = functionId; + return this; + } + + /** + * Insert Function id to which this instance is associated. + * + * @return functionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Insert Function id to which this instance is associated.") + public String getFunctionId() { + return functionId; + } + + public void setFunctionId(String functionId) { + this.functionId = functionId; + } + + public CreateInsertFunctionInstanceAlphaInput integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Source or Destination id to be connected. + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source or Destination id to be connected.") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public CreateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput = + (CreateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.functionId, createInsertFunctionInstanceAlphaInput.functionId) + && Objects.equals( + this.integrationId, createInsertFunctionInstanceAlphaInput.integrationId) + && Objects.equals(this.enabled, createInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, createInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, createInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(functionId, integrationId, enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).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("functionId"); + openapiFields.add("integrationId"); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionId"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("functionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `functionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("functionId").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static CreateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..19d37394 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance insertFunctionInstance; + + public CreateInsertFunctionInstanceAlphaOutput() {} + + public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaOutput createInsertFunctionInstanceAlphaOutput = + (CreateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + createInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .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("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static CreateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java new file mode 100644 index 00000000..00630b51 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** DeleteInsertFunctionInstance200Response */ +public class DeleteInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteInsertFunctionInstanceAlphaOutput data; + + public DeleteInsertFunctionInstance200Response() {} + + public DeleteInsertFunctionInstance200Response data( + DeleteInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(DeleteInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance200Response = + (DeleteInsertFunctionInstance200Response) o; + return Objects.equals(this.data, deleteInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).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("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static DeleteInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..99baa644 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete an insert Function instance. */ +@ApiModel(description = "Delete an insert Function instance.") +public class DeleteInsertFunctionInstanceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.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 StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteInsertFunctionInstanceAlphaOutput() {} + + public DeleteInsertFunctionInstanceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstanceAlphaOutput deleteInsertFunctionInstanceAlphaOutput = + (DeleteInsertFunctionInstanceAlphaOutput) o; + return Objects.equals(this.status, deleteInsertFunctionInstanceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).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("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static DeleteInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java new file mode 100644 index 00000000..3c0cadf9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created instance. */ +@ApiModel(description = "The created instance.") +public class InsertFunctionInstance { + 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_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance() {} + + public InsertFunctionInstance id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance insertFunctionInstance = (InsertFunctionInstance) o; + return Objects.equals(this.id, insertFunctionInstance.id) + && Objects.equals(this.name, insertFunctionInstance.name) + && Objects.equals(this.integrationId, insertFunctionInstance.integrationId) + && Objects.equals(this.classId, insertFunctionInstance.classId) + && Objects.equals(this.enabled, insertFunctionInstance.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance.settings) + && Objects.equals(this.encryptedSettings, insertFunctionInstance.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .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("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance is not found in" + + " the empty JSON string", + InsertFunctionInstance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance + */ + public static InsertFunctionInstance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance.class); + } + + /** + * Convert an instance of InsertFunctionInstance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java new file mode 100644 index 00000000..88b17c35 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java @@ -0,0 +1,512 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated instance. */ +@ApiModel(description = "The updated instance.") +public class InsertFunctionInstance1 { + 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_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance1() {} + + public InsertFunctionInstance1 id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance1 name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance1 integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance1 classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance1 settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance1 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance1 encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance1 putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance1 insertFunctionInstance1 = (InsertFunctionInstance1) o; + return Objects.equals(this.id, insertFunctionInstance1.id) + && Objects.equals(this.name, insertFunctionInstance1.name) + && Objects.equals(this.integrationId, insertFunctionInstance1.integrationId) + && Objects.equals(this.classId, insertFunctionInstance1.classId) + && Objects.equals(this.enabled, insertFunctionInstance1.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance1.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance1.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance1.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstance1.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .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("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance1 is not found" + + " in the empty JSON string", + InsertFunctionInstance1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance1 + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance1 + */ + public static InsertFunctionInstance1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance1.class); + } + + /** + * Convert an instance of InsertFunctionInstance1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java new file mode 100644 index 00000000..f64bb2d2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** InsertFunctionInstanceAlpha */ +public class InsertFunctionInstanceAlpha { + 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_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstanceAlpha() {} + + public InsertFunctionInstanceAlpha id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstanceAlpha name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstanceAlpha integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstanceAlpha classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstanceAlpha enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstanceAlpha createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstanceAlpha updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstanceAlpha settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstanceAlpha encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstanceAlpha putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstanceAlpha insertFunctionInstanceAlpha = (InsertFunctionInstanceAlpha) o; + return Objects.equals(this.id, insertFunctionInstanceAlpha.id) + && Objects.equals(this.name, insertFunctionInstanceAlpha.name) + && Objects.equals(this.integrationId, insertFunctionInstanceAlpha.integrationId) + && Objects.equals(this.classId, insertFunctionInstanceAlpha.classId) + && Objects.equals(this.enabled, insertFunctionInstanceAlpha.enabled) + && Objects.equals(this.createdAt, insertFunctionInstanceAlpha.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstanceAlpha.updatedAt) + && Objects.equals(this.settings, insertFunctionInstanceAlpha.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstanceAlpha.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstanceAlpha {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .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("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstanceAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstanceAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstanceAlpha is not" + + " found in the empty JSON string", + InsertFunctionInstanceAlpha.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstanceAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstanceAlpha` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstanceAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstanceAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstanceAlpha' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstanceAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstanceAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstanceAlpha read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstanceAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstanceAlpha + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstanceAlpha + */ + public static InsertFunctionInstanceAlpha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstanceAlpha.class); + } + + /** + * Convert an instance of InsertFunctionInstanceAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java new file mode 100644 index 00000000..3ef99e9a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListInsertFunctionInstances200Response */ +public class ListInsertFunctionInstances200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListInsertFunctionInstancesAlphaOutput data; + + public ListInsertFunctionInstances200Response() {} + + public ListInsertFunctionInstances200Response data( + ListInsertFunctionInstancesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListInsertFunctionInstancesAlphaOutput getData() { + return data; + } + + public void setData(ListInsertFunctionInstancesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstances200Response listInsertFunctionInstances200Response = + (ListInsertFunctionInstances200Response) o; + return Objects.equals(this.data, listInsertFunctionInstances200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstances200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).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("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstances200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstances200Response" + + " is not found in the empty JSON string", + ListInsertFunctionInstances200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstances200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstances200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstances200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstances200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstances200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstances200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstances200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstances200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstances200Response + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static ListInsertFunctionInstances200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstances200Response.class); + } + + /** + * Convert an instance of ListInsertFunctionInstances200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java new file mode 100644 index 00000000..2dfba5f1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java @@ -0,0 +1,267 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns a list of insert Function instances connected to the insert Function. */ +@ApiModel( + description = + "Returns a list of insert Function instances connected to the insert Function.") +public class ListInsertFunctionInstancesAlphaOutput { + public static final String SERIALIZED_NAME_INSTANCES = "instances"; + + @SerializedName(SERIALIZED_NAME_INSTANCES) + private List instances = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListInsertFunctionInstancesAlphaOutput() {} + + public ListInsertFunctionInstancesAlphaOutput instances( + List instances) { + + this.instances = instances; + return this; + } + + public ListInsertFunctionInstancesAlphaOutput addInstancesItem( + InsertFunctionInstanceAlpha instancesItem) { + this.instances.add(instancesItem); + return this; + } + + /** + * All insert Function instances found. + * + * @return instances + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All insert Function instances found.") + public List getInstances() { + return instances; + } + + public void setInstances(List instances) { + this.instances = instances; + } + + public ListInsertFunctionInstancesAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstancesAlphaOutput listInsertFunctionInstancesAlphaOutput = + (ListInsertFunctionInstancesAlphaOutput) o; + return Objects.equals(this.instances, listInsertFunctionInstancesAlphaOutput.instances) + && Objects.equals( + this.pagination, listInsertFunctionInstancesAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(instances, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstancesAlphaOutput {\n"); + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).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("instances"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instances"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstancesAlphaOutput" + + " is not found in the empty JSON string", + ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstancesAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("instances").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `instances` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("instances").toString())); + } + + JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstancesAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstancesAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstancesAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstancesAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstancesAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstancesAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstancesAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static ListInsertFunctionInstancesAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstancesAlphaOutput.class); + } + + /** + * Convert an instance of ListInsertFunctionInstancesAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..013bb044 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateInsertFunctionInstance200Response */ +public class UpdateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateInsertFunctionInstanceAlphaOutput data; + + public UpdateInsertFunctionInstance200Response() {} + + public UpdateInsertFunctionInstance200Response data( + UpdateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(UpdateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstance200Response updateInsertFunctionInstance200Response = + (UpdateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, updateInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).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("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static UpdateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..4b1e6365 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,293 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Updates an insert Function instance. */ +@ApiModel(description = "Updates an insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public UpdateInsertFunctionInstanceAlphaInput() {} + + public UpdateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public UpdateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput = + (UpdateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.enabled, updateInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, updateInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, updateInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).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("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static UpdateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..30658358 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.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.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the updated insert Function instance. */ +@ApiModel(description = "Returns the updated insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance1 insertFunctionInstance; + + public UpdateInsertFunctionInstanceAlphaOutput() {} + + public UpdateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance1 insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance1 getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance1 insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaOutput updateInsertFunctionInstanceAlphaOutput = + (UpdateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + updateInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .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("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static UpdateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +}