diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1985849..368fd8f 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.7.0 +7.15.0 diff --git a/build.gradle b/build.gradle index beaee7e..15c0845 100644 --- a/build.gradle +++ b/build.gradle @@ -38,11 +38,11 @@ repositories { } tasks.shadowJar.configure { - classifier = null + archiveClassifier.set("") } tasks.jar.configure { - classifier = 'default' + archiveClassifier.set("default") } tasks.withType(Javadoc) { @@ -108,7 +108,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set("sources") } artifacts { @@ -144,6 +144,7 @@ ext { dependencies { implementation 'io.swagger:swagger-annotations:1.6.14' + implementation 'io.swagger.core.v3:swagger-annotations:2.2.22' implementation "com.google.code.findbugs:jsr305:3.0.2" implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' @@ -180,12 +181,12 @@ gradle.taskGraph.whenReady { taskGraph -> } task sourceJar(type: Jar) { - classifier "sources" + archiveClassifier.set("sources") from sourceSets.main.allJava } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier "javadoc" + archiveClassifier.set("javadoc") from javadoc.destinationDir } diff --git a/config-v4.yaml b/config-v4.yaml new file mode 100644 index 0000000..9f4d56e --- /dev/null +++ b/config-v4.yaml @@ -0,0 +1,5 @@ +additionalProperties: + apiPackage: io.tiledb.cloud.rest_api.v4.api + modelPackage: io.tiledb.cloud.rest_api.v4.model + hideGenerationTimestamp: true +library: okhttp-gson diff --git a/docs/APIToken.md b/docs/APIToken.md new file mode 100644 index 0000000..df4011a --- /dev/null +++ b/docs/APIToken.md @@ -0,0 +1,20 @@ + + +# APIToken + +An API token + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenId** | **String** | The token's ID | | +|**name** | **String** | The name of the token | | +|**createdAt** | **OffsetDateTime** | The creation date and time of the token | | +|**expiresAt** | **OffsetDateTime** | The expiration date and time of the token | | +|**apiKey** | **String** | The secret API key that's used for authentication. If workspace_id is set, the format of the key is \"tiledb_<random bytes>\". Otherwise, the format is a JWT. | | +|**workspaceId** | **String** | The workspace ID of the token (if API token) | [optional] | +|**scope** | **TokenScope** | | | + + + diff --git a/docs/AWSCredential.md b/docs/AWSCredential.md new file mode 100644 index 0000000..824fb9d --- /dev/null +++ b/docs/AWSCredential.md @@ -0,0 +1,16 @@ + + +# AWSCredential + +Credential information to access Amazon Web Services + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | The ID of the access key | | +|**secretAccessKey** | **String** | The access key's secret. Never returned in responses. | | +|**endpoint** | **String** | The endpoint used for this credential | [optional] | + + + diff --git a/docs/AWSRole.md b/docs/AWSRole.md new file mode 100644 index 0000000..a4dddff --- /dev/null +++ b/docs/AWSRole.md @@ -0,0 +1,16 @@ + + +# AWSRole + +The role information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**roleArn** | **String** | The role arn used to access | | +|**externalId** | **String** | The role external id used to access | | +|**endpoint** | **String** | The endpoint used for this role | [optional] | + + + diff --git a/docs/AcademyApi.md b/docs/AcademyApi.md new file mode 100644 index 0000000..1e7e2ad --- /dev/null +++ b/docs/AcademyApi.md @@ -0,0 +1,325 @@ +# AcademyApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAcademyLessons**](AcademyApi.md#getAcademyLessons) | **GET** /academy/lessons | Get information about user lessons | +| [**getAcademyQuestionnaire**](AcademyApi.md#getAcademyQuestionnaire) | **GET** /academy/questionnaires/{questionnaire_id} | Get academy questionnaire information for user | +| [**putAcademyLessons**](AcademyApi.md#putAcademyLessons) | **PUT** /academy/lessons | Academy lessons to create | +| [**putAcademyQuestionnaire**](AcademyApi.md#putAcademyQuestionnaire) | **PUT** /academy/questionnaires/{questionnaire_id} | Create or update academy questionnaire | + + + +# **getAcademyLessons** +> AcademyLessonsListResponse getAcademyLessons() + +Get information about user lessons + +Get a list of user lessons with details about each of them + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.AcademyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AcademyApi apiInstance = new AcademyApi(defaultClient); + try { + AcademyLessonsListResponse result = apiInstance.getAcademyLessons(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AcademyApi#getAcademyLessons"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AcademyLessonsListResponse**](AcademyLessonsListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Academy lessons | - | +| **0** | error response | - | + + +# **getAcademyQuestionnaire** +> AcademyQuestionnaireListResponse getAcademyQuestionnaire(questionnaireId) + +Get academy questionnaire information for user + +Get academy questionnaire information for user. For example, questionnaire version, completion status and user answers + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.AcademyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AcademyApi apiInstance = new AcademyApi(defaultClient); + String questionnaireId = "questionnaireId_example"; // String | questionnaire's id + try { + AcademyQuestionnaireListResponse result = apiInstance.getAcademyQuestionnaire(questionnaireId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AcademyApi#getAcademyQuestionnaire"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **questionnaireId** | **String**| questionnaire's id | | + +### Return type + +[**AcademyQuestionnaireListResponse**](AcademyQuestionnaireListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful academy questionnaire response | - | +| **404** | answers not found | - | +| **0** | error response | - | + + +# **putAcademyLessons** +> putAcademyLessons(academyLesson) + +Academy lessons to create + +Create one or more user lessons + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.AcademyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AcademyApi apiInstance = new AcademyApi(defaultClient); + List academyLesson = Arrays.asList(); // List | Academy lesson to create + try { + apiInstance.putAcademyLessons(academyLesson); + } catch (ApiException e) { + System.err.println("Exception when calling AcademyApi#putAcademyLessons"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **academyLesson** | [**List<AcademyLesson>**](AcademyLesson.md)| Academy lesson to create | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | create or update success | - | +| **0** | error response | - | + + +# **putAcademyQuestionnaire** +> putAcademyQuestionnaire(questionnaireId, academyQuestionnairePutRequest) + +Create or update academy questionnaire + +Create a new questionnaire or update an existing one + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.AcademyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AcademyApi apiInstance = new AcademyApi(defaultClient); + String questionnaireId = "questionnaireId_example"; // String | questionnaire's id + AcademyQuestionnairePutRequest academyQuestionnairePutRequest = new AcademyQuestionnairePutRequest(); // AcademyQuestionnairePutRequest | academy lesson to create + try { + apiInstance.putAcademyQuestionnaire(questionnaireId, academyQuestionnairePutRequest); + } catch (ApiException e) { + System.err.println("Exception when calling AcademyApi#putAcademyQuestionnaire"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **questionnaireId** | **String**| questionnaire's id | | +| **academyQuestionnairePutRequest** | [**AcademyQuestionnairePutRequest**](AcademyQuestionnairePutRequest.md)| academy lesson to create | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | create or update success | - | +| **0** | error response | - | + diff --git a/docs/AcademyLesson.md b/docs/AcademyLesson.md new file mode 100644 index 0000000..ac48553 --- /dev/null +++ b/docs/AcademyLesson.md @@ -0,0 +1,17 @@ + + +# AcademyLesson + +The academy lesson object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lessonId** | **String** | Unique ID of the lesson | | +|**lessonVersion** | **String** | Version of the lesson | | +|**completed** | **Boolean** | Indicates if lesson is completed | [optional] | +|**pinned** | **Boolean** | Indicates if lesson is pinned | [optional] | + + + diff --git a/docs/AcademyLessonsListResponse.md b/docs/AcademyLessonsListResponse.md new file mode 100644 index 0000000..254b2de --- /dev/null +++ b/docs/AcademyLessonsListResponse.md @@ -0,0 +1,14 @@ + + +# AcademyLessonsListResponse + +object for get academy lessons list response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<AcademyLesson>**](AcademyLesson.md) | List of academy lessons items | | + + + diff --git a/docs/AcademyQuestionnaire.md b/docs/AcademyQuestionnaire.md new file mode 100644 index 0000000..a478a93 --- /dev/null +++ b/docs/AcademyQuestionnaire.md @@ -0,0 +1,17 @@ + + +# AcademyQuestionnaire + +The academy questionnaire object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**questionnaireId** | **String** | Unique ID of the questionnaire | | +|**questionnaireVersion** | **String** | Version of the questionnaire | | +|**completed** | **Boolean** | Indicates if questionnaire is completed | | +|**userAnswers** | [**List<UserAnswer>**](UserAnswer.md) | Array of user answers | | + + + diff --git a/docs/AcademyQuestionnaireListResponse.md b/docs/AcademyQuestionnaireListResponse.md new file mode 100644 index 0000000..321c222 --- /dev/null +++ b/docs/AcademyQuestionnaireListResponse.md @@ -0,0 +1,14 @@ + + +# AcademyQuestionnaireListResponse + +object for get academy questionnaire list response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<AcademyQuestionnaire>**](AcademyQuestionnaire.md) | List of academy questionnaires items | | + + + diff --git a/docs/AcademyQuestionnairePutRequest.md b/docs/AcademyQuestionnairePutRequest.md new file mode 100644 index 0000000..d2e6a5a --- /dev/null +++ b/docs/AcademyQuestionnairePutRequest.md @@ -0,0 +1,17 @@ + + +# AcademyQuestionnairePutRequest + +parameters for build create academy questionnaire request + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**questionnaireId** | **String** | Unique ID of the questionnaire | | +|**questionnaireVersion** | **String** | Version of the questionnaire | | +|**completed** | **Boolean** | Indicates if questionnaire is completed | | +|**userAnswers** | [**List<UserAnswer>**](UserAnswer.md) | Array of user answers | | + + + diff --git a/docs/AccessCredential.md b/docs/AccessCredential.md new file mode 100644 index 0000000..dfafc98 --- /dev/null +++ b/docs/AccessCredential.md @@ -0,0 +1,24 @@ + + +# AccessCredential + +The user credential object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**credentialType** | **CredentialType** | | | +|**id** | **String** | The ID of the credential | | +|**name** | **String** | credential name | | +|**provider** | **CloudProvider** | | | +|**providerDefault** | **Boolean** | True if this is the user's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider | [optional] | +|**createdAt** | **OffsetDateTime** | Datetime credentials were created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime credentials were updated in UTC | [optional] | +|**allowedInTasks** | **Boolean** | Is this credential allowed to be used in tasks | [optional] | +|**credential** | [**Credential**](Credential.md) | | [optional] | +|**role** | [**AccessCredentialRole**](AccessCredentialRole.md) | | [optional] | +|**token** | [**Token**](Token.md) | | [optional] | + + + diff --git a/docs/AccessCredentialRole.md b/docs/AccessCredentialRole.md new file mode 100644 index 0000000..1831249 --- /dev/null +++ b/docs/AccessCredentialRole.md @@ -0,0 +1,14 @@ + + +# AccessCredentialRole + +object for access credential role + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aws** | [**AWSRole**](AWSRole.md) | | [optional] | + + + diff --git a/docs/Asset.md b/docs/Asset.md new file mode 100644 index 0000000..c6e8a8b --- /dev/null +++ b/docs/Asset.md @@ -0,0 +1,32 @@ + + +# Asset + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The asset's ID | | +|**workspaceId** | **String** | The workspace's ID | | +|**teamspaceId** | **String** | The teamspace's ID | | +|**name** | **String** | The name of the asset. | | +|**description** | **String** | The description of the asset. | [optional] | +|**memberType** | **AssetMemberType** | | [optional] | +|**mime** | **String** | The MIME type of the asset. | [optional] | +|**backingType** | **AssetBackingType** | | | +|**type** | **AssetType** | | | +|**path** | **String** | The path of the asset. | | +|**createdAt** | **OffsetDateTime** | Datetime asset was created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime asset was updated in UTC | [optional] | +|**createdBy** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**metadata** | [**List<AssetMetadata>**](AssetMetadata.md) | | [optional] | +|**uri** | **String** | URI where the asset is located. | [optional] | +|**tiledbUri** | **String** | The TileDB URI in the form of tiledb://workspace_name/teamspace_name/asset_id | | +|**fileInfo** | [**FileInfo**](FileInfo.md) | | [optional] | +|**arrayInfo** | [**ArrayInfo**](ArrayInfo.md) | | [optional] | +|**groupInfo** | [**GroupInfo**](GroupInfo.md) | | [optional] | +|**folderInfo** | [**FolderInfo**](FolderInfo.md) | | [optional] | + + + diff --git a/docs/AssetBackingType.md b/docs/AssetBackingType.md index 4b6ee3f..e41046b 100644 --- a/docs/AssetBackingType.md +++ b/docs/AssetBackingType.md @@ -9,5 +9,9 @@ * `GROUP` (value: `"group"`) +* `FILE` (value: `"file"`) + +* `FOLDER` (value: `"folder"`) + diff --git a/docs/AssetGetResponse.md b/docs/AssetGetResponse.md new file mode 100644 index 0000000..a85ac68 --- /dev/null +++ b/docs/AssetGetResponse.md @@ -0,0 +1,14 @@ + + +# AssetGetResponse + +The response object when requesting a single asset + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Asset**](Asset.md) | | | + + + diff --git a/docs/AssetListResponse.md b/docs/AssetListResponse.md index 3c38bcb..6ed335a 100644 --- a/docs/AssetListResponse.md +++ b/docs/AssetListResponse.md @@ -2,14 +2,14 @@ # AssetListResponse -Asset associated with a TileDB Cloud account +The response object when requesting the list of assets ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**data** | [**List<AssetInfo>**](AssetInfo.md) | asset information for each asset | [optional] | -|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | [optional] | +|**data** | [**List<Asset>**](Asset.md) | An array of assets | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | | diff --git a/docs/AssetMemberType.md b/docs/AssetMemberType.md new file mode 100644 index 0000000..fcfbe1a --- /dev/null +++ b/docs/AssetMemberType.md @@ -0,0 +1,23 @@ + + +# AssetMemberType + +## Enum + + +* `VCF_MEMBER` (value: `"vcf_member"`) + +* `SOMA_MEMBER` (value: `"soma_member"`) + +* `BIOIMG_MEMBER` (value: `"bioimg_member"`) + +* `VECTOR_SEARCH_MEMBER` (value: `"vector_search_member"`) + +* `GEOMETRY_MEMBER` (value: `"geometry_member"`) + +* `RASTER_MEMBER` (value: `"raster_member"`) + +* `POINT_CLOUD_MEMBER` (value: `"point_cloud_member"`) + + + diff --git a/docs/AssetMetadata.md b/docs/AssetMetadata.md new file mode 100644 index 0000000..93e709b --- /dev/null +++ b/docs/AssetMetadata.md @@ -0,0 +1,16 @@ + + +# AssetMetadata + +key/value pair representing an asset metadata entry + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The key property of metadata pair. | | +|**value** | **String** | The value property of metadata pair. | | +|**type** | **AssetMetadataType** | | | + + + diff --git a/docs/AssetMetadataListResponse.md b/docs/AssetMetadataListResponse.md new file mode 100644 index 0000000..9d32b84 --- /dev/null +++ b/docs/AssetMetadataListResponse.md @@ -0,0 +1,15 @@ + + +# AssetMetadataListResponse + +The response object when requesting the list of asset metadata + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<AssetMetadata>**](AssetMetadata.md) | An array of asset's metadata | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | | + + + diff --git a/docs/AssetMetadataSaveRequestInner.md b/docs/AssetMetadataSaveRequestInner.md new file mode 100644 index 0000000..7c49023 --- /dev/null +++ b/docs/AssetMetadataSaveRequestInner.md @@ -0,0 +1,16 @@ + + +# AssetMetadataSaveRequestInner + +Asset metadata entry + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The key property of metadata pair. | | +|**value** | **String** | The value property of metadata pair. | | +|**type** | **AssetMetadataType** | | | + + + diff --git a/docs/AssetMetadataSaveResponse.md b/docs/AssetMetadataSaveResponse.md new file mode 100644 index 0000000..a812571 --- /dev/null +++ b/docs/AssetMetadataSaveResponse.md @@ -0,0 +1,14 @@ + + +# AssetMetadataSaveResponse + +object for save asset metadata response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<AssetMetadata>**](AssetMetadata.md) | An array of asset's metadata that were saved | | + + + diff --git a/docs/AssetMetadataType.md b/docs/AssetMetadataType.md new file mode 100644 index 0000000..9283289 --- /dev/null +++ b/docs/AssetMetadataType.md @@ -0,0 +1,93 @@ + + +# AssetMetadataType + +## Enum + + +* `INT32` (value: `"INT32"`) + +* `INT64` (value: `"INT64"`) + +* `FLOAT32` (value: `"FLOAT32"`) + +* `FLOAT64` (value: `"FLOAT64"`) + +* `CHAR` (value: `"CHAR"`) + +* `INT8` (value: `"INT8"`) + +* `UINT8` (value: `"UINT8"`) + +* `INT16` (value: `"INT16"`) + +* `UINT16` (value: `"UINT16"`) + +* `UINT32` (value: `"UINT32"`) + +* `UINT64` (value: `"UINT64"`) + +* `STRING_ASCII` (value: `"STRING_ASCII"`) + +* `STRING_UTF8` (value: `"STRING_UTF8"`) + +* `STRING_UTF16` (value: `"STRING_UTF16"`) + +* `STRING_UTF32` (value: `"STRING_UTF32"`) + +* `STRING_UCS2` (value: `"STRING_UCS2"`) + +* `STRING_UCS4` (value: `"STRING_UCS4"`) + +* `ANY` (value: `"ANY"`) + +* `DATETIME_YEAR` (value: `"DATETIME_YEAR"`) + +* `DATETIME_MONTH` (value: `"DATETIME_MONTH"`) + +* `DATETIME_WEEK` (value: `"DATETIME_WEEK"`) + +* `DATETIME_DAY` (value: `"DATETIME_DAY"`) + +* `DATETIME_HR` (value: `"DATETIME_HR"`) + +* `DATETIME_MIN` (value: `"DATETIME_MIN"`) + +* `DATETIME_SEC` (value: `"DATETIME_SEC"`) + +* `DATETIME_MS` (value: `"DATETIME_MS"`) + +* `DATETIME_US` (value: `"DATETIME_US"`) + +* `DATETIME_NS` (value: `"DATETIME_NS"`) + +* `DATETIME_PS` (value: `"DATETIME_PS"`) + +* `DATETIME_FS` (value: `"DATETIME_FS"`) + +* `DATETIME_AS` (value: `"DATETIME_AS"`) + +* `TIME_HR` (value: `"TIME_HR"`) + +* `TIME_MIN` (value: `"TIME_MIN"`) + +* `TIME_SEC` (value: `"TIME_SEC"`) + +* `TIME_MS` (value: `"TIME_MS"`) + +* `TIME_US` (value: `"TIME_US"`) + +* `TIME_NS` (value: `"TIME_NS"`) + +* `TIME_PS` (value: `"TIME_PS"`) + +* `TIME_FS` (value: `"TIME_FS"`) + +* `TIME_AS` (value: `"TIME_AS"`) + +* `BLOB` (value: `"BLOB"`) + +* `BOOL` (value: `"BOOL"`) + + + diff --git a/docs/AssetPathResponse.md b/docs/AssetPathResponse.md new file mode 100644 index 0000000..58e3785 --- /dev/null +++ b/docs/AssetPathResponse.md @@ -0,0 +1,14 @@ + + +# AssetPathResponse + +The response object when requesting all assets in a given path + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<Asset>**](Asset.md) | An array of assets. The order of the assets corresponds to the order of the path elements. | | + + + diff --git a/docs/AssetRegisterRequest.md b/docs/AssetRegisterRequest.md new file mode 100644 index 0000000..7d05fe7 --- /dev/null +++ b/docs/AssetRegisterRequest.md @@ -0,0 +1,17 @@ + + +# AssetRegisterRequest + +Request to register an asset + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the asset | | +|**uri** | **URI** | URI of the asset (e.g., S3 location) | | +|**accessCredentialsName** | **String** | Named reference to access credentials | | +|**path** | **String** | Target path under the teamspace | | + + + diff --git a/docs/AssetType.md b/docs/AssetType.md index dd482fb..1a44d7d 100644 --- a/docs/AssetType.md +++ b/docs/AssetType.md @@ -35,5 +35,7 @@ * `VECTOR_SEARCH` (value: `"vector_search"`) +* `FOLDER` (value: `"folder"`) + diff --git a/docs/AssetUpdateRequest.md b/docs/AssetUpdateRequest.md new file mode 100644 index 0000000..f2f685c --- /dev/null +++ b/docs/AssetUpdateRequest.md @@ -0,0 +1,16 @@ + + +# AssetUpdateRequest + +Request body for updating an asset. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the asset. | [optional] | +|**description** | **String** | The description of the asset. | [optional] | +|**type** | **AssetType** | | [optional] | + + + diff --git a/docs/AssetsMoveRequest.md b/docs/AssetsMoveRequest.md new file mode 100644 index 0000000..8fa6aa4 --- /dev/null +++ b/docs/AssetsMoveRequest.md @@ -0,0 +1,15 @@ + + +# AssetsMoveRequest + +Request to move assets to a target folder + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**assetsToAdd** | **List<String>** | An array of asset ids to move under a target folder | | +|**target** | **String** | The asset id or path | | + + + diff --git a/docs/AzureCredential.md b/docs/AzureCredential.md new file mode 100644 index 0000000..d2cf40d --- /dev/null +++ b/docs/AzureCredential.md @@ -0,0 +1,15 @@ + + +# AzureCredential + +Credential information to access Microsoft Azure. Each supported property is the snake_case version of its name in an Azure Storage connection string + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountName** | **String** | The name of the Azure account to access | [optional] | +|**accountKey** | **String** | The secret key. Never returned in responses. | [optional] | + + + diff --git a/docs/AzureToken.md b/docs/AzureToken.md new file mode 100644 index 0000000..24eea26 --- /dev/null +++ b/docs/AzureToken.md @@ -0,0 +1,15 @@ + + +# AzureToken + +Token information to access Azure services + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountName** | **String** | The account name of the configuration | | +|**sasToken** | **String** | The token to use for this account | | + + + diff --git a/docs/CapabilitiesApi.md b/docs/CapabilitiesApi.md new file mode 100644 index 0000000..403b383 --- /dev/null +++ b/docs/CapabilitiesApi.md @@ -0,0 +1,84 @@ +# CapabilitiesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**handleGetCapabilities**](CapabilitiesApi.md#handleGetCapabilities) | **GET** /capabilities | Get REST capabilities | + + + +# **handleGetCapabilities** +> RestCapabilities handleGetCapabilities() + +Get REST capabilities + +Get REST capabilities + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CapabilitiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CapabilitiesApi apiInstance = new CapabilitiesApi(defaultClient); + try { + RestCapabilities result = apiInstance.handleGetCapabilities(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CapabilitiesApi#handleGetCapabilities"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**RestCapabilities**](RestCapabilities.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Retrieved REST capabilities | - | +| **0** | error response | - | + diff --git a/docs/ChangePasswordRequest.md b/docs/ChangePasswordRequest.md new file mode 100644 index 0000000..548f6c3 --- /dev/null +++ b/docs/ChangePasswordRequest.md @@ -0,0 +1,15 @@ + + +# ChangePasswordRequest + +Object containing the necessary data to change a user's password + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**currentPassword** | **String** | The user's current password | | +|**newPassword** | **String** | The new password | | + + + diff --git a/docs/CloudProvider.md b/docs/CloudProvider.md new file mode 100644 index 0000000..90d70a3 --- /dev/null +++ b/docs/CloudProvider.md @@ -0,0 +1,15 @@ + + +# CloudProvider + +## Enum + + +* `AWS` (value: `"AWS"`) + +* `AZURE` (value: `"AZURE"`) + +* `GCP` (value: `"GCP"`) + + + diff --git a/docs/CommonPrefix.md b/docs/CommonPrefix.md new file mode 100644 index 0000000..59592ab --- /dev/null +++ b/docs/CommonPrefix.md @@ -0,0 +1,14 @@ + + +# CommonPrefix + +A folder returned by FileList + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prefix** | **String** | A prefix | [optional] | + + + diff --git a/docs/Credential.md b/docs/Credential.md new file mode 100644 index 0000000..6d967cc --- /dev/null +++ b/docs/Credential.md @@ -0,0 +1,16 @@ + + +# Credential + +The credential information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aws** | [**AWSCredential**](AWSCredential.md) | | [optional] | +|**azure** | [**AzureCredential**](AzureCredential.md) | | [optional] | +|**gcp** | [**GCPInteroperabilityCredential**](GCPInteroperabilityCredential.md) | | [optional] | + + + diff --git a/docs/CredentialCreateRequest.md b/docs/CredentialCreateRequest.md new file mode 100644 index 0000000..ac4a397 --- /dev/null +++ b/docs/CredentialCreateRequest.md @@ -0,0 +1,20 @@ + + +# CredentialCreateRequest + +object metadata for a credential that will be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | credential name | | +|**provider** | **CloudProvider** | | | +|**providerDefault** | **Boolean** | True if this is the namespace's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider | [optional] | +|**allowedInTasks** | **Boolean** | Is this credential allowed to be used in tasks | [optional] | +|**credential** | [**Credential**](Credential.md) | | [optional] | +|**role** | [**AccessCredentialRole**](AccessCredentialRole.md) | | [optional] | +|**token** | [**Token**](Token.md) | | [optional] | + + + diff --git a/docs/CredentialGetResponse.md b/docs/CredentialGetResponse.md new file mode 100644 index 0000000..078dfea --- /dev/null +++ b/docs/CredentialGetResponse.md @@ -0,0 +1,14 @@ + + +# CredentialGetResponse + +object for get credential response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**AccessCredential**](AccessCredential.md) | | | + + + diff --git a/docs/CredentialType.md b/docs/CredentialType.md new file mode 100644 index 0000000..cd5ac37 --- /dev/null +++ b/docs/CredentialType.md @@ -0,0 +1,13 @@ + + +# CredentialType + +## Enum + + +* `WORKSPACE` (value: `"workspace"`) + +* `TEAMSPACE` (value: `"teamspace"`) + + + diff --git a/docs/CredentialUpdateRequest.md b/docs/CredentialUpdateRequest.md new file mode 100644 index 0000000..9ff074e --- /dev/null +++ b/docs/CredentialUpdateRequest.md @@ -0,0 +1,20 @@ + + +# CredentialUpdateRequest + +The credential update object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | A user-specified name for the key | [optional] | +|**providerDefault** | **Boolean** | True if this is the user's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider | [optional] | +|**provider** | **CloudProvider** | | [optional] | +|**allowedInTasks** | **Boolean** | Is this credential allowed to be used in tasks | [optional] | +|**credential** | [**Credential**](Credential.md) | | [optional] | +|**role** | [**AccessCredentialRole**](AccessCredentialRole.md) | | [optional] | +|**token** | [**Token**](Token.md) | | [optional] | + + + diff --git a/docs/CredentialsApi.md b/docs/CredentialsApi.md new file mode 100644 index 0000000..1bf1ca1 --- /dev/null +++ b/docs/CredentialsApi.md @@ -0,0 +1,514 @@ +# CredentialsApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createCredential**](CredentialsApi.md#createCredential) | **POST** /credentials/{workspace} | Create a credential | +| [**deleteCredentialByName**](CredentialsApi.md#deleteCredentialByName) | **DELETE** /credentials/{workspace}/{name} | Delete user credential | +| [**getCredentialByName**](CredentialsApi.md#getCredentialByName) | **GET** /credentials/{workspace}/{name} | Get user credential | +| [**getCredentials**](CredentialsApi.md#getCredentials) | **GET** /credentials/{workspace} | Get user credentials | +| [**patchCredentialByName**](CredentialsApi.md#patchCredentialByName) | **PATCH** /credentials/{workspace}/{name} | Update user credential | +| [**verifyCredential**](CredentialsApi.md#verifyCredential) | **POST** /actions/credentials/verify | Verify a given credential | + + + +# **createCredential** +> createCredential(workspace, credentialCreateRequest, teamspaceId) + +Create a credential + +create a new credential, the user will create a new credential to access assets + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + CredentialCreateRequest credentialCreateRequest = new CredentialCreateRequest(); // CredentialCreateRequest | the new credentials to be created + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + apiInstance.createCredential(workspace, credentialCreateRequest, teamspaceId); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#createCredential"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **credentialCreateRequest** | [**CredentialCreateRequest**](CredentialCreateRequest.md)| the new credentials to be created | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | The new credential was successfully added | - | +| **0** | error response | - | + + +# **deleteCredentialByName** +> deleteCredentialByName(workspace, name, teamspaceId) + +Delete user credential + +Delete the named access credential. Any arrays still set to use this credential will use the user's default and may become unreachable + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String name = "name_example"; // String | The name of the credentials to run CRUD operations against + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + apiInstance.deleteCredentialByName(workspace, name, teamspaceId); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#deleteCredentialByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **name** | **String**| The name of the credentials to run CRUD operations against | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | user credential deleted | - | +| **404** | credential does not exist | - | +| **0** | error response | - | + + +# **getCredentialByName** +> CredentialGetResponse getCredentialByName(workspace, name, teamspaceId) + +Get user credential + +get information about user credential by name + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String name = "name_example"; // String | The name of the credentials to run CRUD operations against + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + CredentialGetResponse result = apiInstance.getCredentialByName(workspace, name, teamspaceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#getCredentialByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **name** | **String**| The name of the credentials to run CRUD operations against | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +[**CredentialGetResponse**](CredentialGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful credential response | - | +| **404** | Credential does not exist | - | +| **0** | error response | - | + + +# **getCredentials** +> CredentialsListResponse getCredentials(workspace, teamspaceId, provider, type, page, perPage) + +Get user credentials + +list the credentials available for the user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + CloudProvider provider = CloudProvider.fromValue("AWS"); // CloudProvider | Show only the credentials from this provider. This should be one of the CloudProvider enum values. + String type = "type_example"; // String | Show only the credentials of this type. This should be one of the AccessCredentialType enum values. + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + CredentialsListResponse result = apiInstance.getCredentials(workspace, teamspaceId, provider, type, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#getCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | +| **provider** | [**CloudProvider**](.md)| Show only the credentials from this provider. This should be one of the CloudProvider enum values. | [optional] [enum: AWS, AZURE, GCP] | +| **type** | **String**| Show only the credentials of this type. This should be one of the AccessCredentialType enum values. | [optional] | +| **page** | **Integer**| pagination offset | [optional] | +| **perPage** | **Integer**| pagination limit | [optional] | + +### Return type + +[**CredentialsListResponse**](CredentialsListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful credentials list response | - | +| **0** | error response | - | + + +# **patchCredentialByName** +> patchCredentialByName(workspace, name, credentialUpdateRequest, teamspaceId) + +Update user credential + +update user credential given by the user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String name = "name_example"; // String | The name of the credentials to run CRUD operations against + CredentialUpdateRequest credentialUpdateRequest = new CredentialUpdateRequest(); // CredentialUpdateRequest | credential update details + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + apiInstance.patchCredentialByName(workspace, name, credentialUpdateRequest, teamspaceId); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#patchCredentialByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **name** | **String**| The name of the credentials to run CRUD operations against | | +| **credentialUpdateRequest** | [**CredentialUpdateRequest**](CredentialUpdateRequest.md)| credential update details | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The credential was updated successfully | - | +| **0** | error response | - | + + +# **verifyCredential** +> verifyCredential(credentialsVerifyRequest) + +Verify a given credential + +verify the credentials connection for a namespace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.CredentialsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + CredentialsApi apiInstance = new CredentialsApi(defaultClient); + CredentialsVerifyRequest credentialsVerifyRequest = new CredentialsVerifyRequest(); // CredentialsVerifyRequest | credential to verify + try { + apiInstance.verifyCredential(credentialsVerifyRequest); + } catch (ApiException e) { + System.err.println("Exception when calling CredentialsApi#verifyCredential"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **credentialsVerifyRequest** | [**CredentialsVerifyRequest**](CredentialsVerifyRequest.md)| credential to verify | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful connection | - | +| **0** | error response | - | + diff --git a/docs/CredentialsListResponse.md b/docs/CredentialsListResponse.md new file mode 100644 index 0000000..98afb50 --- /dev/null +++ b/docs/CredentialsListResponse.md @@ -0,0 +1,15 @@ + + +# CredentialsListResponse + +object for get credentials list response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<AccessCredential>**](AccessCredential.md) | List of credentials items | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | [optional] | + + + diff --git a/docs/CredentialsVerifyRequest.md b/docs/CredentialsVerifyRequest.md new file mode 100644 index 0000000..22bf125 --- /dev/null +++ b/docs/CredentialsVerifyRequest.md @@ -0,0 +1,22 @@ + + +# CredentialsVerifyRequest + +object metadata for a credential that will be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | credential name | | +|**provider** | **CloudProvider** | | | +|**providerDefault** | **Boolean** | True if this is the namespace's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider | [optional] | +|**allowedInTasks** | **Boolean** | Is this credential allowed to be used in tasks | [optional] | +|**credential** | [**Credential**](Credential.md) | | [optional] | +|**role** | [**AccessCredentialRole**](AccessCredentialRole.md) | | [optional] | +|**token** | [**Token**](Token.md) | | [optional] | +|**workspaceId** | **String** | The workspace's ID. If provided, the given role will be verified in a daisy chain fashion, starting with the role ARN associated with the given workspace. | [optional] | +|**teamspaceId** | **String** | The teamspace's ID. If provided, the given role will be verified in a daisy chain fashion, starting with the role ARN associated with the given teamspace. | [optional] | + + + diff --git a/docs/DataChangeFile.md b/docs/DataChangeFile.md new file mode 100644 index 0000000..8a78243 --- /dev/null +++ b/docs/DataChangeFile.md @@ -0,0 +1,20 @@ + + +# DataChangeFile + +Delta share table change file object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | | +|**version** | **Integer** | The table version of this file. | | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/DataChangeFileAdd.md b/docs/DataChangeFileAdd.md new file mode 100644 index 0000000..5be4e22 --- /dev/null +++ b/docs/DataChangeFileAdd.md @@ -0,0 +1,21 @@ + + +# DataChangeFileAdd + +Delta share table change file object for additions + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | | +|**version** | **Integer** | The table version of this file. | | +|**stats** | **String** | Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. | [optional] | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/DataChangeFileRemove.md b/docs/DataChangeFileRemove.md new file mode 100644 index 0000000..c795cf0 --- /dev/null +++ b/docs/DataChangeFileRemove.md @@ -0,0 +1,20 @@ + + +# DataChangeFileRemove + +Delta share table change file object for removals + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | | +|**version** | **Integer** | The table version of this file. | | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/DeltasharingApi.md b/docs/DeltasharingApi.md new file mode 100644 index 0000000..979935a --- /dev/null +++ b/docs/DeltasharingApi.md @@ -0,0 +1,817 @@ +# DeltasharingApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getShare**](DeltasharingApi.md#getShare) | **GET** /deltasharing/shares/{workspace} | get a delta share | +| [**listShareAllTables**](DeltasharingApi.md#listShareAllTables) | **GET** /deltasharing/shares/{workspace}/all-tables | list delta share schema tables | +| [**listShareSchemaTables**](DeltasharingApi.md#listShareSchemaTables) | **GET** /deltasharing/shares/{workspace}/schemas/{teamspace}/tables | list delta share schema tables | +| [**listShareSchemas**](DeltasharingApi.md#listShareSchemas) | **GET** /deltasharing/shares/{workspace}/schemas | list delta share schemas | +| [**listShares**](DeltasharingApi.md#listShares) | **GET** /deltasharing/shares | list delta shares | +| [**queryTable**](DeltasharingApi.md#queryTable) | **POST** /deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/query | query table | +| [**queryTableChanges**](DeltasharingApi.md#queryTableChanges) | **GET** /deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/changes | query table changes | +| [**queryTableMetadata**](DeltasharingApi.md#queryTableMetadata) | **GET** /deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/metadata | fetch table metadata | +| [**queryTableVerison**](DeltasharingApi.md#queryTableVerison) | **GET** /deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/version | fetch table version | + + + +# **getShare** +> ShareResponse getShare(workspace) + +get a delta share + +This is the API to get the metadata of a share. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + try { + ShareResponse result = apiInstance.getShare(workspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#getShare"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | + +### Return type + +[**ShareResponse**](ShareResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched share details | - | +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **listShareAllTables** +> ListTablesResponse listShareAllTables(workspace, maxResults, pageToken) + +list delta share schema tables + +This is the API to list tables in a schema. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + Integer maxResults = 56; // Integer | The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. + String pageToken = "pageToken_example"; // String | Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. + try { + ListTablesResponse result = apiInstance.listShareAllTables(workspace, maxResults, pageToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#listShareAllTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **maxResults** | **Integer**| The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. | [optional] | +| **pageToken** | **String**| Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. | [optional] | + +### Return type + +[**ListTablesResponse**](ListTablesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched listing of share schema tables | - | +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **listShareSchemaTables** +> ListShareSchemaTablesResponse listShareSchemaTables(workspace, teamspace, maxResults, pageToken) + +list delta share schema tables + +This is the API to list tables in a schema. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + Integer maxResults = 56; // Integer | The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. + String pageToken = "pageToken_example"; // String | Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. + try { + ListShareSchemaTablesResponse result = apiInstance.listShareSchemaTables(workspace, teamspace, maxResults, pageToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#listShareSchemaTables"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **maxResults** | **Integer**| The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. | [optional] | +| **pageToken** | **String**| Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. | [optional] | + +### Return type + +[**ListShareSchemaTablesResponse**](ListShareSchemaTablesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched listing of share schema tables | - | +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **listShareSchemas** +> ListShareSchemasResponse listShareSchemas(workspace, maxResults, pageToken) + +list delta share schemas + +This is the API to list schemas in a share. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + Integer maxResults = 56; // Integer | The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. + String pageToken = "pageToken_example"; // String | Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. + try { + ListShareSchemasResponse result = apiInstance.listShareSchemas(workspace, maxResults, pageToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#listShareSchemas"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **maxResults** | **Integer**| The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. | [optional] | +| **pageToken** | **String**| Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. | [optional] | + +### Return type + +[**ListShareSchemasResponse**](ListShareSchemasResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched listing of share schemas | - | +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **listShares** +> ListSharesResponse listShares(maxResults, pageToken) + +list delta shares + +This is the API to list shares accessible to a recipient. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + Integer maxResults = 56; // Integer | The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. + String pageToken = "pageToken_example"; // String | Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. + try { + ListSharesResponse result = apiInstance.listShares(maxResults, pageToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#listShares"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **maxResults** | **Integer**| The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. | [optional] | +| **pageToken** | **String**| Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. | [optional] | + +### Return type + +[**ListSharesResponse**](ListSharesResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched listing of shares | - | +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **queryTable** +> QueryTableResponse queryTable(workspace, teamspace, asset, queryTableRequest) + +query table + +This is the API for clients to read data from a table. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String asset = "ast_9m4e2mr0ui3e8a215n4g or /a/b/c"; // String | The asset id or path for which to retrieve assets + QueryTableRequest queryTableRequest = new QueryTableRequest(); // QueryTableRequest | query table request + try { + QueryTableResponse result = apiInstance.queryTable(workspace, teamspace, asset, queryTableRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#queryTable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **asset** | **String**| The asset id or path for which to retrieve assets | | +| **queryTableRequest** | [**QueryTableRequest**](QueryTableRequest.md)| query table request | | + +### Return type + +[**QueryTableResponse**](QueryTableResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/x-ndjson, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully queried table | * Delta-Table-Version - version of table
| +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **queryTableChanges** +> QueryTableChangeResponse queryTableChanges(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata) + +query table changes + +This is the API for clients to read change data feed from a table. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String asset = "ast_9m4e2mr0ui3e8a215n4g or /a/b/c"; // String | The asset id or path for which to retrieve assets + Long startingVersion = 56L; // Long | The starting version of the query, inclusive + String startingTimestamp = "startingTimestamp_example"; // String | The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. + Long endingVersion = 56L; // Long | The ending version of the query, inclusive + String endingTimestamp = "endingTimestamp_example"; // String | The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. + Boolean includeHistoricalMetadata = false; // Boolean | If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. + try { + QueryTableChangeResponse result = apiInstance.queryTableChanges(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#queryTableChanges"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **asset** | **String**| The asset id or path for which to retrieve assets | | +| **startingVersion** | **Long**| The starting version of the query, inclusive | [optional] | +| **startingTimestamp** | **String**| The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. | [optional] | +| **endingVersion** | **Long**| The ending version of the query, inclusive | [optional] | +| **endingTimestamp** | **String**| The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. | [optional] | +| **includeHistoricalMetadata** | **Boolean**| If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. | [optional] [default to false] | + +### Return type + +[**QueryTableChangeResponse**](QueryTableChangeResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-ndjson, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully queried table changes | * Delta-Table-Version - version of table
| +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **queryTableMetadata** +> TableMetadataResponse queryTableMetadata(workspace, teamspace, asset) + +fetch table metadata + +This is the API for clients to query the table schema and other metadata. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String asset = "ast_9m4e2mr0ui3e8a215n4g or /a/b/c"; // String | The asset id or path for which to retrieve assets + try { + TableMetadataResponse result = apiInstance.queryTableMetadata(workspace, teamspace, asset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#queryTableMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **asset** | **String**| The asset id or path for which to retrieve assets | | + +### Return type + +[**TableMetadataResponse**](TableMetadataResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-ndjson, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched table metadata | * Delta-Table-Version - version of table
| +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + + +# **queryTableVerison** +> queryTableVerison(workspace, teamspace, asset, startingTimestamp) + +fetch table version + +This is the API for clients to get a table version without any other extra information + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.DeltasharingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + DeltasharingApi apiInstance = new DeltasharingApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String asset = "ast_9m4e2mr0ui3e8a215n4g or /a/b/c"; // String | The asset id or path for which to retrieve assets + String startingTimestamp = "startingTimestamp_example"; // String | The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. + try { + apiInstance.queryTableVerison(workspace, teamspace, asset, startingTimestamp); + } catch (ApiException e) { + System.err.println("Exception when calling DeltasharingApi#queryTableVerison"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **asset** | **String**| The asset id or path for which to retrieve assets | | +| **startingTimestamp** | **String**| The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully fetched table version | * Delta-Table-Version - version of table
| +| **400** | The request is malformed. | - | +| **401** | The request is unauthenticated. The bearer token is missing or incorrect. | - | +| **403** | The request is forbidden from being fulfilled. | - | +| **404** | The requested resource does not exist. | - | +| **500** | The request is not handled correctly due to a server error. | - | +| **0** | error response | - | + diff --git a/docs/Error.md b/docs/Error.md index d3b0239..87a4f7b 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -2,14 +2,16 @@ # Error +Object containing data about a handled error by REST server ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**code** | **Long** | | [optional] | -|**message** | **String** | | [optional] | -|**requestId** | **String** | | [optional] | +|**code** | **Integer** | A hardcoded integer which points to a specific file/line of the code that returned the error | | +|**message** | **String** | A friendly message to be shown to the client | | +|**requestId** | **String** | The request id to be used for tracing/debugging | | +|**validationError** | [**ValidationError**](ValidationError.md) | | [optional] | diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 0000000..91b6f5b --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,15 @@ + + +# ErrorResponse + +Object containing data about a handled error by REST server in delta format + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**errorCode** | **Integer** | A hardcoded integer which points to a specific file/line of the code that returned the error | | +|**message** | **String** | A friendly message to be shown to the client | | + + + diff --git a/docs/ErrorXML.md b/docs/ErrorXML.md new file mode 100644 index 0000000..c4ef37f --- /dev/null +++ b/docs/ErrorXML.md @@ -0,0 +1,16 @@ + + +# ErrorXML + +Object containing data about a handled error by REST server, presented in a format compatible with S3 + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | A machine-friendly string that describes the error | | +|**message** | **String** | A friendly message to be shown to the client | | +|**requestId** | **String** | The request id to be used for tracing/debugging | | + + + diff --git a/docs/FileInfo.md b/docs/FileInfo.md new file mode 100644 index 0000000..ffe3d26 --- /dev/null +++ b/docs/FileInfo.md @@ -0,0 +1,13 @@ + + +# FileInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**size** | **Long** | Size of the file in bytes. | | + + + diff --git a/docs/FileListResponse.md b/docs/FileListResponse.md new file mode 100644 index 0000000..d631e22 --- /dev/null +++ b/docs/FileListResponse.md @@ -0,0 +1,22 @@ + + +# FileListResponse + +The result of a list files operation. Compatible with S3's ListObjectResult + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the bucket (teamspace) with the objects | [optional] | +|**prefix** | **String** | The prefix under which objects are listed | [optional] | +|**delimiter** | **String** | The string that delimits the path segments. Only forward slash is supported | [optional] | +|**maxKeys** | **Integer** | The maximum amount of objects to return | [optional] | +|**continuationToken** | **String** | The continuation token that was passed to the operation | [optional] | +|**nextContinuationToken** | **String** | The continuation token to pass to list the next items | [optional] | +|**isTruncated** | **Boolean** | Whether there are no more files to list | [optional] | +|**commonPrefixes** | [**List<CommonPrefix>**](CommonPrefix.md) | The common prefixes (folders) contained under prefix. | [optional] | +|**objects** | [**List<ModelObject>**](ModelObject.md) | The objects (files) contained under prefix. | [optional] | + + + diff --git a/docs/Folder.md b/docs/Folder.md new file mode 100644 index 0000000..9470fb3 --- /dev/null +++ b/docs/Folder.md @@ -0,0 +1,23 @@ + + +# Folder + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The folder's ID | | +|**workspaceId** | **String** | The workspace's ID | | +|**teamspaceId** | **String** | The teamspace's ID | | +|**groupId** | **String** | The group's ID | [optional] | +|**assetId** | **String** | The asset's ID | | +|**parentFolderId** | **String** | The folder's ID | [optional] | +|**name** | **String** | The name of the folder. | | +|**createdAt** | **OffsetDateTime** | Datetime asset was created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime asset was updated in UTC | [optional] | +|**createdBy** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**description** | **String** | The description of the folder. | [optional] | + + + diff --git a/docs/FolderContentsResponse.md b/docs/FolderContentsResponse.md new file mode 100644 index 0000000..7ad34b8 --- /dev/null +++ b/docs/FolderContentsResponse.md @@ -0,0 +1,15 @@ + + +# FolderContentsResponse + +The response object when requesting the list of folder contents + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<Asset>**](Asset.md) | An array of assets | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | | + + + diff --git a/docs/FolderCreateRequestInner.md b/docs/FolderCreateRequestInner.md new file mode 100644 index 0000000..3be8219 --- /dev/null +++ b/docs/FolderCreateRequestInner.md @@ -0,0 +1,14 @@ + + +# FolderCreateRequestInner + +object metadata for folders that will be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**description** | **String** | Folder description | [optional] | + + + diff --git a/docs/FolderCreateResponse.md b/docs/FolderCreateResponse.md new file mode 100644 index 0000000..74e6d0e --- /dev/null +++ b/docs/FolderCreateResponse.md @@ -0,0 +1,14 @@ + + +# FolderCreateResponse + +object for create folder response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Folder**](Folder.md) | | | + + + diff --git a/docs/FolderGetResponse.md b/docs/FolderGetResponse.md new file mode 100644 index 0000000..cd96a46 --- /dev/null +++ b/docs/FolderGetResponse.md @@ -0,0 +1,14 @@ + + +# FolderGetResponse + +The response object when requesting a single folder + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Folder**](Folder.md) | | | + + + diff --git a/docs/FolderInfo.md b/docs/FolderInfo.md new file mode 100644 index 0000000..1702726 --- /dev/null +++ b/docs/FolderInfo.md @@ -0,0 +1,13 @@ + + +# FolderInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**length** | **Long** | Number of items in the folder. | | + + + diff --git a/docs/FolderUpdateRequest.md b/docs/FolderUpdateRequest.md new file mode 100644 index 0000000..d7fd5d5 --- /dev/null +++ b/docs/FolderUpdateRequest.md @@ -0,0 +1,15 @@ + + +# FolderUpdateRequest + +The request object for updating a folder + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The teamspace name | [optional] | +|**description** | **String** | The folder description | [optional] | + + + diff --git a/docs/FoldersApi.md b/docs/FoldersApi.md new file mode 100644 index 0000000..79489b4 --- /dev/null +++ b/docs/FoldersApi.md @@ -0,0 +1,519 @@ +# FoldersApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createFolder**](FoldersApi.md#createFolder) | **POST** /folders/{workspace}/{teamspace}/{folder} | Create a folder in the given teamspace | +| [**deleteFolder**](FoldersApi.md#deleteFolder) | **DELETE** /folders/{workspace}/{teamspace}/{folder} | Delete a folder | +| [**getFolder**](FoldersApi.md#getFolder) | **GET** /folders/{workspace}/{teamspace}/{folder} | Retrieve a folder's content | +| [**getFolderContents**](FoldersApi.md#getFolderContents) | **GET** /folders/{workspace}/{teamspace}/{folder}/contents | Retrieve a folder | +| [**modifyFolderContents**](FoldersApi.md#modifyFolderContents) | **PUT** /folders/{workspace}/{teamspace}/{folder}/contents | Add or remove assets under a folder | +| [**updateFolder**](FoldersApi.md#updateFolder) | **PATCH** /folders/{workspace}/{teamspace}/{folder} | Update the given folder | + + + +# **createFolder** +> FolderCreateResponse createFolder(workspace, teamspace, folder, folderCreateRequestInner) + +Create a folder in the given teamspace + +Create a new folder in the given teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + FolderCreateRequestInner folderCreateRequestInner = new FolderCreateRequestInner(); // FolderCreateRequestInner | folder to create + try { + FolderCreateResponse result = apiInstance.createFolder(workspace, teamspace, folder, folderCreateRequestInner); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#createFolder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | +| **folderCreateRequestInner** | [**FolderCreateRequestInner**](FolderCreateRequestInner.md)| folder to create | | + +### Return type + +[**FolderCreateResponse**](FolderCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Successful folder response | - | +| **0** | error response | - | + + +# **deleteFolder** +> deleteFolder(workspace, teamspace, folder, deleteAssets) + +Delete a folder + +delete a folder + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + Boolean deleteAssets = false; // Boolean | If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. + try { + apiInstance.deleteFolder(workspace, teamspace, folder, deleteAssets); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#deleteFolder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | +| **deleteAssets** | **Boolean**| If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. | [optional] [default to false] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | folder deleted | - | +| **0** | error response | - | + + +# **getFolder** +> FolderGetResponse getFolder(workspace, teamspace, folder) + +Retrieve a folder's content + +Retrieve the given folder's content + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + try { + FolderGetResponse result = apiInstance.getFolder(workspace, teamspace, folder); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#getFolder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | + +### Return type + +[**FolderGetResponse**](FolderGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Folder retrieved | - | +| **404** | Folder does not exist | - | +| **0** | An error occurred | - | + + +# **getFolderContents** +> FolderContentsResponse getFolderContents(workspace, teamspace, folder) + +Retrieve a folder + +Retrieve the given folder + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + try { + FolderContentsResponse result = apiInstance.getFolderContents(workspace, teamspace, folder); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#getFolderContents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | + +### Return type + +[**FolderContentsResponse**](FolderContentsResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Folder contents retrieved | - | +| **404** | Folder does not exist | - | +| **0** | An error occurred | - | + + +# **modifyFolderContents** +> modifyFolderContents(workspace, teamspace, folder, foldersContentsModifyInner) + +Add or remove assets under a folder + +Add or remove assets under a folder + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + FoldersContentsModifyInner foldersContentsModifyInner = new FoldersContentsModifyInner(); // FoldersContentsModifyInner | assets to add or remove + try { + apiInstance.modifyFolderContents(workspace, teamspace, folder, foldersContentsModifyInner); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#modifyFolderContents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | +| **foldersContentsModifyInner** | [**FoldersContentsModifyInner**](FoldersContentsModifyInner.md)| assets to add or remove | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Folder contents modified successfully | - | +| **0** | error response | - | + + +# **updateFolder** +> updateFolder(workspace, teamspace, folder, folderUpdateRequest) + +Update the given folder + +Update a folder + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.FoldersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + FoldersApi apiInstance = new FoldersApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String folder = "folder_example"; // String | The path to the folder or the folder's assetID + FolderUpdateRequest folderUpdateRequest = new FolderUpdateRequest(); // FolderUpdateRequest | The request body containing the folder to update + try { + apiInstance.updateFolder(workspace, teamspace, folder, folderUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FoldersApi#updateFolder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **folder** | **String**| The path to the folder or the folder's assetID | | +| **folderUpdateRequest** | [**FolderUpdateRequest**](FolderUpdateRequest.md)| The request body containing the folder to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Folder updated | - | +| **0** | An error occurred | - | + diff --git a/docs/FoldersContentsModifyInner.md b/docs/FoldersContentsModifyInner.md new file mode 100644 index 0000000..631450a --- /dev/null +++ b/docs/FoldersContentsModifyInner.md @@ -0,0 +1,15 @@ + + +# FoldersContentsModifyInner + +The request object to add or remove contents under a folder + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**membersToAdd** | **List<String>** | An array of asset ids to add under a folder | | +|**membersToRemove** | **List<String>** | An array of asset ids to remove from a folder | | + + + diff --git a/docs/Format.md b/docs/Format.md new file mode 100644 index 0000000..7e962e2 --- /dev/null +++ b/docs/Format.md @@ -0,0 +1,14 @@ + + +# Format + +Delta share table metadata object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**provider** | **String** | Name of the encoding for data files in this table. Currently the only valid value is parquet. This is to enable possible support for other formats in the future. | | + + + diff --git a/docs/GCPInteroperabilityCredential.md b/docs/GCPInteroperabilityCredential.md new file mode 100644 index 0000000..c21fca2 --- /dev/null +++ b/docs/GCPInteroperabilityCredential.md @@ -0,0 +1,15 @@ + + +# GCPInteroperabilityCredential + +Credential information to access Google Cloud. using well knows key/secret pair to access storage. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accessKeyId** | **String** | The ID of the access key | [optional] | +|**secretAccessKey** | **String** | The access key's secret. Never returned in responses. | [optional] | + + + diff --git a/docs/GCPServiceAccountKey.md b/docs/GCPServiceAccountKey.md new file mode 100644 index 0000000..374a952 --- /dev/null +++ b/docs/GCPServiceAccountKey.md @@ -0,0 +1,16 @@ + + +# GCPServiceAccountKey + +The key to a Google Cloud Platform service account. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountId** | **String** | The ID of the service account (i.e., its email address). This is ignored when uploading key information, and is only provided by the server when downloading metadata about an existing key. | | +|**keyId** | **String** | The ID of the particular key. This identifies it among other keys issued for this service account. This is ignored when uploading key information, and is only provided by the server when downloading metadata about an existing key. | | +|**keyText** | **String** | The full file provided by Google Cloud. This is usually in the form of a JSON document, but TileDB Cloud treats it as opaque (except to attempt to extract the service account ID and the key ID). | | + + + diff --git a/docs/Generalspace.md b/docs/Generalspace.md new file mode 100644 index 0000000..502dd6a --- /dev/null +++ b/docs/Generalspace.md @@ -0,0 +1,19 @@ + + +# Generalspace + +The generalspace object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**generalspaceId** | **String** | The generalspace's ID | | +|**name** | **String** | The generalspace name | | +|**icon** | **String** | The generalspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**createdAt** | **OffsetDateTime** | The datetime the generalspace was created (in UTC) | | +|**description** | **String** | The generalspace description | [optional] | +|**updatedAt** | **OffsetDateTime** | The datetime the generalspace was updated (in UTC) | [optional] | + + + diff --git a/docs/GeneralspaceGetResponse.md b/docs/GeneralspaceGetResponse.md new file mode 100644 index 0000000..3f778a6 --- /dev/null +++ b/docs/GeneralspaceGetResponse.md @@ -0,0 +1,14 @@ + + +# GeneralspaceGetResponse + +The response object when requesting a generalspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Generalspace**](Generalspace.md) | | | + + + diff --git a/docs/GeneralspaceUpdateRequest.md b/docs/GeneralspaceUpdateRequest.md new file mode 100644 index 0000000..f49b98a --- /dev/null +++ b/docs/GeneralspaceUpdateRequest.md @@ -0,0 +1,17 @@ + + +# GeneralspaceUpdateRequest + +The request object for updating a generalspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The generalspace name | [optional] | +|**description** | **String** | The generalspace description | [optional] | +|**icon** | **String** | The generalspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**visibilityLevel** | **TeamspaceVisibility** | | [optional] | + + + diff --git a/docs/GeneralspacesApi.md b/docs/GeneralspacesApi.md new file mode 100644 index 0000000..c742451 --- /dev/null +++ b/docs/GeneralspacesApi.md @@ -0,0 +1,336 @@ +# GeneralspacesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getGeneralSpace**](GeneralspacesApi.md#getGeneralSpace) | **GET** /generalspaces/{workspace}/{generalspace} | Retrieve a generalspace | +| [**getGeneralspaceByWorkspace**](GeneralspacesApi.md#getGeneralspaceByWorkspace) | **GET** /generalspaces/{workspace} | Retrieve a generalspace | +| [**updateGeneralspaceByID**](GeneralspacesApi.md#updateGeneralspaceByID) | **PATCH** /generalspaces/{workspace}/{generalspace} | Update the given generalspace | +| [**updateGeneralspaceByWorkspace**](GeneralspacesApi.md#updateGeneralspaceByWorkspace) | **PATCH** /generalspaces/{workspace} | Update the given generalspace | + + + +# **getGeneralSpace** +> GeneralspaceGetResponse getGeneralSpace(workspace, generalspace) + +Retrieve a generalspace + +Retrieve the given general space + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.GeneralspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + GeneralspacesApi apiInstance = new GeneralspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String generalspace = "ts_9m4e2mr0ui3e8a215n4g or general"; // String | The generalspace id or name + try { + GeneralspaceGetResponse result = apiInstance.getGeneralSpace(workspace, generalspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GeneralspacesApi#getGeneralSpace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **generalspace** | **String**| The generalspace id or name | | + +### Return type + +[**GeneralspaceGetResponse**](GeneralspaceGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Generalspace retrieved | - | +| **404** | Generalspace does not exist | - | +| **0** | An error occurred | - | + + +# **getGeneralspaceByWorkspace** +> GeneralspaceGetResponse getGeneralspaceByWorkspace(workspace) + +Retrieve a generalspace + +Retrieve the given general space + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.GeneralspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + GeneralspacesApi apiInstance = new GeneralspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + try { + GeneralspaceGetResponse result = apiInstance.getGeneralspaceByWorkspace(workspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GeneralspacesApi#getGeneralspaceByWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | + +### Return type + +[**GeneralspaceGetResponse**](GeneralspaceGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Generalspace retrieved | - | +| **404** | Generalspace does not exist | - | +| **0** | An error occurred | - | + + +# **updateGeneralspaceByID** +> updateGeneralspaceByID(workspace, generalspace, generalspaceUpdateRequest) + +Update the given generalspace + +Update a generalspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.GeneralspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + GeneralspacesApi apiInstance = new GeneralspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String generalspace = "ts_9m4e2mr0ui3e8a215n4g or general"; // String | The generalspace id or name + GeneralspaceUpdateRequest generalspaceUpdateRequest = new GeneralspaceUpdateRequest(); // GeneralspaceUpdateRequest | The request body containing the generalspace to update + try { + apiInstance.updateGeneralspaceByID(workspace, generalspace, generalspaceUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling GeneralspacesApi#updateGeneralspaceByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **generalspace** | **String**| The generalspace id or name | | +| **generalspaceUpdateRequest** | [**GeneralspaceUpdateRequest**](GeneralspaceUpdateRequest.md)| The request body containing the generalspace to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Generalspace updated | - | +| **0** | An error occurred | - | + + +# **updateGeneralspaceByWorkspace** +> updateGeneralspaceByWorkspace(workspace, generalspaceUpdateRequest) + +Update the given generalspace + +Update a generalspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.GeneralspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + GeneralspacesApi apiInstance = new GeneralspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + GeneralspaceUpdateRequest generalspaceUpdateRequest = new GeneralspaceUpdateRequest(); // GeneralspaceUpdateRequest | The request body containing the generalspace to update + try { + apiInstance.updateGeneralspaceByWorkspace(workspace, generalspaceUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling GeneralspacesApi#updateGeneralspaceByWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **generalspaceUpdateRequest** | [**GeneralspaceUpdateRequest**](GeneralspaceUpdateRequest.md)| The request body containing the generalspace to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Generalspace updated | - | +| **0** | An error occurred | - | + diff --git a/docs/GroupInfo.md b/docs/GroupInfo.md index 831a1dc..5a135e6 100644 --- a/docs/GroupInfo.md +++ b/docs/GroupInfo.md @@ -2,34 +2,12 @@ # GroupInfo -metadata of a group ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | unique ID of registered group | [optional] | -|**namespace** | **String** | namespace group is in | [optional] | -|**name** | **String** | name of group | [optional] | -|**description** | **String** | description of group | [optional] | -|**uri** | **String** | uri of group | [optional] | -|**tiledbUri** | **String** | uri for access through TileDB cloud | [optional] | -|**assetCount** | **BigDecimal** | A count of direct array members | [optional] | -|**groupCount** | **BigDecimal** | A count of direct group members | [optional] | -|**size** | **BigDecimal** | A count of direct members. This is the sum of asset_count and group_count | [optional] | -|**lastAccessed** | **OffsetDateTime** | Datetime groups was last accessed in UTC | [optional] | -|**allowedActions** | **List<GroupActions>** | list of actions user is allowed to do on this group | [optional] | -|**groupType** | **GroupType** | | [optional] | -|**logo** | **String** | logo (base64 encoded) for the gruop. Optional | [optional] | -|**accessCredentialsName** | **String** | the name of the access credentials to use. if unset, the default credentials will be used | [optional] | -|**shareCount** | **BigDecimal** | number of unique namespaces this group is shared with | [optional] | -|**publicShare** | **Boolean** | Suggests if the group was shared to public by owner | [optional] | -|**tags** | **List<String>** | optional tags for group | [optional] | -|**licenseId** | **String** | License identifier from SPDX License List or Custom | [optional] | -|**licenseText** | **String** | License text | [optional] | -|**createdAt** | **OffsetDateTime** | Datetime the group was registered with tiledb | [optional] | -|**createdBy** | **String** | The username of the group's creator, if known. | [optional] | -|**metadata** | [**List<MetadataStringifiedEntry>**](MetadataStringifiedEntry.md) | Contains metadata of the group. **Note:** This property is included in the response only if the `with_metadata` query parameter is set to `true`. | [optional] | +|**length** | **Long** | Number of items in the group. | | diff --git a/docs/ImagesApi.md b/docs/ImagesApi.md new file mode 100644 index 0000000..a1dc171 --- /dev/null +++ b/docs/ImagesApi.md @@ -0,0 +1,89 @@ +# ImagesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getImage**](ImagesApi.md#getImage) | **GET** /static/images/{image_id} | Retrieves the given image | + + + +# **getImage** +> File getImage(imageId) + +Retrieves the given image + +End point to get the given workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.ImagesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + ImagesApi apiInstance = new ImagesApi(defaultClient); + String imageId = "imageId_example"; // String | The image id in the form img_9m4e2mr0ui3e8a215n4g + try { + File result = apiInstance.getImage(imageId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ImagesApi#getImage"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **imageId** | **String**| The image id in the form img_9m4e2mr0ui3e8a215n4g | | + +### Return type + +[**File**](File.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/png, image/jpeg, image/gif, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful image response | - | +| **404** | Image does not exist | - | +| **0** | error response | - | + diff --git a/docs/Invitation.md b/docs/Invitation.md index 360a19c..696a021 100644 --- a/docs/Invitation.md +++ b/docs/Invitation.md @@ -2,32 +2,17 @@ # Invitation -Invitations to share or collaborate +The invitation object ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | Unique ID of invitation added to magic link | [optional] | -|**invitationType** | **InvitationType** | | [optional] | -|**ownerNamespaceUuid** | **String** | Namespace of the owner of the invitation (user or organization) | [optional] | -|**inviterUuid** | **String** | Unique ID of the user that sent the invitation | [optional] | -|**userNamespaceUuid** | **String** | Unique ID of the user accepted the invitation | [optional] | -|**organizationUserUuid** | **String** | Unique ID of the organization user accepted the invitation | [optional] | -|**organizationName** | **String** | Name of the organization, does not persist in database | [optional] | -|**organizationRole** | **OrganizationRoles** | | [optional] | -|**organizationUuid** | **String** | Unique ID of the organization whose user(s) accepted the invitation | [optional] | -|**arrayUuid** | **String** | Unique ID of the array | [optional] | -|**groupUuid** | **String** | Unique ID of the group | [optional] | -|**arrayName** | **String** | Name of the array, does not persist in database | [optional] | -|**email** | **String** | Email of the individual we send the invitation to | [optional] | -|**actions** | **String** | A comma separated list of ArrayActions or NamespaceActions | [optional] | -|**groupActions** | **String** | A comma separated list of GroupActions | [optional] | -|**status** | **InvitationStatus** | | [optional] | -|**createdAt** | **OffsetDateTime** | Datetime the invitation was created in UTC | [optional] | -|**expiresAt** | **OffsetDateTime** | Datetime the invitation is expected to expire in UTC | [optional] | -|**acceptedAt** | **OffsetDateTime** | Datetime the invitation was accepted in UTC | [optional] | -|**namespaceInvited** | **String** | The namespace invited (user or organization, if it exists in the DB) | [optional] | +|**invitationId** | **String** | The invitation's ID | | +|**inviteeEmail** | **String** | The invited user's email address | | +|**createdBy** | [**InvitingUser**](InvitingUser.md) | | | +|**createdAt** | **OffsetDateTime** | The date and time the invitation was created | | +|**workspaceInvitation** | [**InvitationWorkspace**](InvitationWorkspace.md) | | [optional] | diff --git a/docs/InvitationRespondRequest.md b/docs/InvitationRespondRequest.md new file mode 100644 index 0000000..52e60b7 --- /dev/null +++ b/docs/InvitationRespondRequest.md @@ -0,0 +1,24 @@ + + +# InvitationRespondRequest + +The request body for responding to an invitation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jwt** | **String** | The JWT that authorizes the invitee to respond to the invitation | | +|**response** | [**ResponseEnum**](#ResponseEnum) | The response to the invitation | | + + + +## Enum: ResponseEnum + +| Name | Value | +|---- | -----| +| ACCEPT | "accept" | +| REJECT | "reject" | + + + diff --git a/docs/InvitationRetrieveRequest.md b/docs/InvitationRetrieveRequest.md new file mode 100644 index 0000000..1fffbce --- /dev/null +++ b/docs/InvitationRetrieveRequest.md @@ -0,0 +1,14 @@ + + +# InvitationRetrieveRequest + +The request body for retrieving an invitation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**jwt** | **String** | The JWT that authorizes the invitee to retrieve the invitation | | + + + diff --git a/docs/InvitationRetrieveResponse.md b/docs/InvitationRetrieveResponse.md new file mode 100644 index 0000000..4ddd249 --- /dev/null +++ b/docs/InvitationRetrieveResponse.md @@ -0,0 +1,14 @@ + + +# InvitationRetrieveResponse + +The response object when retrieving an invitation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Invitation**](Invitation.md) | | | + + + diff --git a/docs/InvitationWorkspace.md b/docs/InvitationWorkspace.md new file mode 100644 index 0000000..6a6ecae --- /dev/null +++ b/docs/InvitationWorkspace.md @@ -0,0 +1,17 @@ + + +# InvitationWorkspace + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**workspaceId** | **String** | The workspace's ID | | +|**name** | **String** | The workspace's name | | +|**description** | **String** | The workspace's description | [optional] | +|**imageId** | **String** | The image's ID | [optional] | +|**prospectiveRole** | **WorkspaceRole** | | | + + + diff --git a/docs/InvitationsApi.md b/docs/InvitationsApi.md new file mode 100644 index 0000000..007734a --- /dev/null +++ b/docs/InvitationsApi.md @@ -0,0 +1,417 @@ +# InvitationsApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createInvitations**](InvitationsApi.md#createInvitations) | **POST** /invitations/admin/{workspace} | Create one or more invitations | +| [**getInvitation**](InvitationsApi.md#getInvitation) | **POST** /invitations/{invitation_id} | Retrieve an invitation | +| [**listInvitations**](InvitationsApi.md#listInvitations) | **GET** /invitations/admin/{workspace} | Retrieve all sent invitations | +| [**respondInvitation**](InvitationsApi.md#respondInvitation) | **PATCH** /invitations/{invitation_id} | Respond to an invitation | +| [**revokeInvitation**](InvitationsApi.md#revokeInvitation) | **DELETE** /invitations/admin/{workspace}/{invitation_id} | Revoke an invitation | + + + +# **createInvitations** +> createInvitations(workspace, invitationsCreateRequestInner) + +Create one or more invitations + +Create one or more invitations + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.InvitationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + InvitationsApi apiInstance = new InvitationsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + List invitationsCreateRequestInner = Arrays.asList(); // List | The request body containing the invitation to create + try { + apiInstance.createInvitations(workspace, invitationsCreateRequestInner); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationsApi#createInvitations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **invitationsCreateRequestInner** | [**List<InvitationsCreateRequestInner>**](InvitationsCreateRequestInner.md)| The request body containing the invitation to create | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Invitations created | - | +| **0** | An error occurred | - | + + +# **getInvitation** +> InvitationRetrieveResponse getInvitation(invitationId, invitationRetrieveRequest) + +Retrieve an invitation + +Invitee retrieves an invitation + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.InvitationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + InvitationsApi apiInstance = new InvitationsApi(defaultClient); + String invitationId = "invitationId_example"; // String | The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g + InvitationRetrieveRequest invitationRetrieveRequest = new InvitationRetrieveRequest(); // InvitationRetrieveRequest | The request body for retrieving an invitation + try { + InvitationRetrieveResponse result = apiInstance.getInvitation(invitationId, invitationRetrieveRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationsApi#getInvitation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **invitationId** | **String**| The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g | | +| **invitationRetrieveRequest** | [**InvitationRetrieveRequest**](InvitationRetrieveRequest.md)| The request body for retrieving an invitation | | + +### Return type + +[**InvitationRetrieveResponse**](InvitationRetrieveResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Invitation retrieved | - | +| **0** | An error occurred | - | + + +# **listInvitations** +> InvitationsListResponse listInvitations(workspace, page, perPage) + +Retrieve all sent invitations + +Retrieve all invitations that the user has sent + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.InvitationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + InvitationsApi apiInstance = new InvitationsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + InvitationsListResponse result = apiInstance.listInvitations(workspace, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationsApi#listInvitations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **page** | **Integer**| pagination offset | [optional] | +| **perPage** | **Integer**| pagination limit | [optional] | + +### Return type + +[**InvitationsListResponse**](InvitationsListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Invitations list retrieved | - | +| **0** | An error occurred | - | + + +# **respondInvitation** +> respondInvitation(invitationId, invitationRespondRequest) + +Respond to an invitation + +Invitee responds to an invitation + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.InvitationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + InvitationsApi apiInstance = new InvitationsApi(defaultClient); + String invitationId = "invitationId_example"; // String | The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g + InvitationRespondRequest invitationRespondRequest = new InvitationRespondRequest(); // InvitationRespondRequest | The request body for responding to an invitation + try { + apiInstance.respondInvitation(invitationId, invitationRespondRequest); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationsApi#respondInvitation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **invitationId** | **String**| The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g | | +| **invitationRespondRequest** | [**InvitationRespondRequest**](InvitationRespondRequest.md)| The request body for responding to an invitation | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Invitation responded to | - | +| **0** | An error occurred | - | + + +# **revokeInvitation** +> revokeInvitation(workspace, invitationId) + +Revoke an invitation + +Inviter revokes a previously-sent invitation + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.InvitationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + InvitationsApi apiInstance = new InvitationsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String invitationId = "invitationId_example"; // String | The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g + try { + apiInstance.revokeInvitation(workspace, invitationId); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationsApi#revokeInvitation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **invitationId** | **String**| The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Invitation revoked | - | +| **0** | An error occurred | - | + diff --git a/docs/InvitationsCreateRequestInner.md b/docs/InvitationsCreateRequestInner.md new file mode 100644 index 0000000..98fe39b --- /dev/null +++ b/docs/InvitationsCreateRequestInner.md @@ -0,0 +1,15 @@ + + +# InvitationsCreateRequestInner + +The invitations to create + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**inviteeEmail** | **String** | The invited user's email address | | +|**workspaceInvitation** | [**InvitationsCreateRequestWorkspace**](InvitationsCreateRequestWorkspace.md) | | [optional] | + + + diff --git a/docs/InvitationsCreateRequestWorkspace.md b/docs/InvitationsCreateRequestWorkspace.md new file mode 100644 index 0000000..8589872 --- /dev/null +++ b/docs/InvitationsCreateRequestWorkspace.md @@ -0,0 +1,14 @@ + + +# InvitationsCreateRequestWorkspace + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**workspaceId** | **String** | The workspace's ID | | +|**prospectiveRole** | **WorkspaceRole** | | | + + + diff --git a/docs/InvitationsListResponse.md b/docs/InvitationsListResponse.md new file mode 100644 index 0000000..536d589 --- /dev/null +++ b/docs/InvitationsListResponse.md @@ -0,0 +1,15 @@ + + +# InvitationsListResponse + +The response object when requesting all invitations + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<Invitation>**](Invitation.md) | An array of invitations for the user | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | [optional] | + + + diff --git a/docs/InvitingUser.md b/docs/InvitingUser.md new file mode 100644 index 0000000..24bbc4d --- /dev/null +++ b/docs/InvitingUser.md @@ -0,0 +1,18 @@ + + +# InvitingUser + +The user who sent the invitation + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**displayName** | **String** | The user's display name | | +|**email** | **String** | The user's email | | +|**imageId** | **String** | The image's ID | [optional] | +|**workspaceRole** | **WorkspaceRole** | | | + + + diff --git a/docs/Item.md b/docs/Item.md new file mode 100644 index 0000000..40ab08e --- /dev/null +++ b/docs/Item.md @@ -0,0 +1,37 @@ + + +# Item + +## Enum + + +* `THEME_SELECTION` (value: `"theme_selection"`) + +* `PROFILE_INFO` (value: `"profile_info"`) + +* `CLAIM_CREDITS` (value: `"claim_credits"`) + +* `CLOUD_STORAGE` (value: `"cloud_storage"`) + +* `ROOT_PATH` (value: `"root_path"`) + +* `INTRO` (value: `"intro"`) + +* `BASIC_TOUR` (value: `"basic_tour"`) + +* `SKIP_USER_ONBOARDING` (value: `"skip_user_onboarding"`) + +* `ADD_ASSET` (value: `"add_asset"`) + +* `LAUNCH_NOTEBOOK` (value: `"launch_notebook"`) + +* `INDICATE_FINISH_USER_ONBOARDING` (value: `"indicate_finish_user_onboarding"`) + +* `ORGANIZATION_BASIC_TOUR` (value: `"organization_basic_tour"`) + +* `INDICATE_FINISH_ORG_ONBOARDING` (value: `"indicate_finish_org_onboarding"`) + +* `SKIP_ORGANIZATION_ONBOARDING` (value: `"skip_organization_onboarding"`) + + + diff --git a/docs/ListShareSchemaTablesResponse.md b/docs/ListShareSchemaTablesResponse.md new file mode 100644 index 0000000..e8166a0 --- /dev/null +++ b/docs/ListShareSchemaTablesResponse.md @@ -0,0 +1,15 @@ + + +# ListShareSchemaTablesResponse + +Listing of delta share schema tables + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<TableItem>**](TableItem.md) | The items in the list | | +|**nextPageToken** | **String** | The next page token | [optional] | + + + diff --git a/docs/ListShareSchemasResponse.md b/docs/ListShareSchemasResponse.md new file mode 100644 index 0000000..7f9d5ac --- /dev/null +++ b/docs/ListShareSchemasResponse.md @@ -0,0 +1,15 @@ + + +# ListShareSchemasResponse + +Listing of delta shares + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<SchemaItem>**](SchemaItem.md) | The items in the list | | +|**nextPageToken** | **String** | The next page token | [optional] | + + + diff --git a/docs/ListSharesResponse.md b/docs/ListSharesResponse.md new file mode 100644 index 0000000..c6aa8c3 --- /dev/null +++ b/docs/ListSharesResponse.md @@ -0,0 +1,15 @@ + + +# ListSharesResponse + +Listing of delta shares + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<ShareItem>**](ShareItem.md) | The items in the list | | +|**nextPageToken** | **String** | The next page token | [optional] | + + + diff --git a/docs/ListTablesResponse.md b/docs/ListTablesResponse.md new file mode 100644 index 0000000..76c474e --- /dev/null +++ b/docs/ListTablesResponse.md @@ -0,0 +1,15 @@ + + +# ListTablesResponse + +Listing of delta share schema tables + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<TableItem>**](TableItem.md) | The items in the list | | +|**nextPageToken** | **String** | The next page token | [optional] | + + + diff --git a/docs/Metadata.md b/docs/Metadata.md new file mode 100644 index 0000000..488ec17 --- /dev/null +++ b/docs/Metadata.md @@ -0,0 +1,24 @@ + + +# Metadata + +Delta share table metadata object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique identifier for this table | | +|**name** | **String** | User-provided identifier for this table | [optional] | +|**description** | **String** | User-provided description for this table | [optional] | +|**format** | [**Format**](Format.md) | | | +|**schema** | [**Schema**](Schema.md) | | [optional] | +|**schemaString** | **String** | Schema of the table. This is a serialized JSON string which can be deserialized to a Schema Object. | | +|**partitionColumns** | **List<String>** | An array containing the names of columns by which the data should be partitioned. When a table doesn’t have partition columns, this will be an empty array. | | +|**_configuration** | **Map<String, Object>** | A map containing configuration options for the table | [optional] | +|**version** | **Integer** | The table version the metadata corresponds to, returned when querying table data with a version or timestamp parameter, or cdf query with includeHistoricalMetadata set to true. | [optional] | +|**size** | **Integer** | The size of the table in bytes, will be returned if available in the delta log. | [optional] | +|**numFiles** | **Integer** | The number of files in the table, will be returned if available in the delta log. | [optional] | + + + diff --git a/docs/ModelFile.md b/docs/ModelFile.md new file mode 100644 index 0000000..2b145aa --- /dev/null +++ b/docs/ModelFile.md @@ -0,0 +1,21 @@ + + +# ModelFile + +Delta share table file object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | [optional] | +|**version** | **Integer** | The table version of this file. | [optional] | +|**stats** | **String** | Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. | [optional] | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/ModelObject.md b/docs/ModelObject.md new file mode 100644 index 0000000..1702cb9 --- /dev/null +++ b/docs/ModelObject.md @@ -0,0 +1,17 @@ + + +# ModelObject + +Description of a TileDB file. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | The path to the file | [optional] | +|**lastModified** | **String** | The date the file was last modified | [optional] | +|**etag** | **String** | The file's ETag | [optional] | +|**size** | **Long** | The file's size | [optional] | + + + diff --git a/docs/OnboardingApi.md b/docs/OnboardingApi.md new file mode 100644 index 0000000..02445b9 --- /dev/null +++ b/docs/OnboardingApi.md @@ -0,0 +1,238 @@ +# OnboardingApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOnboardingItems**](OnboardingApi.md#deleteOnboardingItems) | **DELETE** /onboarding | Delete Onboarding items | +| [**getOnboardingItems**](OnboardingApi.md#getOnboardingItems) | **GET** /onboarding | Get onboarding items | +| [**setOnboardingItems**](OnboardingApi.md#setOnboardingItems) | **POST** /onboarding | Set Onboarding items | + + + +# **deleteOnboardingItems** +> deleteOnboardingItems() + +Delete Onboarding items + +Delete Onboarding items + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.OnboardingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + OnboardingApi apiInstance = new OnboardingApi(defaultClient); + try { + apiInstance.deleteOnboardingItems(); + } catch (ApiException e) { + System.err.println("Exception when calling OnboardingApi#deleteOnboardingItems"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | UI requests Rest server to delete Onboarding items | - | +| **0** | error response | - | + + +# **getOnboardingItems** +> OnboardingGetItemsResponse getOnboardingItems() + +Get onboarding items + +Get onboarding items + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.OnboardingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + OnboardingApi apiInstance = new OnboardingApi(defaultClient); + try { + OnboardingGetItemsResponse result = apiInstance.getOnboardingItems(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnboardingApi#getOnboardingItems"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OnboardingGetItemsResponse**](OnboardingGetItemsResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Onboarding Items | - | +| **0** | error response | - | + + +# **setOnboardingItems** +> setOnboardingItems(onboardingSetItemsRequest) + +Set Onboarding items + +Set Onboarding items + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.OnboardingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + OnboardingApi apiInstance = new OnboardingApi(defaultClient); + OnboardingSetItemsRequest onboardingSetItemsRequest = new OnboardingSetItemsRequest(); // OnboardingSetItemsRequest | workspace to create + try { + apiInstance.setOnboardingItems(onboardingSetItemsRequest); + } catch (ApiException e) { + System.err.println("Exception when calling OnboardingApi#setOnboardingItems"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **onboardingSetItemsRequest** | [**OnboardingSetItemsRequest**](OnboardingSetItemsRequest.md)| workspace to create | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Onboarding item complete | - | +| **0** | error response | - | + diff --git a/docs/OnboardingGetItemsResponse.md b/docs/OnboardingGetItemsResponse.md new file mode 100644 index 0000000..1326b5f --- /dev/null +++ b/docs/OnboardingGetItemsResponse.md @@ -0,0 +1,14 @@ + + +# OnboardingGetItemsResponse + +object for get items response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**OnboardingGetItemsResponseData**](OnboardingGetItemsResponseData.md) | | | + + + diff --git a/docs/OnboardingGetItemsResponseData.md b/docs/OnboardingGetItemsResponseData.md new file mode 100644 index 0000000..e50d39b --- /dev/null +++ b/docs/OnboardingGetItemsResponseData.md @@ -0,0 +1,14 @@ + + +# OnboardingGetItemsResponseData + +user's onboarding items + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**entries** | **List<Item>** | List of onboarding items | | + + + diff --git a/docs/OnboardingSetItemsRequest.md b/docs/OnboardingSetItemsRequest.md new file mode 100644 index 0000000..ab8190a --- /dev/null +++ b/docs/OnboardingSetItemsRequest.md @@ -0,0 +1,14 @@ + + +# OnboardingSetItemsRequest + +object for get items response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**OnboardingGetItemsResponseData**](OnboardingGetItemsResponseData.md) | | | + + + diff --git a/docs/PaginationMetadata.md b/docs/PaginationMetadata.md index 43e28c7..1e35960 100644 --- a/docs/PaginationMetadata.md +++ b/docs/PaginationMetadata.md @@ -2,15 +2,16 @@ # PaginationMetadata +Pagination metadata object ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**page** | **BigDecimal** | pagination offset. Use it to skip the first ((page - 1) * per_page) items | [optional] | -|**perPage** | **BigDecimal** | pagination limit (page size) | [optional] | -|**totalPages** | **BigDecimal** | number of total pages with current limit | [optional] | -|**totalItems** | **BigDecimal** | number of total available items | [optional] | +|**page** | **Integer** | pagination offset. Use it to skip the first ((page - 1) * per_page) items | | +|**perPage** | **Integer** | pagination limit (page size) | | +|**totalPages** | **Integer** | number of total pages with current limit | | +|**totalItems** | **Integer** | number of total available items | | diff --git a/docs/Protocol.md b/docs/Protocol.md new file mode 100644 index 0000000..7e61475 --- /dev/null +++ b/docs/Protocol.md @@ -0,0 +1,14 @@ + + +# Protocol + +Delta sharing protocol object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**minReaderVersion** | **Integer** | The minimum version of the protocol that a client must implement in order to correctly read a Delta Lake table. Currently it’s always 1. It will be changed in future when we introduce non-forward-compatible changes that require clients to implement. | | + + + diff --git a/docs/QueryTableChangeResponse.md b/docs/QueryTableChangeResponse.md new file mode 100644 index 0000000..dac0f56 --- /dev/null +++ b/docs/QueryTableChangeResponse.md @@ -0,0 +1,30 @@ + + +# QueryTableChangeResponse + +A sequence of JSON strings delimited by newline. The response contains three or more lines: The first line is a JSON wrapper object containing the table Protocol object. The second line is a JSON wrapper object containing the table Metadata object. The rest of the lines are JSON wrapper objects for Data Change Files of the change data feed. Historical Metadata will be returned if includeHistoricalMetadata is set to true. The ordering of the lines doesn't matter. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**minReaderVersion** | **Integer** | The minimum version of the protocol that a client must implement in order to correctly read a Delta Lake table. Currently it’s always 1. It will be changed in future when we introduce non-forward-compatible changes that require clients to implement. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**name** | **String** | User-provided identifier for this table | [optional] | +|**description** | **String** | User-provided description for this table | [optional] | +|**format** | [**Format**](Format.md) | | | +|**schema** | [**Schema**](Schema.md) | | [optional] | +|**schemaString** | **String** | Schema of the table. This is a serialized JSON string which can be deserialized to a Schema Object. | | +|**partitionColumns** | **List<String>** | An array containing the names of columns by which the data should be partitioned. When a table doesn’t have partition columns, this will be an empty array. | | +|**_configuration** | **Map<String, Object>** | A map containing configuration options for the table | [optional] | +|**version** | **Integer** | The table version of this file. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**numFiles** | **Integer** | The number of files in the table, will be returned if available in the delta log. | [optional] | +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | | +|**stats** | **String** | Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. | [optional] | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/QueryTableRequest.md b/docs/QueryTableRequest.md new file mode 100644 index 0000000..a22e664 --- /dev/null +++ b/docs/QueryTableRequest.md @@ -0,0 +1,20 @@ + + +# QueryTableRequest + +Delta share table query request + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**predicateHints** | **String** | a list of SQL boolean expressions using a restricted subset of SQL, in a JSON array. When it's present, the server will use the provided predicates as a hint to apply the SQL predicates on the returned files. Filtering files based on the SQL predicates is BEST EFFORT. The server may return files that don't satisfy the predicates. If the server fails to parse one of the SQL predicates, or fails to evaluate it, the server may skip it. Predicate expressions are conjunctive (AND-ed together). When it's absent, the server will return all of files in the table. This will be deprecated once all the client and server implementation move to using jsonPredicateHints below. | [optional] | +|**jsonPredicateHints** | **String** | query predicates on partition columns specified using a structured JSON format. When it's present, the server will try to use the predicates to filter table's files, which could boost query performance. As with predicateHints, this filtering is BEST EFFORT. The server may return files that don't satisfy the predicates. If the server encounters any errors during predicate processing (for example, invalid syntax or non existing columns), it will skip filtering and return all the files. When it's absent, the server will return all the files in the table. | [optional] | +|**limitHint** | **String** | an optional limit number. It's a hint from the client to tell the server how many rows in the table the client plans to read. The server can use this hint to return only some files by using the file stats. For example, when running SELECT * FROM table LIMIT 1000, the client can set limitHint to 1000. | [optional] | +|**version** | **Integer** | an optional version number. If set, will return files as of the specified version of the table. This is only supported on tables with history sharing enabled. | [optional] | +|**timestamp** | **String** | an optional timestamp string in the Timestamp Format,. If set, will return files as of the table version corresponding to the specified timestamp. This is only supported on tables with history sharing enabled. | [optional] | +|**startingVersion** | **Integer** | an optional version number. If set, will return all data change files since startingVersion, inclusive, including historical metadata if seen in the delta log. | [optional] | +|**endingVersion** | **Integer** | an optional version number, only used if startingVersion is set. If set, the server can use it as a hint to avoid returning data change files after endingVersion. This is not enforcement. Hence, when sending the endingVersion parameter, the client should still handle the case that it may receive files after endingVersion. | [optional] | + + + diff --git a/docs/QueryTableResponse.md b/docs/QueryTableResponse.md new file mode 100644 index 0000000..55b524f --- /dev/null +++ b/docs/QueryTableResponse.md @@ -0,0 +1,30 @@ + + +# QueryTableResponse + +A sequence of JSON strings delimited by newline. The response contains three or more lines: The first line is a JSON wrapper object containing the table Protocol object. The second line is a JSON wrapper object containing the table Metadata object. The rest of the lines are JSON wrapper objects for data change files, Metadata, or files, the ordering of the lines doesn't matter. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**minReaderVersion** | **Integer** | The minimum version of the protocol that a client must implement in order to correctly read a Delta Lake table. Currently it’s always 1. It will be changed in future when we introduce non-forward-compatible changes that require clients to implement. | | +|**id** | **String** | A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. | | +|**name** | **String** | User-provided identifier for this table | [optional] | +|**description** | **String** | User-provided description for this table | [optional] | +|**format** | [**Format**](Format.md) | | | +|**schema** | [**Schema**](Schema.md) | | [optional] | +|**schemaString** | **String** | Schema of the table. This is a serialized JSON string which can be deserialized to a Schema Object. | | +|**partitionColumns** | **List<String>** | An array containing the names of columns by which the data should be partitioned. When a table doesn’t have partition columns, this will be an empty array. | | +|**_configuration** | **Map<String, Object>** | A map containing configuration options for the table | [optional] | +|**version** | **Integer** | The table version of this file. | | +|**size** | **Integer** | The size of this file in bytes. | | +|**numFiles** | **Integer** | The number of files in the table, will be returned if available in the delta log. | [optional] | +|**url** | **String** | An https url that a client can use to read the file directly. The same file in different responses may have different urls. | | +|**partitionValues** | **Map<String, Object>** | A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. | | +|**timestamp** | **Integer** | The timestamp of the file in milliseconds from epoch. | | +|**stats** | **String** | Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. | [optional] | +|**expirationTimestamp** | **Integer** | The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. | [optional] | + + + diff --git a/docs/RequestEmailConfirmationRequest.md b/docs/RequestEmailConfirmationRequest.md new file mode 100644 index 0000000..610e8ee --- /dev/null +++ b/docs/RequestEmailConfirmationRequest.md @@ -0,0 +1,14 @@ + + +# RequestEmailConfirmationRequest + +Object containing the necessary data to request an email address confirmation email. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**usernameOrEmail** | **String** | username or email of the user that will receive the email with the required token | | + + + diff --git a/docs/RequestPasswordResetRequest.md b/docs/RequestPasswordResetRequest.md new file mode 100644 index 0000000..9693af1 --- /dev/null +++ b/docs/RequestPasswordResetRequest.md @@ -0,0 +1,14 @@ + + +# RequestPasswordResetRequest + +Object containing the necessary data to request a password reset link. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**usernameOrEmail** | **String** | username or email of the user that will receive the email with the password reset link | | + + + diff --git a/docs/ResetPasswordRequest.md b/docs/ResetPasswordRequest.md new file mode 100644 index 0000000..c3c7e91 --- /dev/null +++ b/docs/ResetPasswordRequest.md @@ -0,0 +1,14 @@ + + +# ResetPasswordRequest + +Object containing the necessary data to reset a user's password + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**newPassword** | **String** | the new password | | + + + diff --git a/docs/RestCapabilities.md b/docs/RestCapabilities.md new file mode 100644 index 0000000..0f408d7 --- /dev/null +++ b/docs/RestCapabilities.md @@ -0,0 +1,15 @@ + + +# RestCapabilities + +Model representing REST capabilities + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deployedTileDBVersion** | [**TileDBVersion**](TileDBVersion.md) | | | +|**minimumSupportedTileDBClientVersion** | [**TileDBVersion**](TileDBVersion.md) | | | + + + diff --git a/docs/Schema.md b/docs/Schema.md new file mode 100644 index 0000000..76dd49e --- /dev/null +++ b/docs/Schema.md @@ -0,0 +1,15 @@ + + +# Schema + +A struct is used to represent both the top-level schema of the table as well as struct columns that contain nested columns. A struct is encoded as a JSON object with the following fields + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Always the string struct | | +|**fields** | [**List<SchemaField>**](SchemaField.md) | User-provided identifier for this table | | + + + diff --git a/docs/SchemaField.md b/docs/SchemaField.md new file mode 100644 index 0000000..aff9651 --- /dev/null +++ b/docs/SchemaField.md @@ -0,0 +1,17 @@ + + +# SchemaField + +A struct field represents a top-level or nested column. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of this (possibly nested) column | | +|**type** | [**SchemaFieldType**](SchemaFieldType.md) | | | +|**nullable** | **Boolean** | A JSON map containing information about this column. For example, the comment key means its value is the column comment. | | +|**metadata** | **Map<String, Object>** | A JSON map containing information about this column. For example, the comment key means its value is the column comment. | [optional] | + + + diff --git a/docs/SchemaFieldArray.md b/docs/SchemaFieldArray.md new file mode 100644 index 0000000..7cc3c66 --- /dev/null +++ b/docs/SchemaFieldArray.md @@ -0,0 +1,16 @@ + + +# SchemaFieldArray + +An array stores a variable length collection of items of some type. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Always the string array | | +|**elementType** | [**SchemaFieldArrayElementType**](SchemaFieldArrayElementType.md) | | | +|**containsNull** | **Boolean** | Boolean denoting whether this array can contain one or more null values | | + + + diff --git a/docs/SchemaFieldArrayElementType.md b/docs/SchemaFieldArrayElementType.md new file mode 100644 index 0000000..e69f12b --- /dev/null +++ b/docs/SchemaFieldArrayElementType.md @@ -0,0 +1,19 @@ + + +# SchemaFieldArrayElementType + +The type of element stored in this array represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Always the string map | | +|**elementType** | [**SchemaFieldArrayElementType**](SchemaFieldArrayElementType.md) | | | +|**containsNull** | **Boolean** | Boolean denoting whether this array can contain one or more null values | | +|**keyType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueContainsNull** | **Boolean** | Indicates if map values have null values. | | + + + diff --git a/docs/SchemaFieldDataType.md b/docs/SchemaFieldDataType.md new file mode 100644 index 0000000..3498824 --- /dev/null +++ b/docs/SchemaFieldDataType.md @@ -0,0 +1,37 @@ + + +# SchemaFieldDataType + +## Enum + + +* `STRING` (value: `"string"`) + +* `LONG` (value: `"long"`) + +* `INTEGER` (value: `"integer"`) + +* `SHORT` (value: `"short"`) + +* `BYTE` (value: `"byte"`) + +* `FLOAT` (value: `"float"`) + +* `DOUBLE` (value: `"double"`) + +* `BOOLEAN` (value: `"boolean"`) + +* `BINARY` (value: `"binary"`) + +* `DATE` (value: `"date"`) + +* `TIMESTAMP` (value: `"timestamp"`) + +* `DECIMAL` (value: `"decimal"`) + +* `ARRAY` (value: `"array"`) + +* `STRUCT` (value: `"struct"`) + + + diff --git a/docs/SchemaFieldMap.md b/docs/SchemaFieldMap.md new file mode 100644 index 0000000..a9d9f43 --- /dev/null +++ b/docs/SchemaFieldMap.md @@ -0,0 +1,17 @@ + + +# SchemaFieldMap + +A map stores an arbitrary length collection of key-value pairs with a single keyType and a single valueType. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Always the string map | | +|**keyType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueContainsNull** | **Boolean** | Indicates if map values have null values. | | + + + diff --git a/docs/SchemaFieldType.md b/docs/SchemaFieldType.md new file mode 100644 index 0000000..afa0af2 --- /dev/null +++ b/docs/SchemaFieldType.md @@ -0,0 +1,19 @@ + + +# SchemaFieldType + +String containing the name of a primitive type, a struct definition, an array definition or a map definition + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Always the string map | | +|**elementType** | [**SchemaFieldArrayElementType**](SchemaFieldArrayElementType.md) | | | +|**containsNull** | **Boolean** | Boolean denoting whether this array can contain one or more null values | | +|**keyType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueType** | **String** | The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition | | +|**valueContainsNull** | **Boolean** | Indicates if map values have null values. | | + + + diff --git a/docs/SchemaItem.md b/docs/SchemaItem.md new file mode 100644 index 0000000..af47951 --- /dev/null +++ b/docs/SchemaItem.md @@ -0,0 +1,15 @@ + + +# SchemaItem + +Delta share schema table item + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | name of schema | | +|**share** | **String** | name of share | | + + + diff --git a/docs/ShareItem.md b/docs/ShareItem.md new file mode 100644 index 0000000..146bbc6 --- /dev/null +++ b/docs/ShareItem.md @@ -0,0 +1,15 @@ + + +# ShareItem + +Delta share item + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | name of share | | +|**id** | **String** | optional ID of share | [optional] | + + + diff --git a/docs/ShareResponse.md b/docs/ShareResponse.md new file mode 100644 index 0000000..304fe90 --- /dev/null +++ b/docs/ShareResponse.md @@ -0,0 +1,14 @@ + + +# ShareResponse + +Delta share details + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**share** | [**ShareItem**](ShareItem.md) | | | + + + diff --git a/docs/StorageSetting.md b/docs/StorageSetting.md new file mode 100644 index 0000000..6ea63c8 --- /dev/null +++ b/docs/StorageSetting.md @@ -0,0 +1,20 @@ + + +# StorageSetting + +The path at which a given asset will be stored, and the credentials used to access that asset. Storage location contains a pair of storage path and storage credentials + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**storageSettingId** | **String** | The storage setting's ID | | +|**name** | **String** | storage location name | | +|**isDefault** | **Boolean** | True if this is the workspace's or teamspace's default storage setting | | +|**path** | **String** | The path to store an asset. | | +|**credentialsName** | **String** | The name of the credentials used to access this storage path | | +|**invalid** | **Boolean** | True if the storage settings pair is not valid | | +|**reason** | **String** | The reason why the storage setting pair is not valid | [optional] | + + + diff --git a/docs/StorageSettingGetResponse.md b/docs/StorageSettingGetResponse.md new file mode 100644 index 0000000..51d2f90 --- /dev/null +++ b/docs/StorageSettingGetResponse.md @@ -0,0 +1,14 @@ + + +# StorageSettingGetResponse + +object for get storage setting response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**StorageSetting**](StorageSetting.md) | | | + + + diff --git a/docs/StorageSettingUpdateRequest.md b/docs/StorageSettingUpdateRequest.md new file mode 100644 index 0000000..0aeda3c --- /dev/null +++ b/docs/StorageSettingUpdateRequest.md @@ -0,0 +1,17 @@ + + +# StorageSettingUpdateRequest + +The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | storage location name | [optional] | +|**isDefault** | **Boolean** | True if this is the workspace's or teamspace's default storage setting | [optional] | +|**path** | **String** | The path to store an asset. | [optional] | +|**credentialsName** | **String** | The name of the credentials used to access this storage path | [optional] | + + + diff --git a/docs/StorageSettingsCreateRequest.md b/docs/StorageSettingsCreateRequest.md new file mode 100644 index 0000000..95bd879 --- /dev/null +++ b/docs/StorageSettingsCreateRequest.md @@ -0,0 +1,17 @@ + + +# StorageSettingsCreateRequest + +The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | storage location name | | +|**isDefault** | **Boolean** | True if this is the workspace's or teamspace's default storage setting | | +|**path** | **String** | URI containing the VFS path of where assets will be stored. Local file paths must start with `file://`. | | +|**credentialsName** | **String** | The name of the credentials used to access this storage path | | + + + diff --git a/docs/StorageSettingsCreateResponse.md b/docs/StorageSettingsCreateResponse.md new file mode 100644 index 0000000..733952f --- /dev/null +++ b/docs/StorageSettingsCreateResponse.md @@ -0,0 +1,14 @@ + + +# StorageSettingsCreateResponse + +object for create workspace response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**StorageSetting**](StorageSetting.md) | | | + + + diff --git a/docs/StorageSettingsForTeamspaceCreateRequest.md b/docs/StorageSettingsForTeamspaceCreateRequest.md new file mode 100644 index 0000000..5ab9a00 --- /dev/null +++ b/docs/StorageSettingsForTeamspaceCreateRequest.md @@ -0,0 +1,16 @@ + + +# StorageSettingsForTeamspaceCreateRequest + +The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | storage location name | | +|**isDefault** | **Boolean** | True if this is the workspace's or teamspace's default storage setting | | +|**path** | **String** | The path to store an asset. | | + + + diff --git a/docs/StorageSettingsListResponse.md b/docs/StorageSettingsListResponse.md new file mode 100644 index 0000000..6094734 --- /dev/null +++ b/docs/StorageSettingsListResponse.md @@ -0,0 +1,15 @@ + + +# StorageSettingsListResponse + +object for get storage settings list response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<StorageSetting>**](StorageSetting.md) | List of storage settings items | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | | + + + diff --git a/docs/StoragesettingsApi.md b/docs/StoragesettingsApi.md new file mode 100644 index 0000000..4c3fa50 --- /dev/null +++ b/docs/StoragesettingsApi.md @@ -0,0 +1,432 @@ +# StoragesettingsApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createStorageSetting**](StoragesettingsApi.md#createStorageSetting) | **POST** /storagesettings/{workspace} | Create a new storage setting | +| [**deleteStorageSettingByID**](StoragesettingsApi.md#deleteStorageSettingByID) | **DELETE** /storagesettings/{workspace}/{stset_id} | Delete storage setting | +| [**getStorageSettingByID**](StoragesettingsApi.md#getStorageSettingByID) | **GET** /storagesettings/{workspace}/{stset_id} | Get storage setting | +| [**listStorageSettings**](StoragesettingsApi.md#listStorageSettings) | **GET** /storagesettings/{workspace} | Get storage settings | +| [**patchStorageSettingByID**](StoragesettingsApi.md#patchStorageSettingByID) | **PATCH** /storagesettings/{workspace}/{stset_id} | Update storage setting | + + + +# **createStorageSetting** +> StorageSettingsCreateResponse createStorageSetting(workspace, storageSettingsCreateRequest, teamspaceId) + +Create a new storage setting + +create a storage setting + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.StoragesettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + StoragesettingsApi apiInstance = new StoragesettingsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + StorageSettingsCreateRequest storageSettingsCreateRequest = new StorageSettingsCreateRequest(); // StorageSettingsCreateRequest | The request body containing the storage setting to create + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + StorageSettingsCreateResponse result = apiInstance.createStorageSetting(workspace, storageSettingsCreateRequest, teamspaceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragesettingsApi#createStorageSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **storageSettingsCreateRequest** | [**StorageSettingsCreateRequest**](StorageSettingsCreateRequest.md)| The request body containing the storage setting to create | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +[**StorageSettingsCreateResponse**](StorageSettingsCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Storage settings created | - | +| **0** | error response | - | + + +# **deleteStorageSettingByID** +> deleteStorageSettingByID(stsetId, workspace, teamspaceId) + +Delete storage setting + +Delete the storage setting. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.StoragesettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + StoragesettingsApi apiInstance = new StoragesettingsApi(defaultClient); + String stsetId = "stsetId_example"; // String | The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + apiInstance.deleteStorageSettingByID(stsetId, workspace, teamspaceId); + } catch (ApiException e) { + System.err.println("Exception when calling StoragesettingsApi#deleteStorageSettingByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stsetId** | **String**| The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g | | +| **workspace** | **String**| The workspace name or id | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | storage setting deleted | - | +| **0** | error response | - | + + +# **getStorageSettingByID** +> StorageSettingGetResponse getStorageSettingByID(stsetId, workspace, teamspaceId) + +Get storage setting + +get information about storage setting by ID + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.StoragesettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + StoragesettingsApi apiInstance = new StoragesettingsApi(defaultClient); + String stsetId = "stsetId_example"; // String | The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + StorageSettingGetResponse result = apiInstance.getStorageSettingByID(stsetId, workspace, teamspaceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragesettingsApi#getStorageSettingByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stsetId** | **String**| The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g | | +| **workspace** | **String**| The workspace name or id | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +[**StorageSettingGetResponse**](StorageSettingGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful storage setting response | - | +| **404** | Storage setting does not exist | - | +| **0** | error response | - | + + +# **listStorageSettings** +> StorageSettingsListResponse listStorageSettings(workspace, teamspaceId, page, perPage) + +Get storage settings + +list the storage settings available for the user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.StoragesettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + StoragesettingsApi apiInstance = new StoragesettingsApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + StorageSettingsListResponse result = apiInstance.listStorageSettings(workspace, teamspaceId, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoragesettingsApi#listStorageSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | +| **page** | **Integer**| pagination offset | [optional] | +| **perPage** | **Integer**| pagination limit | [optional] | + +### Return type + +[**StorageSettingsListResponse**](StorageSettingsListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful storage settings list response | - | +| **0** | error response | - | + + +# **patchStorageSettingByID** +> patchStorageSettingByID(stsetId, workspace, storageSettingUpdateRequest, teamspaceId) + +Update storage setting + +update storage setting given by the user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.StoragesettingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + StoragesettingsApi apiInstance = new StoragesettingsApi(defaultClient); + String stsetId = "stsetId_example"; // String | The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + StorageSettingUpdateRequest storageSettingUpdateRequest = new StorageSettingUpdateRequest(); // StorageSettingUpdateRequest | storage setting update details + String teamspaceId = "teamspaceId_example"; // String | Teamspace id should be empty, if the request is about an action on workspace level + try { + apiInstance.patchStorageSettingByID(stsetId, workspace, storageSettingUpdateRequest, teamspaceId); + } catch (ApiException e) { + System.err.println("Exception when calling StoragesettingsApi#patchStorageSettingByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stsetId** | **String**| The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g | | +| **workspace** | **String**| The workspace name or id | | +| **storageSettingUpdateRequest** | [**StorageSettingUpdateRequest**](StorageSettingUpdateRequest.md)| storage setting update details | | +| **teamspaceId** | **String**| Teamspace id should be empty, if the request is about an action on workspace level | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The storage setting was updated successfully | - | +| **404** | Storage setting does not exist | - | +| **0** | error response | - | + diff --git a/docs/TableItem.md b/docs/TableItem.md new file mode 100644 index 0000000..003b587 --- /dev/null +++ b/docs/TableItem.md @@ -0,0 +1,18 @@ + + +# TableItem + +Delta share schema table item + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | name of table | | +|**schema** | **String** | name of schema | | +|**share** | **String** | name of share | | +|**shareId** | **String** | optional ID of share | [optional] | +|**id** | **String** | optional ID of table | [optional] | + + + diff --git a/docs/TableMetadataResponse.md b/docs/TableMetadataResponse.md new file mode 100644 index 0000000..6d7b355 --- /dev/null +++ b/docs/TableMetadataResponse.md @@ -0,0 +1,25 @@ + + +# TableMetadataResponse + +A sequence of JSON strings delimited by newline. The response contains two lines: The first line is a JSON wrapper object containing the table Protocol object. The second line is a JSON wrapper object containing the table Metadata object. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**minReaderVersion** | **Integer** | The minimum version of the protocol that a client must implement in order to correctly read a Delta Lake table. Currently it’s always 1. It will be changed in future when we introduce non-forward-compatible changes that require clients to implement. | | +|**id** | **String** | Unique identifier for this table | | +|**name** | **String** | User-provided identifier for this table | [optional] | +|**description** | **String** | User-provided description for this table | [optional] | +|**format** | [**Format**](Format.md) | | | +|**schema** | [**Schema**](Schema.md) | | [optional] | +|**schemaString** | **String** | Schema of the table. This is a serialized JSON string which can be deserialized to a Schema Object. | | +|**partitionColumns** | **List<String>** | An array containing the names of columns by which the data should be partitioned. When a table doesn’t have partition columns, this will be an empty array. | | +|**_configuration** | **Map<String, Object>** | A map containing configuration options for the table | [optional] | +|**version** | **Integer** | The table version the metadata corresponds to, returned when querying table data with a version or timestamp parameter, or cdf query with includeHistoricalMetadata set to true. | [optional] | +|**size** | **Integer** | The size of the table in bytes, will be returned if available in the delta log. | [optional] | +|**numFiles** | **Integer** | The number of files in the table, will be returned if available in the delta log. | [optional] | + + + diff --git a/docs/Teamspace.md b/docs/Teamspace.md new file mode 100644 index 0000000..4bc7626 --- /dev/null +++ b/docs/Teamspace.md @@ -0,0 +1,23 @@ + + +# Teamspace + +The teamspace object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**teamspaceId** | **String** | The teamspace's ID | | +|**name** | **String** | The teamspace name | | +|**spaceType** | **TeamspaceType** | | | +|**icon** | **String** | The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**createdAt** | **OffsetDateTime** | The datetime the teamspace was created (in UTC) | | +|**createdBy** | [**TeamspaceUser**](TeamspaceUser.md) | | | +|**description** | **String** | The teamspace description | [optional] | +|**self** | [**TeamspaceUser**](TeamspaceUser.md) | | [optional] | +|**visibility** | **TeamspaceVisibility** | | | +|**updatedAt** | **OffsetDateTime** | The datetime the teamspace was updated (in UTC) | [optional] | + + + diff --git a/docs/TeamspaceDefaultCredential.md b/docs/TeamspaceDefaultCredential.md new file mode 100644 index 0000000..17fa4eb --- /dev/null +++ b/docs/TeamspaceDefaultCredential.md @@ -0,0 +1,15 @@ + + +# TeamspaceDefaultCredential + +default credential object for a teamspace. Gives the option to use an existing credential from parent workspace or create a new credential on teamspace level + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**newCredential** | [**CredentialCreateRequest**](CredentialCreateRequest.md) | | [optional] | +|**existingCredentialName** | **String** | Existing workspace credential name | [optional] | + + + diff --git a/docs/TeamspaceGetResponse.md b/docs/TeamspaceGetResponse.md new file mode 100644 index 0000000..c230ddf --- /dev/null +++ b/docs/TeamspaceGetResponse.md @@ -0,0 +1,14 @@ + + +# TeamspaceGetResponse + +The response object when requesting a single teamspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Teamspace**](Teamspace.md) | | | + + + diff --git a/docs/TeamspaceRole.md b/docs/TeamspaceRole.md new file mode 100644 index 0000000..94ba60d --- /dev/null +++ b/docs/TeamspaceRole.md @@ -0,0 +1,15 @@ + + +# TeamspaceRole + +## Enum + + +* `OWNER` (value: `"owner"`) + +* `EDITOR` (value: `"editor"`) + +* `VIEWER` (value: `"viewer"`) + + + diff --git a/docs/TeamspaceType.md b/docs/TeamspaceType.md new file mode 100644 index 0000000..040c87d --- /dev/null +++ b/docs/TeamspaceType.md @@ -0,0 +1,15 @@ + + +# TeamspaceType + +## Enum + + +* `TEAMSPACE` (value: `"teamspace"`) + +* `USERSPACE` (value: `"userspace"`) + +* `GENERALSPACE` (value: `"generalspace"`) + + + diff --git a/docs/TeamspaceUpdateRequest.md b/docs/TeamspaceUpdateRequest.md new file mode 100644 index 0000000..8ce662c --- /dev/null +++ b/docs/TeamspaceUpdateRequest.md @@ -0,0 +1,17 @@ + + +# TeamspaceUpdateRequest + +The request object for updating a teamspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The teamspace name | [optional] | +|**description** | **String** | The teamspace description | [optional] | +|**icon** | **String** | The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**visibilityLevel** | **TeamspaceVisibility** | | [optional] | + + + diff --git a/docs/TeamspaceUser.md b/docs/TeamspaceUser.md new file mode 100644 index 0000000..d3146ce --- /dev/null +++ b/docs/TeamspaceUser.md @@ -0,0 +1,22 @@ + + +# TeamspaceUser + +The teamspace user object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**username** | **String** | The user's username | | +|**displayName** | **String** | The user's display name | | +|**email** | **String** | The user's email | | +|**imageId** | **String** | The image's ID | [optional] | +|**role** | **TeamspaceRole** | | | +|**addedBy** | **String** | The user's ID | | +|**createdAt** | **OffsetDateTime** | The datetime the teamspace user was created (in UTC) | | +|**deletedAt** | **OffsetDateTime** | The datetime the teamspace user was deleted (in UTC) | [optional] | + + + diff --git a/docs/TeamspaceUserGetResponse.md b/docs/TeamspaceUserGetResponse.md new file mode 100644 index 0000000..2becdae --- /dev/null +++ b/docs/TeamspaceUserGetResponse.md @@ -0,0 +1,14 @@ + + +# TeamspaceUserGetResponse + +The response object when requesting a single teamspace user + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**TeamspaceUser**](TeamspaceUser.md) | | | + + + diff --git a/docs/TeamspaceUserUpdateRequest.md b/docs/TeamspaceUserUpdateRequest.md new file mode 100644 index 0000000..f9b8717 --- /dev/null +++ b/docs/TeamspaceUserUpdateRequest.md @@ -0,0 +1,14 @@ + + +# TeamspaceUserUpdateRequest + +The request object for updating a single teamspace user + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**role** | **TeamspaceRole** | | | + + + diff --git a/docs/TeamspaceUsersBulkUpdateRequestInner.md b/docs/TeamspaceUsersBulkUpdateRequestInner.md new file mode 100644 index 0000000..9e6691b --- /dev/null +++ b/docs/TeamspaceUsersBulkUpdateRequestInner.md @@ -0,0 +1,15 @@ + + +# TeamspaceUsersBulkUpdateRequestInner + +The teamspace user update object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**role** | **TeamspaceRole** | | | + + + diff --git a/docs/TeamspaceUsersCreateRequestInner.md b/docs/TeamspaceUsersCreateRequestInner.md new file mode 100644 index 0000000..6be4a1b --- /dev/null +++ b/docs/TeamspaceUsersCreateRequestInner.md @@ -0,0 +1,15 @@ + + +# TeamspaceUsersCreateRequestInner + +The teamspace user that should be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**role** | **TeamspaceRole** | | | + + + diff --git a/docs/TeamspaceUsersCreateResponse.md b/docs/TeamspaceUsersCreateResponse.md new file mode 100644 index 0000000..be32cb1 --- /dev/null +++ b/docs/TeamspaceUsersCreateResponse.md @@ -0,0 +1,14 @@ + + +# TeamspaceUsersCreateResponse + +The response object when creating multiple teamspace users + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<TeamspaceUser>**](TeamspaceUser.md) | An array of teamspace users that were created | | + + + diff --git a/docs/TeamspaceUsersJoinResponse.md b/docs/TeamspaceUsersJoinResponse.md new file mode 100644 index 0000000..ee3c3fe --- /dev/null +++ b/docs/TeamspaceUsersJoinResponse.md @@ -0,0 +1,14 @@ + + +# TeamspaceUsersJoinResponse + +The response object when joining a teamspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**TeamspaceUser**](TeamspaceUser.md) | | | + + + diff --git a/docs/TeamspaceUsersListResponse.md b/docs/TeamspaceUsersListResponse.md new file mode 100644 index 0000000..d92be55 --- /dev/null +++ b/docs/TeamspaceUsersListResponse.md @@ -0,0 +1,14 @@ + + +# TeamspaceUsersListResponse + +The response object when requesting multiple teamspace users + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<TeamspaceUser>**](TeamspaceUser.md) | An array of teamspace users | | + + + diff --git a/docs/TeamspaceVisibility.md b/docs/TeamspaceVisibility.md new file mode 100644 index 0000000..ad4f793 --- /dev/null +++ b/docs/TeamspaceVisibility.md @@ -0,0 +1,13 @@ + + +# TeamspaceVisibility + +## Enum + + +* `PRIVATE` (value: `"private"`) + +* `PUBLIC` (value: `"public"`) + + + diff --git a/docs/TeamspacesApi.md b/docs/TeamspacesApi.md new file mode 100644 index 0000000..e440a5d --- /dev/null +++ b/docs/TeamspacesApi.md @@ -0,0 +1,1259 @@ +# TeamspacesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createTeamspaceUsers**](TeamspacesApi.md#createTeamspaceUsers) | **POST** /teamspaces/{workspace}/{teamspace}/users | Create one or more teamspace users in a teamspace | +| [**createTeamspaces**](TeamspacesApi.md#createTeamspaces) | **POST** /teamspaces/{workspace} | Create a teamspace | +| [**deleteTeamspace**](TeamspacesApi.md#deleteTeamspace) | **DELETE** /teamspaces/{workspace}/{teamspace} | Delete a teamspace | +| [**deleteTeamspaceUser**](TeamspacesApi.md#deleteTeamspaceUser) | **DELETE** /teamspaces/{workspace}/{teamspace}/users/{user_id} | Delete a teamspace user | +| [**deleteTeamspaceUsers**](TeamspacesApi.md#deleteTeamspaceUsers) | **POST** /actions/teamspaces/{workspace}/{teamspace}/users/bulk_delete | Delete the given teamspace users in a teamspace | +| [**deleteTeamspaces**](TeamspacesApi.md#deleteTeamspaces) | **DELETE** /teamspaces/{workspace} | Delete all teamspaces in the workspace | +| [**getTeamspace**](TeamspacesApi.md#getTeamspace) | **GET** /teamspaces/{workspace}/{teamspace} | Retrieve a teamspace | +| [**getTeamspaceUser**](TeamspacesApi.md#getTeamspaceUser) | **GET** /teamspaces/{workspace}/{teamspace}/users/{user_id} | Retrieve a teamspace user | +| [**joinTeamspace**](TeamspacesApi.md#joinTeamspace) | **POST** /actions/teamspaces/{workspace}/{teamspace}/users/join | Join the given public teamspace | +| [**leaveTeamspace**](TeamspacesApi.md#leaveTeamspace) | **POST** /actions/teamspaces/{workspace}/{teamspace}/users/leave | Leave the given teamspace | +| [**listTeamspaceUsers**](TeamspacesApi.md#listTeamspaceUsers) | **GET** /teamspaces/{workspace}/{teamspace}/users | Retrieve all teamspace users in a teamspace | +| [**listTeamspaces**](TeamspacesApi.md#listTeamspaces) | **GET** /teamspaces/{workspace} | Retrieve teamspaces in the workspace | +| [**updateTeamspace**](TeamspacesApi.md#updateTeamspace) | **PATCH** /teamspaces/{workspace}/{teamspace} | Update the given teamspace | +| [**updateTeamspaceUser**](TeamspacesApi.md#updateTeamspaceUser) | **PATCH** /teamspaces/{workspace}/{teamspace}/users/{user_id} | Update a teamspace user | +| [**updateTeamspaceUsers**](TeamspacesApi.md#updateTeamspaceUsers) | **PATCH** /actions/teamspaces/{workspace}/{teamspace}/users/bulk_update | Update multiple teamspace users in a teamspace | + + + +# **createTeamspaceUsers** +> TeamspaceUsersCreateResponse createTeamspaceUsers(workspace, teamspace, teamspaceUsersCreateRequestInner) + +Create one or more teamspace users in a teamspace + +Create one or more teamspace users in a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + List teamspaceUsersCreateRequestInner = Arrays.asList(); // List | The request body containing the teamspace users to create + try { + TeamspaceUsersCreateResponse result = apiInstance.createTeamspaceUsers(workspace, teamspace, teamspaceUsersCreateRequestInner); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#createTeamspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **teamspaceUsersCreateRequestInner** | [**List<TeamspaceUsersCreateRequestInner>**](TeamspaceUsersCreateRequestInner.md)| The request body containing the teamspace users to create | | + +### Return type + +[**TeamspaceUsersCreateResponse**](TeamspaceUsersCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Teamspace users created | - | +| **0** | An error occurred | - | + + +# **createTeamspaces** +> TeamspacesCreateResponse createTeamspaces(workspace, teamspacesCreateRequest) + +Create a teamspace + +Create a teamspace. The user creating the teamspace will be the teamspace owner. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + TeamspacesCreateRequest teamspacesCreateRequest = new TeamspacesCreateRequest(); // TeamspacesCreateRequest | The request body containing the teamspace to create + try { + TeamspacesCreateResponse result = apiInstance.createTeamspaces(workspace, teamspacesCreateRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#createTeamspaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspacesCreateRequest** | [**TeamspacesCreateRequest**](TeamspacesCreateRequest.md)| The request body containing the teamspace to create | | + +### Return type + +[**TeamspacesCreateResponse**](TeamspacesCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Teamspaces created | - | +| **0** | An error occurred | - | + + +# **deleteTeamspace** +> deleteTeamspace(workspace, teamspace, deleteAssets) + +Delete a teamspace + +Delete the given teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + Boolean deleteAssets = false; // Boolean | If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. + try { + apiInstance.deleteTeamspace(workspace, teamspace, deleteAssets); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#deleteTeamspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **deleteAssets** | **Boolean**| If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. | [optional] [default to false] | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace deleted | - | +| **0** | An error occurred | - | + + +# **deleteTeamspaceUser** +> deleteTeamspaceUser(workspace, teamspace, userId) + +Delete a teamspace user + +Delete the given teamspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String userId = "userId_example"; // String | The user ID in the form usr_9m4e2mr0ui3e8a215n4g + try { + apiInstance.deleteTeamspaceUser(workspace, teamspace, userId); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#deleteTeamspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **userId** | **String**| The user ID in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace user deleted | - | +| **404** | Teamspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **deleteTeamspaceUsers** +> deleteTeamspaceUsers(workspace, teamspace, requestBody) + +Delete the given teamspace users in a teamspace + +Delete the given teamspace users in a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + List requestBody = Arrays.asList(); // List | The request body containing the teamspace users to delete + try { + apiInstance.deleteTeamspaceUsers(workspace, teamspace, requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#deleteTeamspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **requestBody** | [**List<String>**](String.md)| The request body containing the teamspace users to delete | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace users deleted | - | +| **404** | One or more of the given teamspace users do not exist | - | +| **0** | An error occurred | - | + + +# **deleteTeamspaces** +> deleteTeamspaces(workspace) + +Delete all teamspaces in the workspace + +Delete all teamspaces in the workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + try { + apiInstance.deleteTeamspaces(workspace); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#deleteTeamspaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspaces deleted | - | +| **0** | An error occurred | - | + + +# **getTeamspace** +> TeamspaceGetResponse getTeamspace(workspace, teamspace) + +Retrieve a teamspace + +Retrieve the given teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + try { + TeamspaceGetResponse result = apiInstance.getTeamspace(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#getTeamspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | + +### Return type + +[**TeamspaceGetResponse**](TeamspaceGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Teamspace retrieved | - | +| **404** | Teamspace does not exist | - | +| **0** | An error occurred | - | + + +# **getTeamspaceUser** +> TeamspaceUserGetResponse getTeamspaceUser(workspace, teamspace, userId) + +Retrieve a teamspace user + +Retrieve the given teamspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String userId = "userId_example"; // String | The user ID in the form usr_9m4e2mr0ui3e8a215n4g + try { + TeamspaceUserGetResponse result = apiInstance.getTeamspaceUser(workspace, teamspace, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#getTeamspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **userId** | **String**| The user ID in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +[**TeamspaceUserGetResponse**](TeamspaceUserGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Teamspace user retrieved | - | +| **404** | Teamspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **joinTeamspace** +> TeamspaceUsersJoinResponse joinTeamspace(workspace, teamspace) + +Join the given public teamspace + +Allows users to join a public teamspace if they are a member of the corresponding workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + try { + TeamspaceUsersJoinResponse result = apiInstance.joinTeamspace(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#joinTeamspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | + +### Return type + +[**TeamspaceUsersJoinResponse**](TeamspaceUsersJoinResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Teamspace joined | - | +| **404** | Teamspace ID does not exist | - | +| **0** | An error occurred | - | + + +# **leaveTeamspace** +> leaveTeamspace(workspace, teamspace) + +Leave the given teamspace + +Allows teamspace members to leave a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + try { + apiInstance.leaveTeamspace(workspace, teamspace); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#leaveTeamspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace left | - | +| **404** | Teamspace ID does not exist | - | +| **0** | An error occurred | - | + + +# **listTeamspaceUsers** +> TeamspaceUsersListResponse listTeamspaceUsers(workspace, teamspace) + +Retrieve all teamspace users in a teamspace + +Retrieve a list of all teamspace users in a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + try { + TeamspaceUsersListResponse result = apiInstance.listTeamspaceUsers(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#listTeamspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | + +### Return type + +[**TeamspaceUsersListResponse**](TeamspaceUsersListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Teamspace users list retrieved | - | +| **404** | Teamspace ID does not exist | - | +| **0** | An error occurred | - | + + +# **listTeamspaces** +> TeamspacesListResponse listTeamspaces(workspace, orderBy, order, memberships) + +Retrieve teamspaces in the workspace + +If `memberships=true`, fetches teamspaces the user is a member of. If `memberships=false`, fetches public teamspaces the user is not a member of. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String orderBy = "name"; // String | The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at + String order = "asc"; // String | Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc + Boolean memberships = true; // Boolean | If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. + try { + TeamspacesListResponse result = apiInstance.listTeamspaces(workspace, orderBy, order, memberships); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#listTeamspaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **orderBy** | **String**| The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at | [optional] [enum: name, created_at, updated_at] | +| **order** | **String**| Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc | [optional] [enum: asc, desc] | +| **memberships** | **Boolean**| If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. | [optional] [default to true] | + +### Return type + +[**TeamspacesListResponse**](TeamspacesListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Teamspaces retrieved | - | +| **404** | Workspace ID does not exist | - | +| **0** | An error occurred | - | + + +# **updateTeamspace** +> updateTeamspace(workspace, teamspace, teamspaceUpdateRequest) + +Update the given teamspace + +Update a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + TeamspaceUpdateRequest teamspaceUpdateRequest = new TeamspaceUpdateRequest(); // TeamspaceUpdateRequest | The request body containing the teamspace to update + try { + apiInstance.updateTeamspace(workspace, teamspace, teamspaceUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#updateTeamspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **teamspaceUpdateRequest** | [**TeamspaceUpdateRequest**](TeamspaceUpdateRequest.md)| The request body containing the teamspace to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace updated | - | +| **0** | An error occurred | - | + + +# **updateTeamspaceUser** +> updateTeamspaceUser(workspace, teamspace, userId, teamspaceUserUpdateRequest) + +Update a teamspace user + +Update the given teamspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + String userId = "userId_example"; // String | The user ID in the form usr_9m4e2mr0ui3e8a215n4g + TeamspaceUserUpdateRequest teamspaceUserUpdateRequest = new TeamspaceUserUpdateRequest(); // TeamspaceUserUpdateRequest | The request body containing the teamspace user to update + try { + apiInstance.updateTeamspaceUser(workspace, teamspace, userId, teamspaceUserUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#updateTeamspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **userId** | **String**| The user ID in the form usr_9m4e2mr0ui3e8a215n4g | | +| **teamspaceUserUpdateRequest** | [**TeamspaceUserUpdateRequest**](TeamspaceUserUpdateRequest.md)| The request body containing the teamspace user to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace user updated | - | +| **404** | Teamspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **updateTeamspaceUsers** +> updateTeamspaceUsers(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner) + +Update multiple teamspace users in a teamspace + +Update multiple teamspace users in a teamspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TeamspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TeamspacesApi apiInstance = new TeamspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String teamspace = "ts_9m4e2mr0ui3e8a215n4g"; // String | The teamspace name or id + List teamspaceUsersBulkUpdateRequestInner = Arrays.asList(); // List | The request body containing the teamspace users to update + try { + apiInstance.updateTeamspaceUsers(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner); + } catch (ApiException e) { + System.err.println("Exception when calling TeamspacesApi#updateTeamspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **teamspace** | **String**| The teamspace name or id | | +| **teamspaceUsersBulkUpdateRequestInner** | [**List<TeamspaceUsersBulkUpdateRequestInner>**](TeamspaceUsersBulkUpdateRequestInner.md)| The request body containing the teamspace users to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Teamspace users updated successfully | - | +| **0** | An error occurred | - | + diff --git a/docs/TeamspacesCreateRequest.md b/docs/TeamspacesCreateRequest.md new file mode 100644 index 0000000..59f241e --- /dev/null +++ b/docs/TeamspacesCreateRequest.md @@ -0,0 +1,19 @@ + + +# TeamspacesCreateRequest + +The request object for creating a teamspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The teamspace name | | +|**description** | **String** | The teamspace description | [optional] | +|**icon** | **String** | The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**visibility** | **TeamspaceVisibility** | | | +|**defaultCredential** | [**TeamspaceDefaultCredential**](TeamspaceDefaultCredential.md) | | [optional] | +|**defaultStorageSetting** | [**StorageSettingsForTeamspaceCreateRequest**](StorageSettingsForTeamspaceCreateRequest.md) | | [optional] | + + + diff --git a/docs/TeamspacesCreateResponse.md b/docs/TeamspacesCreateResponse.md new file mode 100644 index 0000000..38c8607 --- /dev/null +++ b/docs/TeamspacesCreateResponse.md @@ -0,0 +1,14 @@ + + +# TeamspacesCreateResponse + +The response object when creating one or more teamspaces + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Teamspace**](Teamspace.md) | | | + + + diff --git a/docs/TeamspacesListResponse.md b/docs/TeamspacesListResponse.md new file mode 100644 index 0000000..9fe9123 --- /dev/null +++ b/docs/TeamspacesListResponse.md @@ -0,0 +1,14 @@ + + +# TeamspacesListResponse + +The response object when requesting multiple teamspaces + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<Teamspace>**](Teamspace.md) | An array of teamspaces | | + + + diff --git a/docs/TileDBVersion.md b/docs/TileDBVersion.md new file mode 100644 index 0000000..5242179 --- /dev/null +++ b/docs/TileDBVersion.md @@ -0,0 +1,16 @@ + + +# TileDBVersion + +Model representing TileDB version + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**major** | **Integer** | TileDB core major version | | +|**minor** | **Integer** | TileDB core minor version | | +|**patch** | **Integer** | TileDB core patch version | | + + + diff --git a/docs/Token.md b/docs/Token.md index 2048aa6..c931eef 100644 --- a/docs/Token.md +++ b/docs/Token.md @@ -2,17 +2,14 @@ # Token -A api token and its metadata +The token information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**token** | **String** | A api token | [optional] | -|**name** | **String** | Name of token to revoke | [optional] | -|**issuedAt** | **OffsetDateTime** | datetime the token was created | [optional] | -|**expiresAt** | **OffsetDateTime** | datetime the token when token will expire | [optional] | -|**scope** | **List<TokenScope>** | Optional scope to limit token, defaults to all permissions, current supported values are password_reset or * | [optional] | +|**azure** | [**AzureToken**](AzureToken.md) | | [optional] | +|**gcp** | [**GCPServiceAccountKey**](GCPServiceAccountKey.md) | | [optional] | diff --git a/docs/TokenCreateRequest.md b/docs/TokenCreateRequest.md new file mode 100644 index 0000000..f6e33d7 --- /dev/null +++ b/docs/TokenCreateRequest.md @@ -0,0 +1,17 @@ + + +# TokenCreateRequest + +The request object for creating a token + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | A human-readable name for the token. The name must be provided if the token is an API token (i.e. if `workspace_id` is provided). | [optional] | +|**scope** | **TokenScope** | | | +|**workspaceId** | **String** | The workspace ID or Name that the token will be scoped for. This must be provided if the token is meant to be an API token (instead of a session token). | [optional] | +|**expiresAt** | **OffsetDateTime** | The expiration date and time of the token. If no expiration date is provided, the server will set the default expiration date. | [optional] | + + + diff --git a/docs/TokenCreateResponse.md b/docs/TokenCreateResponse.md new file mode 100644 index 0000000..2c83fc5 --- /dev/null +++ b/docs/TokenCreateResponse.md @@ -0,0 +1,14 @@ + + +# TokenCreateResponse + +The response object when creating a token + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**APIToken**](APIToken.md) | | | + + + diff --git a/docs/TokenListResponse.md b/docs/TokenListResponse.md new file mode 100644 index 0000000..e0ebed6 --- /dev/null +++ b/docs/TokenListResponse.md @@ -0,0 +1,15 @@ + + +# TokenListResponse + +The response object when requesting all tokens + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<APIToken>**](APIToken.md) | An array of tokens | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | [optional] | + + + diff --git a/docs/TokenScope.md b/docs/TokenScope.md index d5d922c..33d8411 100644 --- a/docs/TokenScope.md +++ b/docs/TokenScope.md @@ -5,12 +5,12 @@ ## Enum +* `STAR` (value: `"*"`) + * `PASSWORD_RESET` (value: `"password_reset"`) * `CONFIRM_EMAIL` (value: `"confirm_email"`) -* `STAR` (value: `"*"`) - * `USER_READ` (value: `"user:read"`) * `USER_READ_WRITE` (value: `"user:read-write"`) diff --git a/docs/TokensApi.md b/docs/TokensApi.md new file mode 100644 index 0000000..6329767 --- /dev/null +++ b/docs/TokensApi.md @@ -0,0 +1,251 @@ +# TokensApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createToken**](TokensApi.md#createToken) | **POST** /tokens | Create a new token | +| [**listTokens**](TokensApi.md#listTokens) | **GET** /tokens | Retrieve all of the user's tokens | +| [**revokeToken**](TokensApi.md#revokeToken) | **DELETE** /tokens/{token_id} | Revoke a token | + + + +# **createToken** +> TokenCreateResponse createToken(tokenCreateRequest) + +Create a new token + +Create a new token + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TokensApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TokensApi apiInstance = new TokensApi(defaultClient); + TokenCreateRequest tokenCreateRequest = new TokenCreateRequest(); // TokenCreateRequest | The request body containing the token to create + try { + TokenCreateResponse result = apiInstance.createToken(tokenCreateRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TokensApi#createToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tokenCreateRequest** | [**TokenCreateRequest**](TokenCreateRequest.md)| The request body containing the token to create | | + +### Return type + +[**TokenCreateResponse**](TokenCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Token created | - | +| **0** | An error occurred | - | + + +# **listTokens** +> TokenListResponse listTokens(type, page, perPage) + +Retrieve all of the user's tokens + +Retrieve all of the user's tokens of the given type + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TokensApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TokensApi apiInstance = new TokensApi(defaultClient); + String type = "api"; // String | The type of tokens to retrieve + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + TokenListResponse result = apiInstance.listTokens(type, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TokensApi#listTokens"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **type** | **String**| The type of tokens to retrieve | [enum: api, session] | +| **page** | **Integer**| pagination offset | [optional] | +| **perPage** | **Integer**| pagination limit | [optional] | + +### Return type + +[**TokenListResponse**](TokenListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Tokens retrieved | - | +| **0** | An error occurred | - | + + +# **revokeToken** +> revokeToken(tokenId) + +Revoke a token + +Revoke a token that was previously created + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.TokensApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + TokensApi apiInstance = new TokensApi(defaultClient); + String tokenId = "tokenId_example"; // String | The ID of the token to revoke + try { + apiInstance.revokeToken(tokenId); + } catch (ApiException e) { + System.err.println("Exception when calling TokensApi#revokeToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tokenId** | **String**| The ID of the token to revoke | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Token revoked | - | +| **0** | An error occurred | - | + diff --git a/docs/User.md b/docs/User.md index 4be096f..30f308a 100644 --- a/docs/User.md +++ b/docs/User.md @@ -2,31 +2,23 @@ # User -User +object for a registered user ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | unique ID of user | [optional] | -|**username** | **String** | username must be unique | | -|**password** | **String** | password | [optional] | -|**name** | **String** | the user's full, real name | [optional] | -|**email** | **String** | the user's email | [optional] | -|**isValidEmail** | **Boolean** | user's email is validated to be correct | [optional] [readonly] | -|**stripeConnect** | **Boolean** | Denotes that the user is able to apply pricing to arrays by means of Stripe Connect | [optional] [readonly] | -|**company** | **String** | the user's company | [optional] | -|**logo** | **String** | the user's logo | [optional] | -|**timezone** | **String** | | [optional] | -|**organizations** | [**List<OrganizationUser>**](OrganizationUser.md) | Array of organizations a user is part of and their roles | [optional] [readonly] | -|**allowedActions** | **List<NamespaceActions>** | list of actions user is allowed to do on this organization | [optional] | -|**enabledFeatures** | **List<String>** | List of extra/optional/beta features to enable for namespace | [optional] [readonly] | -|**unpaidSubscription** | **Boolean** | A notice that the user has an unpaid subscription | [optional] [readonly] | -|**defaultS3Path** | **String** | The default location to store newly-created notebooks and other assets like UDFs. The name `default_s3_path` is a legacy holdover; it may refer to any supported storage location. | [optional] | -|**defaultS3PathCredentialsName** | **Object** | The name of the credentials used to create and access files in the `default_s3_path`, if needed. | [optional] | -|**assetLocations** | [**AssetLocations**](AssetLocations.md) | | [optional] | -|**defaultNamespaceCharged** | **String** | Override the default namespace charged for actions when no namespace is specified | [optional] | -|**defaultRegion** | **String** | The default region to use for notebooks and other operations. It must be a region supported by TileDB, see https://docs.tiledb.com/cloud/concepts/tiledb-cloud-internals/architecture#orchestration | [optional] | +|**id** | **String** | The user's ID | | +|**displayName** | **String** | display name of the user | | +|**imageId** | **String** | The image's ID | [optional] | +|**email** | **String** | user email | | +|**isValidEmail** | **Boolean** | if a user has validated their email | [optional] | +|**role** | **UserRole** | | | +|**username** | **String** | user email | | +|**timezone** | **String** | user timezone | | +|**createdAt** | **OffsetDateTime** | Datetime the user was created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime the user was updated in UTC | [optional] | +|**deletedAt** | **OffsetDateTime** | Datetime the user was deleted in UTC | [optional] | diff --git a/docs/UserAnswer.md b/docs/UserAnswer.md new file mode 100644 index 0000000..eb04dd3 --- /dev/null +++ b/docs/UserAnswer.md @@ -0,0 +1,15 @@ + + +# UserAnswer + +The academy questionnaire user's answer + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**questionId** | **String** | ID of the question in the questionnaire | | +|**answerId** | **String** | ID of the answer in the questionnaire | | + + + diff --git a/docs/UserCreateRequest.md b/docs/UserCreateRequest.md new file mode 100644 index 0000000..fa35e02 --- /dev/null +++ b/docs/UserCreateRequest.md @@ -0,0 +1,19 @@ + + +# UserCreateRequest + +object metadata for a user that will be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**displayName** | **String** | display name of the user shown everywhere | [optional] | +|**email** | **String** | user email | | +|**username** | **String** | username that can be logged in with | | +|**password** | **String** | password for the user | | +|**timezone** | **String** | user timezone | [optional] | +|**image** | **String** | Image data in the form data:image/png;base64,iVBORw0KGgoAAAA | [optional] | + + + diff --git a/docs/UserCreateResponse.md b/docs/UserCreateResponse.md new file mode 100644 index 0000000..dfdf208 --- /dev/null +++ b/docs/UserCreateResponse.md @@ -0,0 +1,14 @@ + + +# UserCreateResponse + +object for create user response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**User**](User.md) | | | + + + diff --git a/docs/UserGetResponse.md b/docs/UserGetResponse.md new file mode 100644 index 0000000..9200a6e --- /dev/null +++ b/docs/UserGetResponse.md @@ -0,0 +1,14 @@ + + +# UserGetResponse + +object for get user response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**User**](User.md) | | | + + + diff --git a/docs/UserRole.md b/docs/UserRole.md new file mode 100644 index 0000000..2a2e1c2 --- /dev/null +++ b/docs/UserRole.md @@ -0,0 +1,15 @@ + + +# UserRole + +## Enum + + +* `OWNER` (value: `"owner"`) + +* `ADMIN` (value: `"admin"`) + +* `MEMBER` (value: `"member"`) + + + diff --git a/docs/UserSelfResponse.md b/docs/UserSelfResponse.md new file mode 100644 index 0000000..3c098d2 --- /dev/null +++ b/docs/UserSelfResponse.md @@ -0,0 +1,14 @@ + + +# UserSelfResponse + +object for get self user response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UserSelfResponseData**](UserSelfResponseData.md) | | | + + + diff --git a/docs/UserSelfResponseData.md b/docs/UserSelfResponseData.md new file mode 100644 index 0000000..e03ee0c --- /dev/null +++ b/docs/UserSelfResponseData.md @@ -0,0 +1,14 @@ + + +# UserSelfResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**user** | [**User**](User.md) | | | +|**workspaces** | [**List<UserSelfWorkspace>**](UserSelfWorkspace.md) | | | + + + diff --git a/docs/UserSelfWorkspace.md b/docs/UserSelfWorkspace.md new file mode 100644 index 0000000..9d06690 --- /dev/null +++ b/docs/UserSelfWorkspace.md @@ -0,0 +1,21 @@ + + +# UserSelfWorkspace + +list of workspaces a user is a part of + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**workspaceId** | **String** | The workspace's ID | | +|**name** | **String** | workspace name | | +|**createdBy** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**self** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**description** | **String** | Workspace description | [optional] | +|**createdAt** | **OffsetDateTime** | Datetime workspace was created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime workspace was updated in UTC | [optional] | +|**imageId** | **String** | The image's ID | [optional] | + + + diff --git a/docs/UserUpdateRequest.md b/docs/UserUpdateRequest.md new file mode 100644 index 0000000..67bbbad --- /dev/null +++ b/docs/UserUpdateRequest.md @@ -0,0 +1,17 @@ + + +# UserUpdateRequest + +object metadata for updates made to a user + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**displayName** | **String** | display name of the user shown everywhere | [optional] | +|**email** | **String** | user email | [optional] | +|**timezone** | **String** | user timezone | [optional] | +|**image** | **String** | Image data in the form data:image/png;base64,iVBORw0KGgoAAAA | [optional] | + + + diff --git a/docs/UsersApi.md b/docs/UsersApi.md new file mode 100644 index 0000000..53c7b52 --- /dev/null +++ b/docs/UsersApi.md @@ -0,0 +1,804 @@ +# UsersApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**changePassword**](UsersApi.md#changePassword) | **POST** /actions/users/change_password | Changes a user's password. | +| [**confirmEmail**](UsersApi.md#confirmEmail) | **POST** /actions/users/confirm_email | Confirm an email address | +| [**createUser**](UsersApi.md#createUser) | **POST** /users | Create a user | +| [**deleteUser**](UsersApi.md#deleteUser) | **DELETE** /users/{user_id} | Delete a user | +| [**getSelfUser**](UsersApi.md#getSelfUser) | **GET** /users/self | Retrieve the current user | +| [**getUser**](UsersApi.md#getUser) | **GET** /users/{user_id} | Retrieve a user | +| [**requestEmailConfirmation**](UsersApi.md#requestEmailConfirmation) | **POST** /actions/users/request_email_confirmation | Request a new email to be sent containing the email confirmation token | +| [**requestPasswordReset**](UsersApi.md#requestPasswordReset) | **POST** /actions/users/request_password_reset | Request a password reset while unauthorized | +| [**resetPassword**](UsersApi.md#resetPassword) | **POST** /actions/users/reset_password | Reset a user's password using a scoped token. | +| [**updateUser**](UsersApi.md#updateUser) | **PATCH** /users/{user_id} | Update a user | + + + +# **changePassword** +> changePassword(changePasswordRequest) + +Changes a user's password. + +This endpoint allows a user to change their password. The user must provide the current password along with the new password. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + ChangePasswordRequest changePasswordRequest = new ChangePasswordRequest(); // ChangePasswordRequest | data required to changes a user's password + try { + apiInstance.changePassword(changePasswordRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#changePassword"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **changePasswordRequest** | [**ChangePasswordRequest**](ChangePasswordRequest.md)| data required to changes a user's password | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Password updated successfully | - | +| **0** | error response | - | + + +# **confirmEmail** +> confirmEmail(X_TILEDB_REST_API_KEY) + +Confirm an email address + +Operation to confirm the email address by providing the token sent to user's email address + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + String X_TILEDB_REST_API_KEY = "X_TILEDB_REST_API_KEY_example"; // String | The confirm email scoped token to validate the user's email address + try { + apiInstance.confirmEmail(X_TILEDB_REST_API_KEY); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#confirmEmail"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **X_TILEDB_REST_API_KEY** | **String**| The confirm email scoped token to validate the user's email address | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Email confirmed successfully | - | +| **0** | error response | - | + + +# **createUser** +> UserCreateResponse createUser(userCreateRequest) + +Create a user + +create a user for a new registration + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + UserCreateRequest userCreateRequest = new UserCreateRequest(); // UserCreateRequest | user to create + try { + UserCreateResponse result = apiInstance.createUser(userCreateRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userCreateRequest** | [**UserCreateRequest**](UserCreateRequest.md)| user to create | | + +### Return type + +[**UserCreateResponse**](UserCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Successful user response | - | +| **0** | error response | - | + + +# **deleteUser** +> deleteUser(userId) + +Delete a user + +Delete an existing user based on the provided user id + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + try { + apiInstance.deleteUser(userId); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Successfully deleted user | - | +| **404** | User does not exist | - | +| **0** | error response | - | + + +# **getSelfUser** +> UserSelfResponse getSelfUser() + +Retrieve the current user + +Retrieve the user that is currently logged in + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + try { + UserSelfResponse result = apiInstance.getSelfUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#getSelfUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserSelfResponse**](UserSelfResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful user response | - | +| **0** | error response | - | + + +# **getUser** +> UserGetResponse getUser(userId) + +Retrieve a user + +Retrieve an existing user based on the provided user id + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + try { + UserGetResponse result = apiInstance.getUser(userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#getUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +[**UserGetResponse**](UserGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successfully retrieved user | - | +| **404** | User does not exist | - | +| **0** | error response | - | + + +# **requestEmailConfirmation** +> requestEmailConfirmation(requestEmailConfirmationRequest) + +Request a new email to be sent containing the email confirmation token + +Operation to request for a new email to allow the user to confirm their email address. This email contains a link with the required api token. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + RequestEmailConfirmationRequest requestEmailConfirmationRequest = new RequestEmailConfirmationRequest(); // RequestEmailConfirmationRequest | data required to initiate a password reset request + try { + apiInstance.requestEmailConfirmation(requestEmailConfirmationRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#requestEmailConfirmation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestEmailConfirmationRequest** | [**RequestEmailConfirmationRequest**](RequestEmailConfirmationRequest.md)| data required to initiate a password reset request | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Email sent successfully | - | +| **0** | error response | - | + + +# **requestPasswordReset** +> requestPasswordReset(requestPasswordResetRequest) + +Request a password reset while unauthorized + +This endpoint sends an email to the user's registered email address with a password reset link. The link contains a scoped token that authorizes the user to reset their password securely. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + RequestPasswordResetRequest requestPasswordResetRequest = new RequestPasswordResetRequest(); // RequestPasswordResetRequest | data required to initiate a password reset request + try { + apiInstance.requestPasswordReset(requestPasswordResetRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#requestPasswordReset"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestPasswordResetRequest** | [**RequestPasswordResetRequest**](RequestPasswordResetRequest.md)| data required to initiate a password reset request | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | The request was accepted. If the user exists they will receive an email. | - | +| **0** | error response | - | + + +# **resetPassword** +> resetPassword(X_TILEDB_REST_API_KEY, resetPasswordRequest) + +Reset a user's password using a scoped token. + +This endpoint allows a user to reset their password. The user must provide a valid scoped token, received via email, along with their new password. The token ensures secure and authorized access to update the password. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + String X_TILEDB_REST_API_KEY = "X_TILEDB_REST_API_KEY_example"; // String | The reset password scoped token to reset the user's password + ResetPasswordRequest resetPasswordRequest = new ResetPasswordRequest(); // ResetPasswordRequest | data required to initiate a password reset request + try { + apiInstance.resetPassword(X_TILEDB_REST_API_KEY, resetPasswordRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#resetPassword"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **X_TILEDB_REST_API_KEY** | **String**| The reset password scoped token to reset the user's password | | +| **resetPasswordRequest** | [**ResetPasswordRequest**](ResetPasswordRequest.md)| data required to initiate a password reset request | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Password updated successfully | - | +| **0** | error response | - | + + +# **updateUser** +> updateUser(userId, userUpdateRequest) + +Update a user + +Update an existing user based on the provided data + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UsersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UsersApi apiInstance = new UsersApi(defaultClient); + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + UserUpdateRequest userUpdateRequest = new UserUpdateRequest(); // UserUpdateRequest | userUpdateDetails + try { + apiInstance.updateUser(userId, userUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | +| **userUpdateRequest** | [**UserUpdateRequest**](UserUpdateRequest.md)| userUpdateDetails | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Successfully updated user | - | +| **404** | User does not exist | - | +| **0** | error response | - | + diff --git a/docs/Userspace.md b/docs/Userspace.md new file mode 100644 index 0000000..0a4eb31 --- /dev/null +++ b/docs/Userspace.md @@ -0,0 +1,19 @@ + + +# Userspace + +The userspace object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userspaceId** | **String** | The userspace's ID | | +|**name** | **String** | The userspace name | | +|**icon** | **String** | The userspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | +|**createdAt** | **OffsetDateTime** | The datetime the userspace was created (in UTC) | | +|**description** | **String** | The userspace description | [optional] | +|**updatedAt** | **OffsetDateTime** | The datetime the userspace was updated (in UTC) | [optional] | + + + diff --git a/docs/UserspaceGetResponse.md b/docs/UserspaceGetResponse.md new file mode 100644 index 0000000..40bfd64 --- /dev/null +++ b/docs/UserspaceGetResponse.md @@ -0,0 +1,14 @@ + + +# UserspaceGetResponse + +The response object when requesting a userspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Userspace**](Userspace.md) | | | + + + diff --git a/docs/UserspaceUpdateRequest.md b/docs/UserspaceUpdateRequest.md new file mode 100644 index 0000000..ffa8b7c --- /dev/null +++ b/docs/UserspaceUpdateRequest.md @@ -0,0 +1,16 @@ + + +# UserspaceUpdateRequest + +The request object for updating a userspace + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The userspace name | [optional] | +|**description** | **String** | The userspace description | [optional] | +|**icon** | **String** | The userspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 | [optional] | + + + diff --git a/docs/UserspacesApi.md b/docs/UserspacesApi.md new file mode 100644 index 0000000..9c54738 --- /dev/null +++ b/docs/UserspacesApi.md @@ -0,0 +1,174 @@ +# UserspacesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getUserspace**](UserspacesApi.md#getUserspace) | **GET** /userspaces/{workspace}/{userspace} | Retrieve a userspace | +| [**updateUserspace**](UserspacesApi.md#updateUserspace) | **PATCH** /userspaces/{workspace}/{userspace} | Update the given userspace | + + + +# **getUserspace** +> UserspaceGetResponse getUserspace(workspace, userspace) + +Retrieve a userspace + +Retrieve the given userspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UserspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UserspacesApi apiInstance = new UserspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String userspace = "ts_9m4e2mr0ui3e8a215n4g or alice"; // String | The userspace id or the user's username + try { + UserspaceGetResponse result = apiInstance.getUserspace(workspace, userspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserspacesApi#getUserspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **userspace** | **String**| The userspace id or the user's username | | + +### Return type + +[**UserspaceGetResponse**](UserspaceGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Userspace retrieved | - | +| **404** | Userspace does not exist | - | +| **0** | An error occurred | - | + + +# **updateUserspace** +> updateUserspace(workspace, userspace, userspaceUpdateRequest) + +Update the given userspace + +Update a userspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.UserspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + UserspacesApi apiInstance = new UserspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String userspace = "ts_9m4e2mr0ui3e8a215n4g or alice"; // String | The userspace id or the user's username + UserspaceUpdateRequest userspaceUpdateRequest = new UserspaceUpdateRequest(); // UserspaceUpdateRequest | The request body containing the userspace to update + try { + apiInstance.updateUserspace(workspace, userspace, userspaceUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling UserspacesApi#updateUserspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **userspace** | **String**| The userspace id or the user's username | | +| **userspaceUpdateRequest** | [**UserspaceUpdateRequest**](UserspaceUpdateRequest.md)| The request body containing the userspace to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Userspace updated | - | +| **0** | An error occurred | - | + diff --git a/docs/ValidationError.md b/docs/ValidationError.md new file mode 100644 index 0000000..9d8f5f4 --- /dev/null +++ b/docs/ValidationError.md @@ -0,0 +1,14 @@ + + +# ValidationError + +Object containing data about a handled error by REST server + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fields** | [**List<ValidationErrorField>**](ValidationErrorField.md) | The list of fields that failed validation | | + + + diff --git a/docs/ValidationErrorField.md b/docs/ValidationErrorField.md new file mode 100644 index 0000000..9e7d244 --- /dev/null +++ b/docs/ValidationErrorField.md @@ -0,0 +1,15 @@ + + +# ValidationErrorField + +Object containing data about a handled error by REST server + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**field** | **String** | The name of the field that failed validation | | +|**message** | **String** | A friendly message about the validation error | | + + + diff --git a/docs/Versions.md b/docs/Versions.md new file mode 100644 index 0000000..f055f99 --- /dev/null +++ b/docs/Versions.md @@ -0,0 +1,20 @@ + + +# Versions + +Various version numbers for the server + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**goVersion** | **String** | The version of Go used to build the server | | +|**tiledbVersion** | **String** | The version of TileDB used by the server | | +|**udfImagesVersion** | **List<String>** | The UDF images that the server supports | | +|**vcsName** | **String** | The name of the version control system (vcs) used to develop the server | [optional] | +|**vcsRevision** | **String** | The vcs revision of the server | [optional] | +|**vcsTime** | **OffsetDateTime** | The modification time associated with the vcs revision | [optional] | +|**buildId** | **String** | The build ID of the server. If set, this will be either the branch name or the git tag. | [optional] | + + + diff --git a/docs/VersionsApi.md b/docs/VersionsApi.md new file mode 100644 index 0000000..d3c900c --- /dev/null +++ b/docs/VersionsApi.md @@ -0,0 +1,84 @@ +# VersionsApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getVersions**](VersionsApi.md#getVersions) | **GET** /versions | Get Server versions | + + + +# **getVersions** +> VersionsResponse getVersions() + +Get Server versions + +This endpoint returns various version numbers pertaining to the server. + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.VersionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + VersionsApi apiInstance = new VersionsApi(defaultClient); + try { + VersionsResponse result = apiInstance.getVersions(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling VersionsApi#getVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**VersionsResponse**](VersionsResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Retrieved server versions | - | +| **0** | error response | - | + diff --git a/docs/VersionsResponse.md b/docs/VersionsResponse.md new file mode 100644 index 0000000..ff81580 --- /dev/null +++ b/docs/VersionsResponse.md @@ -0,0 +1,14 @@ + + +# VersionsResponse + +Object for versions response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Versions**](Versions.md) | | | + + + diff --git a/docs/Workspace.md b/docs/Workspace.md new file mode 100644 index 0000000..f6f2def --- /dev/null +++ b/docs/Workspace.md @@ -0,0 +1,21 @@ + + +# Workspace + +The response object of the GetWorkspace endpoint + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**workspaceId** | **String** | The workspace's ID | | +|**imageId** | **String** | The image's ID | [optional] | +|**name** | **String** | workspace name | | +|**createdBy** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**description** | **String** | Workspace description | [optional] | +|**self** | [**WorkspaceUser**](WorkspaceUser.md) | | | +|**createdAt** | **OffsetDateTime** | Datetime workspace was created in UTC | | +|**updatedAt** | **OffsetDateTime** | Datetime workspace was updated in UTC | [optional] | + + + diff --git a/docs/WorkspaceCreateRequest.md b/docs/WorkspaceCreateRequest.md new file mode 100644 index 0000000..2373c8f --- /dev/null +++ b/docs/WorkspaceCreateRequest.md @@ -0,0 +1,18 @@ + + +# WorkspaceCreateRequest + +object metadata for a workspace that will be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | workspace name | | +|**description** | **String** | Workspace description | [optional] | +|**image** | **String** | Image data in the form data:image/png;base64,iVBORw0KGgoAAAA | [optional] | +|**defaultCredential** | [**CredentialCreateRequest**](CredentialCreateRequest.md) | | | +|**defaultStorageSetting** | [**StorageSettingsCreateRequest**](StorageSettingsCreateRequest.md) | | | + + + diff --git a/docs/WorkspaceCreateResponse.md b/docs/WorkspaceCreateResponse.md new file mode 100644 index 0000000..d6998ac --- /dev/null +++ b/docs/WorkspaceCreateResponse.md @@ -0,0 +1,14 @@ + + +# WorkspaceCreateResponse + +object for create workspace response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Workspace**](Workspace.md) | | | + + + diff --git a/docs/WorkspaceGetResponse.md b/docs/WorkspaceGetResponse.md new file mode 100644 index 0000000..8ddfc46 --- /dev/null +++ b/docs/WorkspaceGetResponse.md @@ -0,0 +1,14 @@ + + +# WorkspaceGetResponse + +object for get workspace response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Workspace**](Workspace.md) | | | + + + diff --git a/docs/WorkspaceRole.md b/docs/WorkspaceRole.md new file mode 100644 index 0000000..76879d4 --- /dev/null +++ b/docs/WorkspaceRole.md @@ -0,0 +1,15 @@ + + +# WorkspaceRole + +## Enum + + +* `OWNER` (value: `"owner"`) + +* `ADMIN` (value: `"admin"`) + +* `MEMBER` (value: `"member"`) + + + diff --git a/docs/WorkspaceUpdateRequest.md b/docs/WorkspaceUpdateRequest.md new file mode 100644 index 0000000..0eab515 --- /dev/null +++ b/docs/WorkspaceUpdateRequest.md @@ -0,0 +1,16 @@ + + +# WorkspaceUpdateRequest + +The workspace update object of the UpdateWorkspace endpoint + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | workspace name | [optional] | +|**image** | **String** | Image data in the form data:image/png;base64,iVBORw0KGgoAAAA | [optional] | +|**description** | **String** | Workspace description | [optional] | + + + diff --git a/docs/WorkspaceUser.md b/docs/WorkspaceUser.md new file mode 100644 index 0000000..86ed1c6 --- /dev/null +++ b/docs/WorkspaceUser.md @@ -0,0 +1,22 @@ + + +# WorkspaceUser + +The workspace user object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**username** | **String** | The user's username | | +|**displayName** | **String** | The user's display name | | +|**email** | **String** | The user's email | | +|**imageId** | **String** | The image's ID | [optional] | +|**role** | **WorkspaceRole** | | | +|**addedBy** | **String** | The user's ID | | +|**createdAt** | **OffsetDateTime** | Datetime workspace user was created in UTC | | +|**deletedAt** | **OffsetDateTime** | Datetime workspace user was deleted in UTC | [optional] | + + + diff --git a/docs/WorkspaceUserGetResponse.md b/docs/WorkspaceUserGetResponse.md new file mode 100644 index 0000000..8ce6188 --- /dev/null +++ b/docs/WorkspaceUserGetResponse.md @@ -0,0 +1,14 @@ + + +# WorkspaceUserGetResponse + +The response object when requesting a single workspace user + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**WorkspaceUser**](WorkspaceUser.md) | | | + + + diff --git a/docs/WorkspaceUserUpdateRequest.md b/docs/WorkspaceUserUpdateRequest.md new file mode 100644 index 0000000..18b710c --- /dev/null +++ b/docs/WorkspaceUserUpdateRequest.md @@ -0,0 +1,14 @@ + + +# WorkspaceUserUpdateRequest + +The request object for updating a single workspace users + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**role** | **WorkspaceRole** | | | + + + diff --git a/docs/WorkspaceUsersBulkUpdateRequestInner.md b/docs/WorkspaceUsersBulkUpdateRequestInner.md new file mode 100644 index 0000000..2100e71 --- /dev/null +++ b/docs/WorkspaceUsersBulkUpdateRequestInner.md @@ -0,0 +1,15 @@ + + +# WorkspaceUsersBulkUpdateRequestInner + +The workspace user update object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**role** | **WorkspaceRole** | | | + + + diff --git a/docs/WorkspaceUsersCreateRequestInner.md b/docs/WorkspaceUsersCreateRequestInner.md new file mode 100644 index 0000000..f359a05 --- /dev/null +++ b/docs/WorkspaceUsersCreateRequestInner.md @@ -0,0 +1,15 @@ + + +# WorkspaceUsersCreateRequestInner + +The workspace user that should be created + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | The user's ID | | +|**role** | **WorkspaceRole** | | | + + + diff --git a/docs/WorkspaceUsersCreateResponse.md b/docs/WorkspaceUsersCreateResponse.md new file mode 100644 index 0000000..b66f035 --- /dev/null +++ b/docs/WorkspaceUsersCreateResponse.md @@ -0,0 +1,14 @@ + + +# WorkspaceUsersCreateResponse + +The response object when creating multiple workspace users + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<WorkspaceUser>**](WorkspaceUser.md) | An array of workspace users that were created | | + + + diff --git a/docs/WorkspaceUsersListResponse.md b/docs/WorkspaceUsersListResponse.md new file mode 100644 index 0000000..3199eca --- /dev/null +++ b/docs/WorkspaceUsersListResponse.md @@ -0,0 +1,15 @@ + + +# WorkspaceUsersListResponse + +The response object when requesting multiple workspace users + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<WorkspaceUser>**](WorkspaceUser.md) | An array of workspace users | | +|**paginationMetadata** | [**PaginationMetadata**](PaginationMetadata.md) | | [optional] | + + + diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md new file mode 100644 index 0000000..51318b2 --- /dev/null +++ b/docs/WorkspacesApi.md @@ -0,0 +1,910 @@ +# WorkspacesApi + +All URIs are relative to *https://api.tiledb.com/v4* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createWorkspace**](WorkspacesApi.md#createWorkspace) | **POST** /workspaces | Create a workspace | +| [**createWorkspaceUsers**](WorkspacesApi.md#createWorkspaceUsers) | **POST** /workspaceusers/{workspace} | Create one or more workspace users | +| [**deleteWorkspace**](WorkspacesApi.md#deleteWorkspace) | **DELETE** /workspaces/{workspace} | Delete a workspace | +| [**deleteWorkspaceUser**](WorkspacesApi.md#deleteWorkspaceUser) | **DELETE** /workspaceusers/{workspace}/{user_id} | Delete a workspace user | +| [**deleteWorkspaceUsers**](WorkspacesApi.md#deleteWorkspaceUsers) | **POST** /actions/workspaces/{workspace}/users/bulk_delete | Delete the given workspace users in a workspace | +| [**getWorkspace**](WorkspacesApi.md#getWorkspace) | **GET** /workspaces/{workspace} | Retrieves metadata for the given workspace | +| [**getWorkspaceUser**](WorkspacesApi.md#getWorkspaceUser) | **GET** /workspaceusers/{workspace}/{user_id} | Retrieve a workspace user | +| [**listWorkspaceUsers**](WorkspacesApi.md#listWorkspaceUsers) | **GET** /workspaceusers/{workspace} | Retrieve multiple workspace users | +| [**updateWorkspace**](WorkspacesApi.md#updateWorkspace) | **PATCH** /workspaces/{workspace} | Update a workspace | +| [**updateWorkspaceUser**](WorkspacesApi.md#updateWorkspaceUser) | **PATCH** /workspaceusers/{workspace}/{user_id} | Update a workspace user | +| [**updateWorkspaceUsers**](WorkspacesApi.md#updateWorkspaceUsers) | **POST** /actions/workspaces/{workspace}/users/bulk_update | Update multiple workspace users in a workspace | + + + +# **createWorkspace** +> WorkspaceCreateResponse createWorkspace(workspaceCreateRequest) + +Create a workspace + +create a workspace, the user creating will be listed as owner + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + WorkspaceCreateRequest workspaceCreateRequest = new WorkspaceCreateRequest(); // WorkspaceCreateRequest | workspace to create + try { + WorkspaceCreateResponse result = apiInstance.createWorkspace(workspaceCreateRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#createWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspaceCreateRequest** | [**WorkspaceCreateRequest**](WorkspaceCreateRequest.md)| workspace to create | | + +### Return type + +[**WorkspaceCreateResponse**](WorkspaceCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Successful workspace response | - | +| **0** | error response | - | + + +# **createWorkspaceUsers** +> WorkspaceUsersCreateResponse createWorkspaceUsers(workspace, workspaceUsersCreateRequestInner) + +Create one or more workspace users + +Create one or more workspace users + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + List workspaceUsersCreateRequestInner = Arrays.asList(); // List | The request body containing the workspace users to create + try { + WorkspaceUsersCreateResponse result = apiInstance.createWorkspaceUsers(workspace, workspaceUsersCreateRequestInner); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#createWorkspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **workspaceUsersCreateRequestInner** | [**List<WorkspaceUsersCreateRequestInner>**](WorkspaceUsersCreateRequestInner.md)| The request body containing the workspace users to create | | + +### Return type + +[**WorkspaceUsersCreateResponse**](WorkspaceUsersCreateResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Workspace user(s) created | - | +| **0** | An error occurred | - | + + +# **deleteWorkspace** +> deleteWorkspace(workspace) + +Delete a workspace + +delete a workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + try { + apiInstance.deleteWorkspace(workspace); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#deleteWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | workspace deleted | - | +| **0** | error response | - | + + +# **deleteWorkspaceUser** +> deleteWorkspaceUser(workspace, userId) + +Delete a workspace user + +Delete the given workspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + try { + apiInstance.deleteWorkspaceUser(workspace, userId); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#deleteWorkspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Workspace user deleted | - | +| **404** | Workspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **deleteWorkspaceUsers** +> deleteWorkspaceUsers(workspace, requestBody) + +Delete the given workspace users in a workspace + +Delete the given workspace users in a workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + List requestBody = Arrays.asList(); // List | The request body containing the workspace users to delete + try { + apiInstance.deleteWorkspaceUsers(workspace, requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#deleteWorkspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **requestBody** | [**List<String>**](String.md)| The request body containing the workspace users to delete | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Workspace users deleted | - | +| **404** | One or more of the given workspace users do not exist | - | +| **0** | An error occurred | - | + + +# **getWorkspace** +> WorkspaceGetResponse getWorkspace(workspace) + +Retrieves metadata for the given workspace + +End point to retrieve metadata for the passed workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + try { + WorkspaceGetResponse result = apiInstance.getWorkspace(workspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#getWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | + +### Return type + +[**WorkspaceGetResponse**](WorkspaceGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful workspace response | - | +| **404** | Workspace does not exist | - | +| **0** | error response | - | + + +# **getWorkspaceUser** +> WorkspaceUserGetResponse getWorkspaceUser(workspace, userId) + +Retrieve a workspace user + +Retrieve the given workspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + try { + WorkspaceUserGetResponse result = apiInstance.getWorkspaceUser(workspace, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#getWorkspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | + +### Return type + +[**WorkspaceUserGetResponse**](WorkspaceUserGetResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Workspace user retrieved | - | +| **404** | Workspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **listWorkspaceUsers** +> WorkspaceUsersListResponse listWorkspaceUsers(workspace, page, perPage, search) + +Retrieve multiple workspace users + +Retrieve a list of workspace users + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String search = "search_example"; // String | Search filter to find users by username or email + try { + WorkspaceUsersListResponse result = apiInstance.listWorkspaceUsers(workspace, page, perPage, search); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#listWorkspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **page** | **Integer**| pagination offset | [optional] | +| **perPage** | **Integer**| pagination limit | [optional] | +| **search** | **String**| Search filter to find users by username or email | [optional] | + +### Return type + +[**WorkspaceUsersListResponse**](WorkspaceUsersListResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Workspace user(s) list retrieved | - | +| **404** | Workspace ID does not exist | - | +| **0** | An error occurred | - | + + +# **updateWorkspace** +> updateWorkspace(workspace, workspaceUpdateRequest) + +Update a workspace + +update a workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + WorkspaceUpdateRequest workspaceUpdateRequest = new WorkspaceUpdateRequest(); // WorkspaceUpdateRequest | workspaceUpdateDetails + try { + apiInstance.updateWorkspace(workspace, workspaceUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#updateWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **workspaceUpdateRequest** | [**WorkspaceUpdateRequest**](WorkspaceUpdateRequest.md)| workspaceUpdateDetails | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | workspace updated | - | +| **0** | error response | - | + + +# **updateWorkspaceUser** +> updateWorkspaceUser(workspace, userId, workspaceUserUpdateRequest) + +Update a workspace user + +Update the given workspace user + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + String userId = "userId_example"; // String | The user id in the form usr_9m4e2mr0ui3e8a215n4g + WorkspaceUserUpdateRequest workspaceUserUpdateRequest = new WorkspaceUserUpdateRequest(); // WorkspaceUserUpdateRequest | The request body containing the workspace user to update + try { + apiInstance.updateWorkspaceUser(workspace, userId, workspaceUserUpdateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#updateWorkspaceUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **userId** | **String**| The user id in the form usr_9m4e2mr0ui3e8a215n4g | | +| **workspaceUserUpdateRequest** | [**WorkspaceUserUpdateRequest**](WorkspaceUserUpdateRequest.md)| The request body containing the workspace user to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Workspace user updated | - | +| **404** | Workspace user ID does not exist | - | +| **0** | An error occurred | - | + + +# **updateWorkspaceUsers** +> updateWorkspaceUsers(workspace, workspaceUsersBulkUpdateRequestInner) + +Update multiple workspace users in a workspace + +Update multiple workspace users in a workspace + +### Example +```java +// Import classes: +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.auth.*; +import io.tiledb.cloud.rest_api.v4.models.*; +import io.tiledb.cloud.rest_api.v4.api.WorkspacesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.tiledb.com/v4"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure HTTP basic authorization: BasicAuth + HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); + BasicAuth.setUsername("YOUR USERNAME"); + BasicAuth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + String workspace = "ws_9m4e2mr0ui3e8a215n4g"; // String | The workspace name or id + List workspaceUsersBulkUpdateRequestInner = Arrays.asList(); // List | The request body containing the workspace users to update + try { + apiInstance.updateWorkspaceUsers(workspace, workspaceUsersBulkUpdateRequestInner); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#updateWorkspaceUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **workspace** | **String**| The workspace name or id | | +| **workspaceUsersBulkUpdateRequestInner** | [**List<WorkspaceUsersBulkUpdateRequestInner>**](WorkspaceUsersBulkUpdateRequestInner.md)| The request body containing the workspace users to update | | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2), [BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Workspace users updated successfully | - | +| **0** | An error occurred | - | + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9623276..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5343d5e --- /dev/null +++ b/pom.xml @@ -0,0 +1,345 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 0.0.1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.6.1 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.2 + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.9.0 + 4.12.0 + 2.10.1 + 3.18.0 + 0.2.6 + 1.3.5 + 2.0.2 + 5.10.3 + 1.10.0 + 2.1.6 + 1.1.1 + UTF-8 + 2.43.0 + + diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml deleted file mode 100644 index 5648d96..0000000 --- a/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ApiCallback.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiCallback.java new file mode 100644 index 0000000..bcd4237 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ApiClient.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiClient.java new file mode 100644 index 0000000..29abe27 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiClient.java @@ -0,0 +1,1708 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.tiledb.cloud.rest_api.v4.auth.Authentication; +import io.tiledb.cloud.rest_api.v4.auth.HttpBasicAuth; +import io.tiledb.cloud.rest_api.v4.auth.HttpBearerAuth; +import io.tiledb.cloud.rest_api.v4.auth.ApiKeyAuth; +import io.tiledb.cloud.rest_api.v4.auth.OAuth; +import io.tiledb.cloud.rest_api.v4.auth.RetryingOAuth; +import io.tiledb.cloud.rest_api.v4.auth.OAuthFlow; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + protected String basePath = "https://api.tiledb.com/v4"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "{protocol}://{host}{basePath}", + "Dynamic server URL", + new HashMap() {{ + put("protocol", new ServerVariable( + "No description provided", + "https", + new HashSet( + Arrays.asList( + "http", + "https" + ) + ) + )); + put("host", new ServerVariable( + "No description provided", + "api.tiledb.com", + new HashSet( + ) + )); + put("basePath", new ServerVariable( + "No description provided", + "/v4", + new HashSet( + ) + )); + }} + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected boolean debugging = false; + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String tempFolderPath = null; + + protected Map authentications; + + protected DateFormat dateFormat; + protected DateFormat datetimeFormat; + protected boolean lenientDatetimeFormat; + protected int dateLength; + + protected InputStream sslCaCert; + protected boolean verifyingSsl; + protected KeyManager[] keyManagers; + + protected OkHttpClient httpClient; + protected JSON json; + + protected HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("BasicAuth", new HttpBasicAuth()); + authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + authentications.put("OAuth2", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("BasicAuth", new HttpBasicAuth()); + authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + authentications.put("OAuth2", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID + */ + public ApiClient(String clientId) { + this(clientId, null, null); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, Map parameters) { + this(clientId, null, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, String clientSecret, Map parameters) { + this(null, clientId, clientSecret, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { + init(); + if (basePath != null) { + this.basePath = basePath; + } + + String tokenUrl = "https://oauth2.tiledb.com/oauth2/token"; + if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { + URI uri = URI.create(getBasePath()); + tokenUrl = uri.getScheme() + ":" + + (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + + tokenUrl; + if (!URI.create(tokenUrl).isAbsolute()) { + throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); + } + } + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.ACCESS_CODE, clientSecret, parameters); + authentications.put( + "OAuth2", + retryingOAuth + ); + initHttpClient(Collections.singletonList(retryingOAuth)); + // Setup authentications (key: authentication name, value: authentication). + authentications.put("BasicAuth", new HttpBasicAuth()); + authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + protected void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + protected void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + protected void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/0.0.1/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://api.tiledb.com/v4 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.tiledb.cloud.rest_api.v4.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link io.tiledb.cloud.rest_api.v4.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.tiledb.cloud.rest_api.v4.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link io.tiledb.cloud.rest_api.v4.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link io.tiledb.cloud.rest_api.v4.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * + * @return Token request builder + */ + public TokenRequestBuilder getTokenEndPoint() { + for (Authentication apiAuth : authentications.values()) { + if (apiAuth instanceof RetryingOAuth) { + RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; + return retryingOAuth.getTokenRequestBuilder(); + } + } + return null; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceFirst("^.*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + ResponseBody respBody = response.body(); + if (respBody == null) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + try { + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody.byteStream(), returnType); + } else if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Expecting string, return the raw response body. + return (T) respBodyString; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + response.body().string()); + } + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws io.tiledb.cloud.rest_api.v4.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List updatedQueryParams = new ArrayList<>(queryParams); + + // update parameters with authentication settings + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + protected void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + protected Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + protected void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws io.tiledb.cloud.rest_api.v4.ApiException If fail to serialize the request body object into a string + */ + protected String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ApiException.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiException.java new file mode 100644 index 0000000..bc677f3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiException.java @@ -0,0 +1,167 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ApiResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiResponse.java new file mode 100644 index 0000000..d5428e0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/Configuration.java b/src/main/java/io/tiledb/cloud/rest_api/v4/Configuration.java new file mode 100644 index 0000000..9a630a4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/Configuration.java @@ -0,0 +1,63 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Configuration { + public static final String VERSION = "0.0.1"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/GzipRequestInterceptor.java b/src/main/java/io/tiledb/cloud/rest_api/v4/GzipRequestInterceptor.java new file mode 100644 index 0000000..78467d2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/JSON.java b/src/main/java/io/tiledb/cloud/rest_api/v4/JSON.java new file mode 100644 index 0000000..bcc7099 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/JSON.java @@ -0,0 +1,574 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.APIToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AWSCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AWSRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AcademyLesson.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AcademyLessonsListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnaire.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnaireListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnairePutRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AccessCredentialRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ArrayInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Asset.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetMetadataListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetMetadataSaveRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetMetadataSaveResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetPathResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetRegisterRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AssetsMoveRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AzureCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.AzureToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ChangePasswordRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CommonPrefix.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Credential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CredentialCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CredentialGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CredentialUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CredentialsListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.CredentialsVerifyRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.DataChangeFile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.DataChangeFileAdd.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.DataChangeFileRemove.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Error.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ErrorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ErrorXML.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FileInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FileListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Folder.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderContentsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderCreateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FolderUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.FoldersContentsModifyInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Format.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.GCPInteroperabilityCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.GCPServiceAccountKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Generalspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.GeneralspaceGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.GeneralspaceUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.GroupInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Invitation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationRespondRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationRetrieveRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationRetrieveResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationWorkspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationsCreateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationsCreateRequestWorkspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitationsListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.InvitingUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ListShareSchemaTablesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ListShareSchemasResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ListSharesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ListTablesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Metadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ModelFile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ModelObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.OnboardingGetItemsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.OnboardingGetItemsResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.OnboardingSetItemsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.PaginationMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Protocol.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.QueryTableChangeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.QueryTableRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.QueryTableResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.RequestEmailConfirmationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.RequestPasswordResetRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ResetPasswordRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.RestCapabilities.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Schema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaFieldArray.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaFieldArrayElementType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaFieldMap.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaFieldType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.SchemaItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ShareItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ShareResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSetting.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingsCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingsCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingsForTeamspaceCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.StorageSettingsListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TableItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TableMetadataResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Teamspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceDefaultCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUserGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUserUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersBulkUpdateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersCreateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersJoinResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspacesCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspacesCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TeamspacesListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TileDBVersion.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Token.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TokenCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TokenCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.TokenListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserAnswer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserSelfResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserSelfResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserSelfWorkspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Userspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserspaceGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.UserspaceUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ValidationError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.ValidationErrorField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Versions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.VersionsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.Workspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUserGetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUserUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersBulkUpdateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersCreateRequestInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersListResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Deserialize the given JSON InputStream to a Java object. + * + * @param Type + * @param inputStream The JSON InputStream + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(InputStream inputStream, Type returnType) throws IOException { + try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { + if (isLenientOnJson) { + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(reader, returnType); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/Pair.java b/src/main/java/io/tiledb/cloud/rest_api/v4/Pair.java new file mode 100644 index 0000000..979eb20 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/Pair.java @@ -0,0 +1,37 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressRequestBody.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressRequestBody.java new file mode 100644 index 0000000..14a9039 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressResponseBody.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressResponseBody.java new file mode 100644 index 0000000..58ecbed --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ServerConfiguration.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ServerConfiguration.java new file mode 100644 index 0000000..0c86c1c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/ServerVariable.java b/src/main/java/io/tiledb/cloud/rest_api/v4/ServerVariable.java new file mode 100644 index 0000000..808434b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/StringUtil.java b/src/main/java/io/tiledb/cloud/rest_api/v4/StringUtil.java new file mode 100644 index 0000000..4c923dd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/AcademyApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/AcademyApi.java new file mode 100644 index 0000000..b2f3862 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/AcademyApi.java @@ -0,0 +1,599 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.AcademyLesson; +import io.tiledb.cloud.rest_api.v4.model.AcademyLessonsListResponse; +import io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnaireListResponse; +import io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnairePutRequest; +import io.tiledb.cloud.rest_api.v4.model.Error; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AcademyApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AcademyApi() { + this(Configuration.getDefaultApiClient()); + } + + public AcademyApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getAcademyLessons + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Academy lessons -
0 error response -
+ */ + public okhttp3.Call getAcademyLessonsCall(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 = "/academy/lessons"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAcademyLessonsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAcademyLessonsCall(_callback); + + } + + /** + * Get information about user lessons + * Get a list of user lessons with details about each of them + * @return AcademyLessonsListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Academy lessons -
0 error response -
+ */ + public AcademyLessonsListResponse getAcademyLessons() throws ApiException { + ApiResponse localVarResp = getAcademyLessonsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get information about user lessons + * Get a list of user lessons with details about each of them + * @return ApiResponse<AcademyLessonsListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Academy lessons -
0 error response -
+ */ + public ApiResponse getAcademyLessonsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAcademyLessonsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get information about user lessons (asynchronously) + * Get a list of user lessons with details about each of them + * @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 + + + + + +
Response Details
Status Code Description Response Headers
200 Academy lessons -
0 error response -
+ */ + public okhttp3.Call getAcademyLessonsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAcademyLessonsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAcademyQuestionnaire + * @param questionnaireId questionnaire's id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful academy questionnaire response -
404 answers not found -
0 error response -
+ */ + public okhttp3.Call getAcademyQuestionnaireCall(@javax.annotation.Nonnull String questionnaireId, 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 = "/academy/questionnaires/{questionnaire_id}" + .replace("{" + "questionnaire_id" + "}", localVarApiClient.escapeString(questionnaireId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAcademyQuestionnaireValidateBeforeCall(@javax.annotation.Nonnull String questionnaireId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'questionnaireId' is set + if (questionnaireId == null) { + throw new ApiException("Missing the required parameter 'questionnaireId' when calling getAcademyQuestionnaire(Async)"); + } + + return getAcademyQuestionnaireCall(questionnaireId, _callback); + + } + + /** + * Get academy questionnaire information for user + * Get academy questionnaire information for user. For example, questionnaire version, completion status and user answers + * @param questionnaireId questionnaire's id (required) + * @return AcademyQuestionnaireListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful academy questionnaire response -
404 answers not found -
0 error response -
+ */ + public AcademyQuestionnaireListResponse getAcademyQuestionnaire(@javax.annotation.Nonnull String questionnaireId) throws ApiException { + ApiResponse localVarResp = getAcademyQuestionnaireWithHttpInfo(questionnaireId); + return localVarResp.getData(); + } + + /** + * Get academy questionnaire information for user + * Get academy questionnaire information for user. For example, questionnaire version, completion status and user answers + * @param questionnaireId questionnaire's id (required) + * @return ApiResponse<AcademyQuestionnaireListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful academy questionnaire response -
404 answers not found -
0 error response -
+ */ + public ApiResponse getAcademyQuestionnaireWithHttpInfo(@javax.annotation.Nonnull String questionnaireId) throws ApiException { + okhttp3.Call localVarCall = getAcademyQuestionnaireValidateBeforeCall(questionnaireId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get academy questionnaire information for user (asynchronously) + * Get academy questionnaire information for user. For example, questionnaire version, completion status and user answers + * @param questionnaireId questionnaire's id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful academy questionnaire response -
404 answers not found -
0 error response -
+ */ + public okhttp3.Call getAcademyQuestionnaireAsync(@javax.annotation.Nonnull String questionnaireId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAcademyQuestionnaireValidateBeforeCall(questionnaireId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for putAcademyLessons + * @param academyLesson Academy lesson to create (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 + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public okhttp3.Call putAcademyLessonsCall(@javax.annotation.Nonnull List academyLesson, 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 = academyLesson; + + // create path and map variables + String localVarPath = "/academy/lessons"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call putAcademyLessonsValidateBeforeCall(@javax.annotation.Nonnull List academyLesson, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'academyLesson' is set + if (academyLesson == null) { + throw new ApiException("Missing the required parameter 'academyLesson' when calling putAcademyLessons(Async)"); + } + + return putAcademyLessonsCall(academyLesson, _callback); + + } + + /** + * Academy lessons to create + * Create one or more user lessons + * @param academyLesson Academy lesson to create (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public void putAcademyLessons(@javax.annotation.Nonnull List academyLesson) throws ApiException { + putAcademyLessonsWithHttpInfo(academyLesson); + } + + /** + * Academy lessons to create + * Create one or more user lessons + * @param academyLesson Academy lesson to create (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public ApiResponse putAcademyLessonsWithHttpInfo(@javax.annotation.Nonnull List academyLesson) throws ApiException { + okhttp3.Call localVarCall = putAcademyLessonsValidateBeforeCall(academyLesson, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Academy lessons to create (asynchronously) + * Create one or more user lessons + * @param academyLesson Academy lesson to create (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 + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public okhttp3.Call putAcademyLessonsAsync(@javax.annotation.Nonnull List academyLesson, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = putAcademyLessonsValidateBeforeCall(academyLesson, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for putAcademyQuestionnaire + * @param questionnaireId questionnaire's id (required) + * @param academyQuestionnairePutRequest academy lesson to create (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 + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public okhttp3.Call putAcademyQuestionnaireCall(@javax.annotation.Nonnull String questionnaireId, @javax.annotation.Nonnull AcademyQuestionnairePutRequest academyQuestionnairePutRequest, 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 = academyQuestionnairePutRequest; + + // create path and map variables + String localVarPath = "/academy/questionnaires/{questionnaire_id}" + .replace("{" + "questionnaire_id" + "}", localVarApiClient.escapeString(questionnaireId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call putAcademyQuestionnaireValidateBeforeCall(@javax.annotation.Nonnull String questionnaireId, @javax.annotation.Nonnull AcademyQuestionnairePutRequest academyQuestionnairePutRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'questionnaireId' is set + if (questionnaireId == null) { + throw new ApiException("Missing the required parameter 'questionnaireId' when calling putAcademyQuestionnaire(Async)"); + } + + // verify the required parameter 'academyQuestionnairePutRequest' is set + if (academyQuestionnairePutRequest == null) { + throw new ApiException("Missing the required parameter 'academyQuestionnairePutRequest' when calling putAcademyQuestionnaire(Async)"); + } + + return putAcademyQuestionnaireCall(questionnaireId, academyQuestionnairePutRequest, _callback); + + } + + /** + * Create or update academy questionnaire + * Create a new questionnaire or update an existing one + * @param questionnaireId questionnaire's id (required) + * @param academyQuestionnairePutRequest academy lesson to create (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public void putAcademyQuestionnaire(@javax.annotation.Nonnull String questionnaireId, @javax.annotation.Nonnull AcademyQuestionnairePutRequest academyQuestionnairePutRequest) throws ApiException { + putAcademyQuestionnaireWithHttpInfo(questionnaireId, academyQuestionnairePutRequest); + } + + /** + * Create or update academy questionnaire + * Create a new questionnaire or update an existing one + * @param questionnaireId questionnaire's id (required) + * @param academyQuestionnairePutRequest academy lesson to create (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public ApiResponse putAcademyQuestionnaireWithHttpInfo(@javax.annotation.Nonnull String questionnaireId, @javax.annotation.Nonnull AcademyQuestionnairePutRequest academyQuestionnairePutRequest) throws ApiException { + okhttp3.Call localVarCall = putAcademyQuestionnaireValidateBeforeCall(questionnaireId, academyQuestionnairePutRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create or update academy questionnaire (asynchronously) + * Create a new questionnaire or update an existing one + * @param questionnaireId questionnaire's id (required) + * @param academyQuestionnairePutRequest academy lesson to create (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 + + + + + +
Response Details
Status Code Description Response Headers
200 create or update success -
0 error response -
+ */ + public okhttp3.Call putAcademyQuestionnaireAsync(@javax.annotation.Nonnull String questionnaireId, @javax.annotation.Nonnull AcademyQuestionnairePutRequest academyQuestionnairePutRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = putAcademyQuestionnaireValidateBeforeCall(questionnaireId, academyQuestionnairePutRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/AssetsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/AssetsApi.java new file mode 100644 index 0000000..d5417c0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/AssetsApi.java @@ -0,0 +1,1613 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.AssetGetResponse; +import io.tiledb.cloud.rest_api.v4.model.AssetListResponse; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadataListResponse; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadataSaveRequestInner; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadataSaveResponse; +import io.tiledb.cloud.rest_api.v4.model.AssetPathResponse; +import io.tiledb.cloud.rest_api.v4.model.AssetRegisterRequest; +import io.tiledb.cloud.rest_api.v4.model.AssetType; +import io.tiledb.cloud.rest_api.v4.model.AssetUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.AssetsMoveRequest; +import io.tiledb.cloud.rest_api.v4.model.Error; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AssetsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AssetsApi() { + this(Configuration.getDefaultApiClient()); + } + + public AssetsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteAssetMetadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param metadataKey One or more metadata keys to delete (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Asset metadata deleted -
0 Error response -
+ */ + public okhttp3.Call deleteAssetMetadataCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List metadataKey, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, 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 = "/assets/item/{workspace}/{teamspace}/{asset}/metadata" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_timestamp", startTimestamp)); + } + + if (endTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_timestamp", endTimestamp)); + } + + if (metadataKey != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "metadata_key", metadataKey)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAssetMetadataValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List metadataKey, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteAssetMetadata(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling deleteAssetMetadata(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling deleteAssetMetadata(Async)"); + } + + // verify the required parameter 'metadataKey' is set + if (metadataKey == null) { + throw new ApiException("Missing the required parameter 'metadataKey' when calling deleteAssetMetadata(Async)"); + } + + return deleteAssetMetadataCall(workspace, teamspace, asset, metadataKey, startTimestamp, endTimestamp, _callback); + + } + + /** + * Delete asset metadata + * Delete one or more metadata keys for the given asset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param metadataKey One or more metadata keys to delete (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Asset metadata deleted -
0 Error response -
+ */ + public void deleteAssetMetadata(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List metadataKey, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp) throws ApiException { + deleteAssetMetadataWithHttpInfo(workspace, teamspace, asset, metadataKey, startTimestamp, endTimestamp); + } + + /** + * Delete asset metadata + * Delete one or more metadata keys for the given asset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param metadataKey One or more metadata keys to delete (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Asset metadata deleted -
0 Error response -
+ */ + public ApiResponse deleteAssetMetadataWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List metadataKey, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp) throws ApiException { + okhttp3.Call localVarCall = deleteAssetMetadataValidateBeforeCall(workspace, teamspace, asset, metadataKey, startTimestamp, endTimestamp, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete asset metadata (asynchronously) + * Delete one or more metadata keys for the given asset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param metadataKey One or more metadata keys to delete (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Asset metadata deleted -
0 Error response -
+ */ + public okhttp3.Call deleteAssetMetadataAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List metadataKey, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAssetMetadataValidateBeforeCall(workspace, teamspace, asset, metadataKey, startTimestamp, endTimestamp, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getAsset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset retrieved -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, 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 = "/assets/item/{workspace}/{teamspace}/{asset}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAssetValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getAsset(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getAsset(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling getAsset(Async)"); + } + + return getAssetCall(workspace, teamspace, asset, _callback); + + } + + /** + * Retrieve asset + * Retrieve the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @return AssetGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset retrieved -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public AssetGetResponse getAsset(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset) throws ApiException { + ApiResponse localVarResp = getAssetWithHttpInfo(workspace, teamspace, asset); + return localVarResp.getData(); + } + + /** + * Retrieve asset + * Retrieve the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @return ApiResponse<AssetGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset retrieved -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public ApiResponse getAssetWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset) throws ApiException { + okhttp3.Call localVarCall = getAssetValidateBeforeCall(workspace, teamspace, asset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve asset (asynchronously) + * Retrieve the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset retrieved -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAssetValidateBeforeCall(workspace, teamspace, asset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAssetMetadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset metadata retrieved -
404 Asset ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetMetadataCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, 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 = "/assets/item/{workspace}/{teamspace}/{asset}/metadata" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_timestamp", startTimestamp)); + } + + if (endTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_timestamp", endTimestamp)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAssetMetadataValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getAssetMetadata(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getAssetMetadata(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling getAssetMetadata(Async)"); + } + + return getAssetMetadataCall(workspace, teamspace, asset, startTimestamp, endTimestamp, page, perPage, _callback); + + } + + /** + * Retrieve asset's metadata + * Retrieve the given asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return AssetMetadataListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset metadata retrieved -
404 Asset ID does not exist -
0 An error occurred -
+ */ + public AssetMetadataListResponse getAssetMetadata(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + ApiResponse localVarResp = getAssetMetadataWithHttpInfo(workspace, teamspace, asset, startTimestamp, endTimestamp, page, perPage); + return localVarResp.getData(); + } + + /** + * Retrieve asset's metadata + * Retrieve the given asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<AssetMetadataListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset metadata retrieved -
404 Asset ID does not exist -
0 An error occurred -
+ */ + public ApiResponse getAssetMetadataWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + okhttp3.Call localVarCall = getAssetMetadataValidateBeforeCall(workspace, teamspace, asset, startTimestamp, endTimestamp, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve asset's metadata (asynchronously) + * Retrieve the given asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset metadata retrieved -
404 Asset ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetMetadataAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAssetMetadataValidateBeforeCall(workspace, teamspace, asset, startTimestamp, endTimestamp, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAssetsInPath + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets in path retrieved -
404 One or more of the given path components do not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetsInPathCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, 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 = "/assets/path/{workspace}/{teamspace}/{path}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "path" + "}", localVarApiClient.escapeString(path.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAssetsInPathValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getAssetsInPath(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getAssetsInPath(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling getAssetsInPath(Async)"); + } + + return getAssetsInPathCall(workspace, teamspace, path, _callback); + + } + + /** + * Retrieve all assets in a given path + * Retrieve all assets in a given path, e.g., a request for `/a/b/c` will return the assets `a`, `b`, and `c`. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @return AssetPathResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets in path retrieved -
404 One or more of the given path components do not exist -
0 An error occurred -
+ */ + public AssetPathResponse getAssetsInPath(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path) throws ApiException { + ApiResponse localVarResp = getAssetsInPathWithHttpInfo(workspace, teamspace, path); + return localVarResp.getData(); + } + + /** + * Retrieve all assets in a given path + * Retrieve all assets in a given path, e.g., a request for `/a/b/c` will return the assets `a`, `b`, and `c`. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @return ApiResponse<AssetPathResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets in path retrieved -
404 One or more of the given path components do not exist -
0 An error occurred -
+ */ + public ApiResponse getAssetsInPathWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path) throws ApiException { + okhttp3.Call localVarCall = getAssetsInPathValidateBeforeCall(workspace, teamspace, path, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve all assets in a given path (asynchronously) + * Retrieve all assets in a given path, e.g., a request for `/a/b/c` will return the assets `a`, `b`, and `c`. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets in path retrieved -
404 One or more of the given path components do not exist -
0 An error occurred -
+ */ + public okhttp3.Call getAssetsInPathAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAssetsInPathValidateBeforeCall(workspace, teamspace, path, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listAssets + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param assetType asset type to filter to (optional) + * @param createdBy users that created the asset to filter to (optional) + * @param orderBy order by string (optional) + * @param expand expand api response with supplemental information (optional) + * @param includeSystemAssets if true, system assets (like overlay arrays and groups) are returned (optional, default to false) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful asset listing response -
404 Teamspace not found -
0 error response -
+ */ + public okhttp3.Call listAssetsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable AssetType assetType, @javax.annotation.Nullable String createdBy, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String expand, @javax.annotation.Nullable Boolean includeSystemAssets, 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 = "/assets/list/{workspace}/{teamspace}/{path}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "path" + "}", localVarApiClient.escapeString(path.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + if (assetType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset_type", assetType)); + } + + if (createdBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("created_by", createdBy)); + } + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (expand != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); + } + + if (includeSystemAssets != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_system_assets", includeSystemAssets)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAssetsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable AssetType assetType, @javax.annotation.Nullable String createdBy, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String expand, @javax.annotation.Nullable Boolean includeSystemAssets, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listAssets(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling listAssets(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling listAssets(Async)"); + } + + return listAssetsCall(workspace, teamspace, path, page, perPage, assetType, createdBy, orderBy, expand, includeSystemAssets, _callback); + + } + + /** + * Retrieves asset listing for the given teamspace + * End point to retrieve assets for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param assetType asset type to filter to (optional) + * @param createdBy users that created the asset to filter to (optional) + * @param orderBy order by string (optional) + * @param expand expand api response with supplemental information (optional) + * @param includeSystemAssets if true, system assets (like overlay arrays and groups) are returned (optional, default to false) + * @return AssetListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful asset listing response -
404 Teamspace not found -
0 error response -
+ */ + public AssetListResponse listAssets(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable AssetType assetType, @javax.annotation.Nullable String createdBy, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String expand, @javax.annotation.Nullable Boolean includeSystemAssets) throws ApiException { + ApiResponse localVarResp = listAssetsWithHttpInfo(workspace, teamspace, path, page, perPage, assetType, createdBy, orderBy, expand, includeSystemAssets); + return localVarResp.getData(); + } + + /** + * Retrieves asset listing for the given teamspace + * End point to retrieve assets for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param assetType asset type to filter to (optional) + * @param createdBy users that created the asset to filter to (optional) + * @param orderBy order by string (optional) + * @param expand expand api response with supplemental information (optional) + * @param includeSystemAssets if true, system assets (like overlay arrays and groups) are returned (optional, default to false) + * @return ApiResponse<AssetListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful asset listing response -
404 Teamspace not found -
0 error response -
+ */ + public ApiResponse listAssetsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable AssetType assetType, @javax.annotation.Nullable String createdBy, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String expand, @javax.annotation.Nullable Boolean includeSystemAssets) throws ApiException { + okhttp3.Call localVarCall = listAssetsValidateBeforeCall(workspace, teamspace, path, page, perPage, assetType, createdBy, orderBy, expand, includeSystemAssets, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves asset listing for the given teamspace (asynchronously) + * End point to retrieve assets for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path for which to retrieve assets (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param assetType asset type to filter to (optional) + * @param createdBy users that created the asset to filter to (optional) + * @param orderBy order by string (optional) + * @param expand expand api response with supplemental information (optional) + * @param includeSystemAssets if true, system assets (like overlay arrays and groups) are returned (optional, default to false) + * @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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful asset listing response -
404 Teamspace not found -
0 error response -
+ */ + public okhttp3.Call listAssetsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable AssetType assetType, @javax.annotation.Nullable String createdBy, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String expand, @javax.annotation.Nullable Boolean includeSystemAssets, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listAssetsValidateBeforeCall(workspace, teamspace, path, page, perPage, assetType, createdBy, orderBy, expand, includeSystemAssets, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for moveAssets + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetsMoveRequest The assets move request body (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets moved successfully -
401 Unauthorized -
0 An unexpected error occurred -
+ */ + public okhttp3.Call moveAssetsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetsMoveRequest assetsMoveRequest, 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 = assetsMoveRequest; + + // create path and map variables + String localVarPath = "/assets/move/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call moveAssetsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetsMoveRequest assetsMoveRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling moveAssets(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling moveAssets(Async)"); + } + + // verify the required parameter 'assetsMoveRequest' is set + if (assetsMoveRequest == null) { + throw new ApiException("Missing the required parameter 'assetsMoveRequest' when calling moveAssets(Async)"); + } + + return moveAssetsCall(workspace, teamspace, assetsMoveRequest, _callback); + + } + + /** + * Move assets (array, group & files) + * Move assets (array, group & files) in the specified workspace and teamspace to a target folder. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetsMoveRequest The assets move request body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets moved successfully -
401 Unauthorized -
0 An unexpected error occurred -
+ */ + public void moveAssets(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetsMoveRequest assetsMoveRequest) throws ApiException { + moveAssetsWithHttpInfo(workspace, teamspace, assetsMoveRequest); + } + + /** + * Move assets (array, group & files) + * Move assets (array, group & files) in the specified workspace and teamspace to a target folder. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetsMoveRequest The assets move request body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets moved successfully -
401 Unauthorized -
0 An unexpected error occurred -
+ */ + public ApiResponse moveAssetsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetsMoveRequest assetsMoveRequest) throws ApiException { + okhttp3.Call localVarCall = moveAssetsValidateBeforeCall(workspace, teamspace, assetsMoveRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Move assets (array, group & files) (asynchronously) + * Move assets (array, group & files) in the specified workspace and teamspace to a target folder. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetsMoveRequest The assets move request body (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Assets moved successfully -
401 Unauthorized -
0 An unexpected error occurred -
+ */ + public okhttp3.Call moveAssetsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetsMoveRequest assetsMoveRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = moveAssetsValidateBeforeCall(workspace, teamspace, assetsMoveRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for registerAsset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetRegisterRequest The asset registration request body (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset registered successfully -
401 Unauthorized -
404 Resource not found -
0 An unexpected error occurred -
+ */ + public okhttp3.Call registerAssetCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetRegisterRequest assetRegisterRequest, 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 = assetRegisterRequest; + + // create path and map variables + String localVarPath = "/assets/register/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call registerAssetValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetRegisterRequest assetRegisterRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling registerAsset(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling registerAsset(Async)"); + } + + // verify the required parameter 'assetRegisterRequest' is set + if (assetRegisterRequest == null) { + throw new ApiException("Missing the required parameter 'assetRegisterRequest' when calling registerAsset(Async)"); + } + + return registerAssetCall(workspace, teamspace, assetRegisterRequest, _callback); + + } + + /** + * Register an asset (array, group & files) + * Register an asset for the given user in the specified workspace and teamspace. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetRegisterRequest The asset registration request body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset registered successfully -
401 Unauthorized -
404 Resource not found -
0 An unexpected error occurred -
+ */ + public void registerAsset(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetRegisterRequest assetRegisterRequest) throws ApiException { + registerAssetWithHttpInfo(workspace, teamspace, assetRegisterRequest); + } + + /** + * Register an asset (array, group & files) + * Register an asset for the given user in the specified workspace and teamspace. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetRegisterRequest The asset registration request body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset registered successfully -
401 Unauthorized -
404 Resource not found -
0 An unexpected error occurred -
+ */ + public ApiResponse registerAssetWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetRegisterRequest assetRegisterRequest) throws ApiException { + okhttp3.Call localVarCall = registerAssetValidateBeforeCall(workspace, teamspace, assetRegisterRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Register an asset (array, group & files) (asynchronously) + * Register an asset for the given user in the specified workspace and teamspace. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param assetRegisterRequest The asset registration request body (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 + + + + + + + +
Response Details
Status Code Description Response Headers
200 Asset registered successfully -
401 Unauthorized -
404 Resource not found -
0 An unexpected error occurred -
+ */ + public okhttp3.Call registerAssetAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull AssetRegisterRequest assetRegisterRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = registerAssetValidateBeforeCall(workspace, teamspace, assetRegisterRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateAsset + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetUpdateRequest (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Asset updated -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateAssetCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull AssetUpdateRequest assetUpdateRequest, 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 = assetUpdateRequest; + + // create path and map variables + String localVarPath = "/assets/item/{workspace}/{teamspace}/{asset}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAssetValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull AssetUpdateRequest assetUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateAsset(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateAsset(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling updateAsset(Async)"); + } + + // verify the required parameter 'assetUpdateRequest' is set + if (assetUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'assetUpdateRequest' when calling updateAsset(Async)"); + } + + return updateAssetCall(workspace, teamspace, asset, assetUpdateRequest, _callback); + + } + + /** + * Update asset + * Update the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetUpdateRequest (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Asset updated -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public void updateAsset(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull AssetUpdateRequest assetUpdateRequest) throws ApiException { + updateAssetWithHttpInfo(workspace, teamspace, asset, assetUpdateRequest); + } + + /** + * Update asset + * Update the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetUpdateRequest (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Asset updated -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public ApiResponse updateAssetWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull AssetUpdateRequest assetUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateAssetValidateBeforeCall(workspace, teamspace, asset, assetUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update asset (asynchronously) + * Update the asset by the given asset_id or path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetUpdateRequest (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Asset updated -
404 Asset ID or path does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateAssetAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull AssetUpdateRequest assetUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAssetValidateBeforeCall(workspace, teamspace, asset, assetUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateAssetMetadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetMetadataSaveRequestInner asset metadata pairs to update (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful asset metadata save response -
0 error response -
+ */ + public okhttp3.Call updateAssetMetadataCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List assetMetadataSaveRequestInner, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, 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 = assetMetadataSaveRequestInner; + + // create path and map variables + String localVarPath = "/assets/item/{workspace}/{teamspace}/{asset}/metadata" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_timestamp", startTimestamp)); + } + + if (endTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_timestamp", endTimestamp)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAssetMetadataValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List assetMetadataSaveRequestInner, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateAssetMetadata(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateAssetMetadata(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling updateAssetMetadata(Async)"); + } + + // verify the required parameter 'assetMetadataSaveRequestInner' is set + if (assetMetadataSaveRequestInner == null) { + throw new ApiException("Missing the required parameter 'assetMetadataSaveRequestInner' when calling updateAssetMetadata(Async)"); + } + + return updateAssetMetadataCall(workspace, teamspace, asset, assetMetadataSaveRequestInner, startTimestamp, endTimestamp, _callback); + + } + + /** + * Update the given asset's metadata pair + * Update asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetMetadataSaveRequestInner asset metadata pairs to update (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @return AssetMetadataSaveResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful asset metadata save response -
0 error response -
+ */ + public AssetMetadataSaveResponse updateAssetMetadata(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List assetMetadataSaveRequestInner, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp) throws ApiException { + ApiResponse localVarResp = updateAssetMetadataWithHttpInfo(workspace, teamspace, asset, assetMetadataSaveRequestInner, startTimestamp, endTimestamp); + return localVarResp.getData(); + } + + /** + * Update the given asset's metadata pair + * Update asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetMetadataSaveRequestInner asset metadata pairs to update (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @return ApiResponse<AssetMetadataSaveResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful asset metadata save response -
0 error response -
+ */ + public ApiResponse updateAssetMetadataWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List assetMetadataSaveRequestInner, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp) throws ApiException { + okhttp3.Call localVarCall = updateAssetMetadataValidateBeforeCall(workspace, teamspace, asset, assetMetadataSaveRequestInner, startTimestamp, endTimestamp, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update the given asset's metadata pair (asynchronously) + * Update asset's metadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param assetMetadataSaveRequestInner asset metadata pairs to update (required) + * @param startTimestamp Start timestamp in milliseconds since epoch (optional) + * @param endTimestamp End timestamp in milliseconds since epoch (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful asset metadata save response -
0 error response -
+ */ + public okhttp3.Call updateAssetMetadataAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull List assetMetadataSaveRequestInner, @javax.annotation.Nullable Integer startTimestamp, @javax.annotation.Nullable Integer endTimestamp, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAssetMetadataValidateBeforeCall(workspace, teamspace, asset, assetMetadataSaveRequestInner, startTimestamp, endTimestamp, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/CapabilitiesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/CapabilitiesApi.java new file mode 100644 index 0000000..91096f7 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/CapabilitiesApi.java @@ -0,0 +1,197 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.RestCapabilities; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CapabilitiesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CapabilitiesApi() { + this(Configuration.getDefaultApiClient()); + } + + public CapabilitiesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for handleGetCapabilities + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved REST capabilities -
0 error response -
+ */ + public okhttp3.Call handleGetCapabilitiesCall(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 = "/capabilities"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call handleGetCapabilitiesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return handleGetCapabilitiesCall(_callback); + + } + + /** + * Get REST capabilities + * Get REST capabilities + * @return RestCapabilities + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved REST capabilities -
0 error response -
+ */ + public RestCapabilities handleGetCapabilities() throws ApiException { + ApiResponse localVarResp = handleGetCapabilitiesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get REST capabilities + * Get REST capabilities + * @return ApiResponse<RestCapabilities> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved REST capabilities -
0 error response -
+ */ + public ApiResponse handleGetCapabilitiesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = handleGetCapabilitiesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get REST capabilities (asynchronously) + * Get REST capabilities + * @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 + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved REST capabilities -
0 error response -
+ */ + public okhttp3.Call handleGetCapabilitiesAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = handleGetCapabilitiesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/CredentialsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/CredentialsApi.java new file mode 100644 index 0000000..237c713 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/CredentialsApi.java @@ -0,0 +1,981 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.CloudProvider; +import io.tiledb.cloud.rest_api.v4.model.CredentialCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.CredentialGetResponse; +import io.tiledb.cloud.rest_api.v4.model.CredentialUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.CredentialsListResponse; +import io.tiledb.cloud.rest_api.v4.model.CredentialsVerifyRequest; +import io.tiledb.cloud.rest_api.v4.model.Error; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CredentialsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CredentialsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CredentialsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createCredential + * @param workspace The workspace name or id (required) + * @param credentialCreateRequest the new credentials to be created (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 The new credential was successfully added -
0 error response -
+ */ + public okhttp3.Call createCredentialCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull CredentialCreateRequest credentialCreateRequest, @javax.annotation.Nullable String teamspaceId, 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 = credentialCreateRequest; + + // create path and map variables + String localVarPath = "/credentials/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCredentialValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull CredentialCreateRequest credentialCreateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createCredential(Async)"); + } + + // verify the required parameter 'credentialCreateRequest' is set + if (credentialCreateRequest == null) { + throw new ApiException("Missing the required parameter 'credentialCreateRequest' when calling createCredential(Async)"); + } + + return createCredentialCall(workspace, credentialCreateRequest, teamspaceId, _callback); + + } + + /** + * Create a credential + * create a new credential, the user will create a new credential to access assets + * @param workspace The workspace name or id (required) + * @param credentialCreateRequest the new credentials to be created (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 The new credential was successfully added -
0 error response -
+ */ + public void createCredential(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull CredentialCreateRequest credentialCreateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + createCredentialWithHttpInfo(workspace, credentialCreateRequest, teamspaceId); + } + + /** + * Create a credential + * create a new credential, the user will create a new credential to access assets + * @param workspace The workspace name or id (required) + * @param credentialCreateRequest the new credentials to be created (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 The new credential was successfully added -
0 error response -
+ */ + public ApiResponse createCredentialWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull CredentialCreateRequest credentialCreateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = createCredentialValidateBeforeCall(workspace, credentialCreateRequest, teamspaceId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create a credential (asynchronously) + * create a new credential, the user will create a new credential to access assets + * @param workspace The workspace name or id (required) + * @param credentialCreateRequest the new credentials to be created (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 The new credential was successfully added -
0 error response -
+ */ + public okhttp3.Call createCredentialAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull CredentialCreateRequest credentialCreateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createCredentialValidateBeforeCall(workspace, credentialCreateRequest, teamspaceId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteCredentialByName + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 user credential deleted -
404 credential does not exist -
0 error response -
+ */ + public okhttp3.Call deleteCredentialByNameCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, 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 = "/credentials/{workspace}/{name}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCredentialByNameValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteCredentialByName(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteCredentialByName(Async)"); + } + + return deleteCredentialByNameCall(workspace, name, teamspaceId, _callback); + + } + + /** + * Delete user credential + * Delete the named access credential. Any arrays still set to use this credential will use the user's default and may become unreachable + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 user credential deleted -
404 credential does not exist -
0 error response -
+ */ + public void deleteCredentialByName(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId) throws ApiException { + deleteCredentialByNameWithHttpInfo(workspace, name, teamspaceId); + } + + /** + * Delete user credential + * Delete the named access credential. Any arrays still set to use this credential will use the user's default and may become unreachable + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 user credential deleted -
404 credential does not exist -
0 error response -
+ */ + public ApiResponse deleteCredentialByNameWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = deleteCredentialByNameValidateBeforeCall(workspace, name, teamspaceId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete user credential (asynchronously) + * Delete the named access credential. Any arrays still set to use this credential will use the user's default and may become unreachable + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 user credential deleted -
404 credential does not exist -
0 error response -
+ */ + public okhttp3.Call deleteCredentialByNameAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCredentialByNameValidateBeforeCall(workspace, name, teamspaceId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getCredentialByName + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credential response -
404 Credential does not exist -
0 error response -
+ */ + public okhttp3.Call getCredentialByNameCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, 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 = "/credentials/{workspace}/{name}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialByNameValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getCredentialByName(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getCredentialByName(Async)"); + } + + return getCredentialByNameCall(workspace, name, teamspaceId, _callback); + + } + + /** + * Get user credential + * get information about user credential by name + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return CredentialGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credential response -
404 Credential does not exist -
0 error response -
+ */ + public CredentialGetResponse getCredentialByName(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId) throws ApiException { + ApiResponse localVarResp = getCredentialByNameWithHttpInfo(workspace, name, teamspaceId); + return localVarResp.getData(); + } + + /** + * Get user credential + * get information about user credential by name + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<CredentialGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credential response -
404 Credential does not exist -
0 error response -
+ */ + public ApiResponse getCredentialByNameWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = getCredentialByNameValidateBeforeCall(workspace, name, teamspaceId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get user credential (asynchronously) + * get information about user credential by name + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credential response -
404 Credential does not exist -
0 error response -
+ */ + public okhttp3.Call getCredentialByNameAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCredentialByNameValidateBeforeCall(workspace, name, teamspaceId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCredentials + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional) + * @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credentials list response -
0 error response -
+ */ + public okhttp3.Call getCredentialsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable CloudProvider provider, @javax.annotation.Nullable String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, 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 = "/credentials/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + if (provider != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("provider", provider)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable CloudProvider provider, @javax.annotation.Nullable String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getCredentials(Async)"); + } + + return getCredentialsCall(workspace, teamspaceId, provider, type, page, perPage, _callback); + + } + + /** + * Get user credentials + * list the credentials available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional) + * @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return CredentialsListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credentials list response -
0 error response -
+ */ + public CredentialsListResponse getCredentials(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable CloudProvider provider, @javax.annotation.Nullable String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + ApiResponse localVarResp = getCredentialsWithHttpInfo(workspace, teamspaceId, provider, type, page, perPage); + return localVarResp.getData(); + } + + /** + * Get user credentials + * list the credentials available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional) + * @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<CredentialsListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credentials list response -
0 error response -
+ */ + public ApiResponse getCredentialsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable CloudProvider provider, @javax.annotation.Nullable String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + okhttp3.Call localVarCall = getCredentialsValidateBeforeCall(workspace, teamspaceId, provider, type, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get user credentials (asynchronously) + * list the credentials available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param provider Show only the credentials from this provider. This should be one of the CloudProvider enum values. (optional) + * @param type Show only the credentials of this type. This should be one of the AccessCredentialType enum values. (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful credentials list response -
0 error response -
+ */ + public okhttp3.Call getCredentialsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable CloudProvider provider, @javax.annotation.Nullable String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCredentialsValidateBeforeCall(workspace, teamspaceId, provider, type, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for patchCredentialByName + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param credentialUpdateRequest credential update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The credential was updated successfully -
0 error response -
+ */ + public okhttp3.Call patchCredentialByNameCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull CredentialUpdateRequest credentialUpdateRequest, @javax.annotation.Nullable String teamspaceId, 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 = credentialUpdateRequest; + + // create path and map variables + String localVarPath = "/credentials/{workspace}/{name}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call patchCredentialByNameValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull CredentialUpdateRequest credentialUpdateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling patchCredentialByName(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling patchCredentialByName(Async)"); + } + + // verify the required parameter 'credentialUpdateRequest' is set + if (credentialUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'credentialUpdateRequest' when calling patchCredentialByName(Async)"); + } + + return patchCredentialByNameCall(workspace, name, credentialUpdateRequest, teamspaceId, _callback); + + } + + /** + * Update user credential + * update user credential given by the user + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param credentialUpdateRequest credential update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The credential was updated successfully -
0 error response -
+ */ + public void patchCredentialByName(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull CredentialUpdateRequest credentialUpdateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + patchCredentialByNameWithHttpInfo(workspace, name, credentialUpdateRequest, teamspaceId); + } + + /** + * Update user credential + * update user credential given by the user + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param credentialUpdateRequest credential update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The credential was updated successfully -
0 error response -
+ */ + public ApiResponse patchCredentialByNameWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull CredentialUpdateRequest credentialUpdateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = patchCredentialByNameValidateBeforeCall(workspace, name, credentialUpdateRequest, teamspaceId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update user credential (asynchronously) + * update user credential given by the user + * @param workspace The workspace name or id (required) + * @param name The name of the credentials to run CRUD operations against (required) + * @param credentialUpdateRequest credential update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The credential was updated successfully -
0 error response -
+ */ + public okhttp3.Call patchCredentialByNameAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String name, @javax.annotation.Nonnull CredentialUpdateRequest credentialUpdateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = patchCredentialByNameValidateBeforeCall(workspace, name, credentialUpdateRequest, teamspaceId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for verifyCredential + * @param credentialsVerifyRequest credential to verify (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 + + + + + +
Response Details
Status Code Description Response Headers
200 successful connection -
0 error response -
+ */ + public okhttp3.Call verifyCredentialCall(@javax.annotation.Nonnull CredentialsVerifyRequest credentialsVerifyRequest, 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 = credentialsVerifyRequest; + + // create path and map variables + String localVarPath = "/actions/credentials/verify"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyCredentialValidateBeforeCall(@javax.annotation.Nonnull CredentialsVerifyRequest credentialsVerifyRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'credentialsVerifyRequest' is set + if (credentialsVerifyRequest == null) { + throw new ApiException("Missing the required parameter 'credentialsVerifyRequest' when calling verifyCredential(Async)"); + } + + return verifyCredentialCall(credentialsVerifyRequest, _callback); + + } + + /** + * Verify a given credential + * verify the credentials connection for a namespace + * @param credentialsVerifyRequest credential to verify (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful connection -
0 error response -
+ */ + public void verifyCredential(@javax.annotation.Nonnull CredentialsVerifyRequest credentialsVerifyRequest) throws ApiException { + verifyCredentialWithHttpInfo(credentialsVerifyRequest); + } + + /** + * Verify a given credential + * verify the credentials connection for a namespace + * @param credentialsVerifyRequest credential to verify (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful connection -
0 error response -
+ */ + public ApiResponse verifyCredentialWithHttpInfo(@javax.annotation.Nonnull CredentialsVerifyRequest credentialsVerifyRequest) throws ApiException { + okhttp3.Call localVarCall = verifyCredentialValidateBeforeCall(credentialsVerifyRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Verify a given credential (asynchronously) + * verify the credentials connection for a namespace + * @param credentialsVerifyRequest credential to verify (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 + + + + + +
Response Details
Status Code Description Response Headers
200 successful connection -
0 error response -
+ */ + public okhttp3.Call verifyCredentialAsync(@javax.annotation.Nonnull CredentialsVerifyRequest credentialsVerifyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyCredentialValidateBeforeCall(credentialsVerifyRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/DeltasharingApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/DeltasharingApi.java new file mode 100644 index 0000000..0e8e1f6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/DeltasharingApi.java @@ -0,0 +1,1640 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.ErrorResponse; +import io.tiledb.cloud.rest_api.v4.model.ListShareSchemaTablesResponse; +import io.tiledb.cloud.rest_api.v4.model.ListShareSchemasResponse; +import io.tiledb.cloud.rest_api.v4.model.ListSharesResponse; +import io.tiledb.cloud.rest_api.v4.model.ListTablesResponse; +import io.tiledb.cloud.rest_api.v4.model.QueryTableChangeResponse; +import io.tiledb.cloud.rest_api.v4.model.QueryTableRequest; +import io.tiledb.cloud.rest_api.v4.model.QueryTableResponse; +import io.tiledb.cloud.rest_api.v4.model.ShareResponse; +import io.tiledb.cloud.rest_api.v4.model.TableMetadataResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DeltasharingApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DeltasharingApi() { + this(Configuration.getDefaultApiClient()); + } + + public DeltasharingApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getShare + * @param workspace The workspace name or id (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched share details -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call getShareCall(@javax.annotation.Nonnull String workspace, 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 = "/deltasharing/shares/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getShareValidateBeforeCall(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getShare(Async)"); + } + + return getShareCall(workspace, _callback); + + } + + /** + * get a delta share + * This is the API to get the metadata of a share. + * @param workspace The workspace name or id (required) + * @return ShareResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched share details -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ShareResponse getShare(@javax.annotation.Nonnull String workspace) throws ApiException { + ApiResponse localVarResp = getShareWithHttpInfo(workspace); + return localVarResp.getData(); + } + + /** + * get a delta share + * This is the API to get the metadata of a share. + * @param workspace The workspace name or id (required) + * @return ApiResponse<ShareResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched share details -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse getShareWithHttpInfo(@javax.annotation.Nonnull String workspace) throws ApiException { + okhttp3.Call localVarCall = getShareValidateBeforeCall(workspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * get a delta share (asynchronously) + * This is the API to get the metadata of a share. + * @param workspace The workspace name or id (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched share details -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call getShareAsync(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getShareValidateBeforeCall(workspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listShareAllTables + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareAllTablesCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, 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 = "/deltasharing/shares/{workspace}/all-tables" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (maxResults != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxResults", maxResults)); + } + + if (pageToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageToken", pageToken)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listShareAllTablesValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listShareAllTables(Async)"); + } + + return listShareAllTablesCall(workspace, maxResults, pageToken, _callback); + + } + + /** + * list delta share schema tables + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ListTablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ListTablesResponse listShareAllTables(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + ApiResponse localVarResp = listShareAllTablesWithHttpInfo(workspace, maxResults, pageToken); + return localVarResp.getData(); + } + + /** + * list delta share schema tables + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ApiResponse<ListTablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse listShareAllTablesWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + okhttp3.Call localVarCall = listShareAllTablesValidateBeforeCall(workspace, maxResults, pageToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list delta share schema tables (asynchronously) + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareAllTablesAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listShareAllTablesValidateBeforeCall(workspace, maxResults, pageToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listShareSchemaTables + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareSchemaTablesCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, 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 = "/deltasharing/shares/{workspace}/schemas/{teamspace}/tables" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (maxResults != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxResults", maxResults)); + } + + if (pageToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageToken", pageToken)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listShareSchemaTablesValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listShareSchemaTables(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling listShareSchemaTables(Async)"); + } + + return listShareSchemaTablesCall(workspace, teamspace, maxResults, pageToken, _callback); + + } + + /** + * list delta share schema tables + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ListShareSchemaTablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ListShareSchemaTablesResponse listShareSchemaTables(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + ApiResponse localVarResp = listShareSchemaTablesWithHttpInfo(workspace, teamspace, maxResults, pageToken); + return localVarResp.getData(); + } + + /** + * list delta share schema tables + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ApiResponse<ListShareSchemaTablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse listShareSchemaTablesWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + okhttp3.Call localVarCall = listShareSchemaTablesValidateBeforeCall(workspace, teamspace, maxResults, pageToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list delta share schema tables (asynchronously) + * This is the API to list tables in a schema. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schema tables -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareSchemaTablesAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listShareSchemaTablesValidateBeforeCall(workspace, teamspace, maxResults, pageToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listShareSchemas + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schemas -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareSchemasCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, 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 = "/deltasharing/shares/{workspace}/schemas" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (maxResults != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxResults", maxResults)); + } + + if (pageToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageToken", pageToken)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listShareSchemasValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listShareSchemas(Async)"); + } + + return listShareSchemasCall(workspace, maxResults, pageToken, _callback); + + } + + /** + * list delta share schemas + * This is the API to list schemas in a share. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ListShareSchemasResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schemas -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ListShareSchemasResponse listShareSchemas(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + ApiResponse localVarResp = listShareSchemasWithHttpInfo(workspace, maxResults, pageToken); + return localVarResp.getData(); + } + + /** + * list delta share schemas + * This is the API to list schemas in a share. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ApiResponse<ListShareSchemasResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schemas -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse listShareSchemasWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + okhttp3.Call localVarCall = listShareSchemasValidateBeforeCall(workspace, maxResults, pageToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list delta share schemas (asynchronously) + * This is the API to list schemas in a share. + * @param workspace The workspace name or id (required) + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of share schemas -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listShareSchemasAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listShareSchemasValidateBeforeCall(workspace, maxResults, pageToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listShares + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of shares -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listSharesCall(@javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, 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 = "/deltasharing/shares"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (maxResults != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxResults", maxResults)); + } + + if (pageToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageToken", pageToken)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSharesValidateBeforeCall(@javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + return listSharesCall(maxResults, pageToken, _callback); + + } + + /** + * list delta shares + * This is the API to list shares accessible to a recipient. + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ListSharesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of shares -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ListSharesResponse listShares(@javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + ApiResponse localVarResp = listSharesWithHttpInfo(maxResults, pageToken); + return localVarResp.getData(); + } + + /** + * list delta shares + * This is the API to list shares accessible to a recipient. + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @return ApiResponse<ListSharesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of shares -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse listSharesWithHttpInfo(@javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken) throws ApiException { + okhttp3.Call localVarCall = listSharesValidateBeforeCall(maxResults, pageToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * list delta shares (asynchronously) + * This is the API to list shares accessible to a recipient. + * @param maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. (optional) + * @param pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched listing of shares -
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call listSharesAsync(@javax.annotation.Nullable Integer maxResults, @javax.annotation.Nullable String pageToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listSharesValidateBeforeCall(maxResults, pageToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryTable + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param queryTableRequest query table request (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull QueryTableRequest queryTableRequest, 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 = queryTableRequest; + + // create path and map variables + String localVarPath = "/deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/query" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.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/x-ndjson", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryTableValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull QueryTableRequest queryTableRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling queryTable(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling queryTable(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling queryTable(Async)"); + } + + // verify the required parameter 'queryTableRequest' is set + if (queryTableRequest == null) { + throw new ApiException("Missing the required parameter 'queryTableRequest' when calling queryTable(Async)"); + } + + return queryTableCall(workspace, teamspace, asset, queryTableRequest, _callback); + + } + + /** + * query table + * This is the API for clients to read data from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param queryTableRequest query table request (required) + * @return QueryTableResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public QueryTableResponse queryTable(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull QueryTableRequest queryTableRequest) throws ApiException { + ApiResponse localVarResp = queryTableWithHttpInfo(workspace, teamspace, asset, queryTableRequest); + return localVarResp.getData(); + } + + /** + * query table + * This is the API for clients to read data from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param queryTableRequest query table request (required) + * @return ApiResponse<QueryTableResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse queryTableWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull QueryTableRequest queryTableRequest) throws ApiException { + okhttp3.Call localVarCall = queryTableValidateBeforeCall(workspace, teamspace, asset, queryTableRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * query table (asynchronously) + * This is the API for clients to read data from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param queryTableRequest query table request (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nonnull QueryTableRequest queryTableRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryTableValidateBeforeCall(workspace, teamspace, asset, queryTableRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryTableChanges + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingVersion The starting version of the query, inclusive (optional) + * @param startingTimestamp The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. (optional) + * @param endingVersion The ending version of the query, inclusive (optional) + * @param endingTimestamp The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. (optional) + * @param includeHistoricalMetadata If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. (optional, default to false) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table changes * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableChangesCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Long startingVersion, @javax.annotation.Nullable String startingTimestamp, @javax.annotation.Nullable Long endingVersion, @javax.annotation.Nullable String endingTimestamp, @javax.annotation.Nullable Boolean includeHistoricalMetadata, 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 = "/deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/changes" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startingVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startingVersion", startingVersion)); + } + + if (startingTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startingTimestamp", startingTimestamp)); + } + + if (endingVersion != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endingVersion", endingVersion)); + } + + if (endingTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endingTimestamp", endingTimestamp)); + } + + if (includeHistoricalMetadata != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("includeHistoricalMetadata", includeHistoricalMetadata)); + } + + final String[] localVarAccepts = { + "application/x-ndjson", + "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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryTableChangesValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Long startingVersion, @javax.annotation.Nullable String startingTimestamp, @javax.annotation.Nullable Long endingVersion, @javax.annotation.Nullable String endingTimestamp, @javax.annotation.Nullable Boolean includeHistoricalMetadata, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling queryTableChanges(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling queryTableChanges(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling queryTableChanges(Async)"); + } + + return queryTableChangesCall(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata, _callback); + + } + + /** + * query table changes + * This is the API for clients to read change data feed from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingVersion The starting version of the query, inclusive (optional) + * @param startingTimestamp The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. (optional) + * @param endingVersion The ending version of the query, inclusive (optional) + * @param endingTimestamp The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. (optional) + * @param includeHistoricalMetadata If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. (optional, default to false) + * @return QueryTableChangeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table changes * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public QueryTableChangeResponse queryTableChanges(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Long startingVersion, @javax.annotation.Nullable String startingTimestamp, @javax.annotation.Nullable Long endingVersion, @javax.annotation.Nullable String endingTimestamp, @javax.annotation.Nullable Boolean includeHistoricalMetadata) throws ApiException { + ApiResponse localVarResp = queryTableChangesWithHttpInfo(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata); + return localVarResp.getData(); + } + + /** + * query table changes + * This is the API for clients to read change data feed from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingVersion The starting version of the query, inclusive (optional) + * @param startingTimestamp The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. (optional) + * @param endingVersion The ending version of the query, inclusive (optional) + * @param endingTimestamp The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. (optional) + * @param includeHistoricalMetadata If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. (optional, default to false) + * @return ApiResponse<QueryTableChangeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table changes * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse queryTableChangesWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Long startingVersion, @javax.annotation.Nullable String startingTimestamp, @javax.annotation.Nullable Long endingVersion, @javax.annotation.Nullable String endingTimestamp, @javax.annotation.Nullable Boolean includeHistoricalMetadata) throws ApiException { + okhttp3.Call localVarCall = queryTableChangesValidateBeforeCall(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * query table changes (asynchronously) + * This is the API for clients to read change data feed from a table. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingVersion The starting version of the query, inclusive (optional) + * @param startingTimestamp The starting timestamp of the query, a string in the Timestamp Format, which will be converted to a version created greater or equal to this timestamp. (optional) + * @param endingVersion The ending version of the query, inclusive (optional) + * @param endingTimestamp The ending timestamp of the query, a string in the Timestamp Format, which will be converted to a version created earlier than or at the timestamp. (optional) + * @param includeHistoricalMetadata If set to true, return the historical metadata if seen in the delta log. This is for the streaming client to check if the table schema is still read compatible. (optional, default to false) + * @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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully queried table changes * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableChangesAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable Long startingVersion, @javax.annotation.Nullable String startingTimestamp, @javax.annotation.Nullable Long endingVersion, @javax.annotation.Nullable String endingTimestamp, @javax.annotation.Nullable Boolean includeHistoricalMetadata, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryTableChangesValidateBeforeCall(workspace, teamspace, asset, startingVersion, startingTimestamp, endingVersion, endingTimestamp, includeHistoricalMetadata, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryTableMetadata + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table metadata * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableMetadataCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, 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 = "/deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/metadata" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.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/x-ndjson", + "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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryTableMetadataValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling queryTableMetadata(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling queryTableMetadata(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling queryTableMetadata(Async)"); + } + + return queryTableMetadataCall(workspace, teamspace, asset, _callback); + + } + + /** + * fetch table metadata + * This is the API for clients to query the table schema and other metadata. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @return TableMetadataResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table metadata * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public TableMetadataResponse queryTableMetadata(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset) throws ApiException { + ApiResponse localVarResp = queryTableMetadataWithHttpInfo(workspace, teamspace, asset); + return localVarResp.getData(); + } + + /** + * fetch table metadata + * This is the API for clients to query the table schema and other metadata. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @return ApiResponse<TableMetadataResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table metadata * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse queryTableMetadataWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset) throws ApiException { + okhttp3.Call localVarCall = queryTableMetadataValidateBeforeCall(workspace, teamspace, asset, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * fetch table metadata (asynchronously) + * This is the API for clients to query the table schema and other metadata. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (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 + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table metadata * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableMetadataAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryTableMetadataValidateBeforeCall(workspace, teamspace, asset, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryTableVerison + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingTimestamp The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table version * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableVerisonCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable String startingTimestamp, 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 = "/deltasharing/shares/{workspace}/schemas/{teamspace}/tables/{asset}/version" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "asset" + "}", localVarApiClient.escapeString(asset.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startingTimestamp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startingTimestamp", startingTimestamp)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryTableVerisonValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable String startingTimestamp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling queryTableVerison(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling queryTableVerison(Async)"); + } + + // verify the required parameter 'asset' is set + if (asset == null) { + throw new ApiException("Missing the required parameter 'asset' when calling queryTableVerison(Async)"); + } + + return queryTableVerisonCall(workspace, teamspace, asset, startingTimestamp, _callback); + + } + + /** + * fetch table version + * This is the API for clients to get a table version without any other extra information + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingTimestamp The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table version * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public void queryTableVerison(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable String startingTimestamp) throws ApiException { + queryTableVerisonWithHttpInfo(workspace, teamspace, asset, startingTimestamp); + } + + /** + * fetch table version + * This is the API for clients to get a table version without any other extra information + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingTimestamp The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table version * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public ApiResponse queryTableVerisonWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable String startingTimestamp) throws ApiException { + okhttp3.Call localVarCall = queryTableVerisonValidateBeforeCall(workspace, teamspace, asset, startingTimestamp, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * fetch table version (asynchronously) + * This is the API for clients to get a table version without any other extra information + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param asset The asset id or path for which to retrieve assets (required) + * @param startingTimestamp The startingTimestamp of the query, a string in the Timestamp Format, the server needs to return the earliest table version at or after the provided timestamp, can be earlier than the timestamp of table version 0. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully fetched table version * Delta-Table-Version - version of table
400 The request is malformed. -
401 The request is unauthenticated. The bearer token is missing or incorrect. -
403 The request is forbidden from being fulfilled. -
404 The requested resource does not exist. -
500 The request is not handled correctly due to a server error. -
0 error response -
+ */ + public okhttp3.Call queryTableVerisonAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String asset, @javax.annotation.Nullable String startingTimestamp, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryTableVerisonValidateBeforeCall(workspace, teamspace, asset, startingTimestamp, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/FilesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/FilesApi.java new file mode 100644 index 0000000..b41d72c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/FilesApi.java @@ -0,0 +1,771 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.ErrorXML; +import java.io.File; +import io.tiledb.cloud.rest_api.v4.model.FileListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FilesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FilesApi() { + this(Configuration.getDefaultApiClient()); + } + + public FilesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for fileGet + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param range The range of bytes to fetch. Supports only single ranges. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call fileGetCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable String range, 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 = "/files/{workspace}/{teamspace}/{path}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "path" + "}", localVarApiClient.escapeString(path.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/xml" + }; + 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); + } + + if (range != null) { + localVarHeaderParams.put("Range", localVarApiClient.parameterToString(range)); + } + + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fileGetValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable String range, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling fileGet(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling fileGet(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling fileGet(Async)"); + } + + return fileGetCall(workspace, teamspace, path, range, _callback); + + } + + /** + * Download the file at the given path + * End point to download the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param range The range of bytes to fetch. Supports only single ranges. (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
0 error response -
+ */ + public void fileGet(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable String range) throws ApiException { + fileGetWithHttpInfo(workspace, teamspace, path, range); + } + + /** + * Download the file at the given path + * End point to download the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param range The range of bytes to fetch. Supports only single ranges. (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse fileGetWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable String range) throws ApiException { + okhttp3.Call localVarCall = fileGetValidateBeforeCall(workspace, teamspace, path, range, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download the file at the given path (asynchronously) + * End point to download the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param range The range of bytes to fetch. Supports only single ranges. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call fileGetAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nullable String range, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fileGetValidateBeforeCall(workspace, teamspace, path, range, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for fileHead + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (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 + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
+ */ + public okhttp3.Call fileHeadCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, 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 = "/files/{workspace}/{teamspace}/{path}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "path" + "}", localVarApiClient.escapeString(path.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/octet-stream" + }; + 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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "HEAD", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fileHeadValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling fileHead(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling fileHead(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling fileHead(Async)"); + } + + return fileHeadCall(workspace, teamspace, path, _callback); + + } + + /** + * Get information about the file at the given path + * End point to get information about the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
+ */ + public File fileHead(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path) throws ApiException { + ApiResponse localVarResp = fileHeadWithHttpInfo(workspace, teamspace, path); + return localVarResp.getData(); + } + + /** + * Get information about the file at the given path + * End point to get information about the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
+ */ + public ApiResponse fileHeadWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path) throws ApiException { + okhttp3.Call localVarCall = fileHeadValidateBeforeCall(workspace, teamspace, path, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get information about the file at the given path (asynchronously) + * End point to get information about the file at the given path + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (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 + + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful file get response -
206 Successful file ranged get response -
404 Teamspace or file does not exist -
416 Range not satisfiable -
502 Bad Gateway -
+ */ + public okhttp3.Call fileHeadAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fileHeadValidateBeforeCall(workspace, teamspace, path, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for folderList + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param listType Required for S3 API compatibility, must be set to 2. (required) + * @param delimiter The string that delimits the path segments. Only forward slash is supported (required) + * @param prefix The directory of files to list. (optional) + * @param maxKeys The maximum number of items to return. (optional) + * @param continuationToken Used to resume an incomplete list operation (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful folder list response -
404 Teamspace does not exist -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call folderListCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull Integer listType, @javax.annotation.Nonnull String delimiter, @javax.annotation.Nullable String prefix, @javax.annotation.Nullable Integer maxKeys, @javax.annotation.Nullable String continuationToken, 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 = "/files/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (prefix != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prefix", prefix)); + } + + if (listType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("list-type", listType)); + } + + if (delimiter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delimiter", delimiter)); + } + + if (maxKeys != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("max-keys", maxKeys)); + } + + if (continuationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("continuation-token", continuationToken)); + } + + final String[] localVarAccepts = { + "application/xml" + }; + 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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call folderListValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull Integer listType, @javax.annotation.Nonnull String delimiter, @javax.annotation.Nullable String prefix, @javax.annotation.Nullable Integer maxKeys, @javax.annotation.Nullable String continuationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling folderList(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling folderList(Async)"); + } + + // verify the required parameter 'listType' is set + if (listType == null) { + throw new ApiException("Missing the required parameter 'listType' when calling folderList(Async)"); + } + + // verify the required parameter 'delimiter' is set + if (delimiter == null) { + throw new ApiException("Missing the required parameter 'delimiter' when calling folderList(Async)"); + } + + return folderListCall(workspace, teamspace, listType, delimiter, prefix, maxKeys, continuationToken, _callback); + + } + + /** + * List folders and files contained in a folder + * End point to list files and folders for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param listType Required for S3 API compatibility, must be set to 2. (required) + * @param delimiter The string that delimits the path segments. Only forward slash is supported (required) + * @param prefix The directory of files to list. (optional) + * @param maxKeys The maximum number of items to return. (optional) + * @param continuationToken Used to resume an incomplete list operation (optional) + * @return FileListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful folder list response -
404 Teamspace does not exist -
502 Bad Gateway -
0 error response -
+ */ + public FileListResponse folderList(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull Integer listType, @javax.annotation.Nonnull String delimiter, @javax.annotation.Nullable String prefix, @javax.annotation.Nullable Integer maxKeys, @javax.annotation.Nullable String continuationToken) throws ApiException { + ApiResponse localVarResp = folderListWithHttpInfo(workspace, teamspace, listType, delimiter, prefix, maxKeys, continuationToken); + return localVarResp.getData(); + } + + /** + * List folders and files contained in a folder + * End point to list files and folders for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param listType Required for S3 API compatibility, must be set to 2. (required) + * @param delimiter The string that delimits the path segments. Only forward slash is supported (required) + * @param prefix The directory of files to list. (optional) + * @param maxKeys The maximum number of items to return. (optional) + * @param continuationToken Used to resume an incomplete list operation (optional) + * @return ApiResponse<FileListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful folder list response -
404 Teamspace does not exist -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse folderListWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull Integer listType, @javax.annotation.Nonnull String delimiter, @javax.annotation.Nullable String prefix, @javax.annotation.Nullable Integer maxKeys, @javax.annotation.Nullable String continuationToken) throws ApiException { + okhttp3.Call localVarCall = folderListValidateBeforeCall(workspace, teamspace, listType, delimiter, prefix, maxKeys, continuationToken, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List folders and files contained in a folder (asynchronously) + * End point to list files and folders for the passed teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param listType Required for S3 API compatibility, must be set to 2. (required) + * @param delimiter The string that delimits the path segments. Only forward slash is supported (required) + * @param prefix The directory of files to list. (optional) + * @param maxKeys The maximum number of items to return. (optional) + * @param continuationToken Used to resume an incomplete list operation (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful folder list response -
404 Teamspace does not exist -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call folderListAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull Integer listType, @javax.annotation.Nonnull String delimiter, @javax.annotation.Nullable String prefix, @javax.annotation.Nullable Integer maxKeys, @javax.annotation.Nullable String continuationToken, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = folderListValidateBeforeCall(workspace, teamspace, listType, delimiter, prefix, maxKeys, continuationToken, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for uploadPart + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param body (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully uploaded the part. * ETag - ETag of the uploaded part.
400 Bad request -
0 error response -
+ */ + public okhttp3.Call uploadPartCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nonnull File body, 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 = body; + + // create path and map variables + String localVarPath = "/files/{workspace}/{teamspace}/{path}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "path" + "}", localVarApiClient.escapeString(path.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/xml" + }; + 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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadPartValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nonnull File body, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling uploadPart(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling uploadPart(Async)"); + } + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling uploadPart(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling uploadPart(Async)"); + } + + return uploadPartCall(workspace, teamspace, path, body, _callback); + + } + + /** + * Upload Part + * Uploads a part in a multipart upload session. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully uploaded the part. * ETag - ETag of the uploaded part.
400 Bad request -
0 error response -
+ */ + public void uploadPart(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nonnull File body) throws ApiException { + uploadPartWithHttpInfo(workspace, teamspace, path, body); + } + + /** + * Upload Part + * Uploads a part in a multipart upload session. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully uploaded the part. * ETag - ETag of the uploaded part.
400 Bad request -
0 error response -
+ */ + public ApiResponse uploadPartWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nonnull File body) throws ApiException { + okhttp3.Call localVarCall = uploadPartValidateBeforeCall(workspace, teamspace, path, body, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Upload Part (asynchronously) + * Uploads a part in a multipart upload session. + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param path The path to the file (required) + * @param body (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully uploaded the part. * ETag - ETag of the uploaded part.
400 Bad request -
0 error response -
+ */ + public okhttp3.Call uploadPartAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String path, @javax.annotation.Nonnull File body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadPartValidateBeforeCall(workspace, teamspace, path, body, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/FoldersApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/FoldersApi.java new file mode 100644 index 0000000..b0be0df --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/FoldersApi.java @@ -0,0 +1,1021 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.FolderContentsResponse; +import io.tiledb.cloud.rest_api.v4.model.FolderCreateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.FolderCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.FolderGetResponse; +import io.tiledb.cloud.rest_api.v4.model.FolderUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.FoldersContentsModifyInner; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FoldersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FoldersApi() { + this(Configuration.getDefaultApiClient()); + } + + public FoldersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createFolder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderCreateRequestInner folder to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful folder response -
0 error response -
+ */ + public okhttp3.Call createFolderCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderCreateRequestInner folderCreateRequestInner, 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 = folderCreateRequestInner; + + // create path and map variables + String localVarPath = "/folders/{workspace}/{teamspace}/{folder}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createFolderValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderCreateRequestInner folderCreateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createFolder(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling createFolder(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling createFolder(Async)"); + } + + // verify the required parameter 'folderCreateRequestInner' is set + if (folderCreateRequestInner == null) { + throw new ApiException("Missing the required parameter 'folderCreateRequestInner' when calling createFolder(Async)"); + } + + return createFolderCall(workspace, teamspace, folder, folderCreateRequestInner, _callback); + + } + + /** + * Create a folder in the given teamspace + * Create a new folder in the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderCreateRequestInner folder to create (required) + * @return FolderCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful folder response -
0 error response -
+ */ + public FolderCreateResponse createFolder(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderCreateRequestInner folderCreateRequestInner) throws ApiException { + ApiResponse localVarResp = createFolderWithHttpInfo(workspace, teamspace, folder, folderCreateRequestInner); + return localVarResp.getData(); + } + + /** + * Create a folder in the given teamspace + * Create a new folder in the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderCreateRequestInner folder to create (required) + * @return ApiResponse<FolderCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful folder response -
0 error response -
+ */ + public ApiResponse createFolderWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderCreateRequestInner folderCreateRequestInner) throws ApiException { + okhttp3.Call localVarCall = createFolderValidateBeforeCall(workspace, teamspace, folder, folderCreateRequestInner, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a folder in the given teamspace (asynchronously) + * Create a new folder in the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderCreateRequestInner folder to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful folder response -
0 error response -
+ */ + public okhttp3.Call createFolderAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderCreateRequestInner folderCreateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createFolderValidateBeforeCall(workspace, teamspace, folder, folderCreateRequestInner, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteFolder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 folder deleted -
0 error response -
+ */ + public okhttp3.Call deleteFolderCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nullable Boolean deleteAssets, 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 = "/folders/{workspace}/{teamspace}/{folder}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (deleteAssets != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delete-assets", deleteAssets)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteFolderValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nullable Boolean deleteAssets, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteFolder(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling deleteFolder(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling deleteFolder(Async)"); + } + + return deleteFolderCall(workspace, teamspace, folder, deleteAssets, _callback); + + } + + /** + * Delete a folder + * delete a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 folder deleted -
0 error response -
+ */ + public void deleteFolder(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nullable Boolean deleteAssets) throws ApiException { + deleteFolderWithHttpInfo(workspace, teamspace, folder, deleteAssets); + } + + /** + * Delete a folder + * delete a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 folder deleted -
0 error response -
+ */ + public ApiResponse deleteFolderWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nullable Boolean deleteAssets) throws ApiException { + okhttp3.Call localVarCall = deleteFolderValidateBeforeCall(workspace, teamspace, folder, deleteAssets, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a folder (asynchronously) + * delete a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @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 + + + + + +
Response Details
Status Code Description Response Headers
204 folder deleted -
0 error response -
+ */ + public okhttp3.Call deleteFolderAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nullable Boolean deleteAssets, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteFolderValidateBeforeCall(workspace, teamspace, folder, deleteAssets, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getFolder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getFolderCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, 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 = "/folders/{workspace}/{teamspace}/{folder}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFolderValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getFolder(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getFolder(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling getFolder(Async)"); + } + + return getFolderCall(workspace, teamspace, folder, _callback); + + } + + /** + * Retrieve a folder's content + * Retrieve the given folder's content + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @return FolderGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public FolderGetResponse getFolder(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder) throws ApiException { + ApiResponse localVarResp = getFolderWithHttpInfo(workspace, teamspace, folder); + return localVarResp.getData(); + } + + /** + * Retrieve a folder's content + * Retrieve the given folder's content + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @return ApiResponse<FolderGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public ApiResponse getFolderWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder) throws ApiException { + okhttp3.Call localVarCall = getFolderValidateBeforeCall(workspace, teamspace, folder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a folder's content (asynchronously) + * Retrieve the given folder's content + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getFolderAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFolderValidateBeforeCall(workspace, teamspace, folder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getFolderContents + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder contents retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getFolderContentsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, 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 = "/folders/{workspace}/{teamspace}/{folder}/contents" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFolderContentsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getFolderContents(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getFolderContents(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling getFolderContents(Async)"); + } + + return getFolderContentsCall(workspace, teamspace, folder, _callback); + + } + + /** + * Retrieve a folder + * Retrieve the given folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @return FolderContentsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder contents retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public FolderContentsResponse getFolderContents(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder) throws ApiException { + ApiResponse localVarResp = getFolderContentsWithHttpInfo(workspace, teamspace, folder); + return localVarResp.getData(); + } + + /** + * Retrieve a folder + * Retrieve the given folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @return ApiResponse<FolderContentsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder contents retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public ApiResponse getFolderContentsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder) throws ApiException { + okhttp3.Call localVarCall = getFolderContentsValidateBeforeCall(workspace, teamspace, folder, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a folder (asynchronously) + * Retrieve the given folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Folder contents retrieved -
404 Folder does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getFolderContentsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFolderContentsValidateBeforeCall(workspace, teamspace, folder, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for modifyFolderContents + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param foldersContentsModifyInner assets to add or remove (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Folder contents modified successfully -
0 error response -
+ */ + public okhttp3.Call modifyFolderContentsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FoldersContentsModifyInner foldersContentsModifyInner, 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 = foldersContentsModifyInner; + + // create path and map variables + String localVarPath = "/folders/{workspace}/{teamspace}/{folder}/contents" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call modifyFolderContentsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FoldersContentsModifyInner foldersContentsModifyInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling modifyFolderContents(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling modifyFolderContents(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling modifyFolderContents(Async)"); + } + + // verify the required parameter 'foldersContentsModifyInner' is set + if (foldersContentsModifyInner == null) { + throw new ApiException("Missing the required parameter 'foldersContentsModifyInner' when calling modifyFolderContents(Async)"); + } + + return modifyFolderContentsCall(workspace, teamspace, folder, foldersContentsModifyInner, _callback); + + } + + /** + * Add or remove assets under a folder + * Add or remove assets under a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param foldersContentsModifyInner assets to add or remove (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Folder contents modified successfully -
0 error response -
+ */ + public void modifyFolderContents(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FoldersContentsModifyInner foldersContentsModifyInner) throws ApiException { + modifyFolderContentsWithHttpInfo(workspace, teamspace, folder, foldersContentsModifyInner); + } + + /** + * Add or remove assets under a folder + * Add or remove assets under a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param foldersContentsModifyInner assets to add or remove (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Folder contents modified successfully -
0 error response -
+ */ + public ApiResponse modifyFolderContentsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FoldersContentsModifyInner foldersContentsModifyInner) throws ApiException { + okhttp3.Call localVarCall = modifyFolderContentsValidateBeforeCall(workspace, teamspace, folder, foldersContentsModifyInner, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Add or remove assets under a folder (asynchronously) + * Add or remove assets under a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param foldersContentsModifyInner assets to add or remove (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Folder contents modified successfully -
0 error response -
+ */ + public okhttp3.Call modifyFolderContentsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FoldersContentsModifyInner foldersContentsModifyInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = modifyFolderContentsValidateBeforeCall(workspace, teamspace, folder, foldersContentsModifyInner, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateFolder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderUpdateRequest The request body containing the folder to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Folder updated -
0 An error occurred -
+ */ + public okhttp3.Call updateFolderCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderUpdateRequest folderUpdateRequest, 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 = folderUpdateRequest; + + // create path and map variables + String localVarPath = "/folders/{workspace}/{teamspace}/{folder}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "folder" + "}", localVarApiClient.escapeString(folder.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateFolderValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderUpdateRequest folderUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateFolder(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateFolder(Async)"); + } + + // verify the required parameter 'folder' is set + if (folder == null) { + throw new ApiException("Missing the required parameter 'folder' when calling updateFolder(Async)"); + } + + // verify the required parameter 'folderUpdateRequest' is set + if (folderUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'folderUpdateRequest' when calling updateFolder(Async)"); + } + + return updateFolderCall(workspace, teamspace, folder, folderUpdateRequest, _callback); + + } + + /** + * Update the given folder + * Update a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderUpdateRequest The request body containing the folder to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Folder updated -
0 An error occurred -
+ */ + public void updateFolder(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderUpdateRequest folderUpdateRequest) throws ApiException { + updateFolderWithHttpInfo(workspace, teamspace, folder, folderUpdateRequest); + } + + /** + * Update the given folder + * Update a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderUpdateRequest The request body containing the folder to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Folder updated -
0 An error occurred -
+ */ + public ApiResponse updateFolderWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderUpdateRequest folderUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateFolderValidateBeforeCall(workspace, teamspace, folder, folderUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the given folder (asynchronously) + * Update a folder + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param folder The path to the folder or the folder's assetID (required) + * @param folderUpdateRequest The request body containing the folder to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Folder updated -
0 An error occurred -
+ */ + public okhttp3.Call updateFolderAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String folder, @javax.annotation.Nonnull FolderUpdateRequest folderUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateFolderValidateBeforeCall(workspace, teamspace, folder, folderUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/GeneralspacesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/GeneralspacesApi.java new file mode 100644 index 0000000..ebe6836 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/GeneralspacesApi.java @@ -0,0 +1,641 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.GeneralspaceGetResponse; +import io.tiledb.cloud.rest_api.v4.model.GeneralspaceUpdateRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GeneralspacesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public GeneralspacesApi() { + this(Configuration.getDefaultApiClient()); + } + + public GeneralspacesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getGeneralSpace + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getGeneralSpaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, 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 = "/generalspaces/{workspace}/{generalspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "generalspace" + "}", localVarApiClient.escapeString(generalspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGeneralSpaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getGeneralSpace(Async)"); + } + + // verify the required parameter 'generalspace' is set + if (generalspace == null) { + throw new ApiException("Missing the required parameter 'generalspace' when calling getGeneralSpace(Async)"); + } + + return getGeneralSpaceCall(workspace, generalspace, _callback); + + } + + /** + * Retrieve a generalspace + * Retrieve the given general space + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @return GeneralspaceGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public GeneralspaceGetResponse getGeneralSpace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace) throws ApiException { + ApiResponse localVarResp = getGeneralSpaceWithHttpInfo(workspace, generalspace); + return localVarResp.getData(); + } + + /** + * Retrieve a generalspace + * Retrieve the given general space + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @return ApiResponse<GeneralspaceGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public ApiResponse getGeneralSpaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace) throws ApiException { + okhttp3.Call localVarCall = getGeneralSpaceValidateBeforeCall(workspace, generalspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a generalspace (asynchronously) + * Retrieve the given general space + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getGeneralSpaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGeneralSpaceValidateBeforeCall(workspace, generalspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getGeneralspaceByWorkspace + * @param workspace The workspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getGeneralspaceByWorkspaceCall(@javax.annotation.Nonnull String workspace, 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 = "/generalspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGeneralspaceByWorkspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getGeneralspaceByWorkspace(Async)"); + } + + return getGeneralspaceByWorkspaceCall(workspace, _callback); + + } + + /** + * Retrieve a generalspace + * Retrieve the given general space + * @param workspace The workspace name or id (required) + * @return GeneralspaceGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public GeneralspaceGetResponse getGeneralspaceByWorkspace(@javax.annotation.Nonnull String workspace) throws ApiException { + ApiResponse localVarResp = getGeneralspaceByWorkspaceWithHttpInfo(workspace); + return localVarResp.getData(); + } + + /** + * Retrieve a generalspace + * Retrieve the given general space + * @param workspace The workspace name or id (required) + * @return ApiResponse<GeneralspaceGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public ApiResponse getGeneralspaceByWorkspaceWithHttpInfo(@javax.annotation.Nonnull String workspace) throws ApiException { + okhttp3.Call localVarCall = getGeneralspaceByWorkspaceValidateBeforeCall(workspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a generalspace (asynchronously) + * Retrieve the given general space + * @param workspace The workspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Generalspace retrieved -
404 Generalspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getGeneralspaceByWorkspaceAsync(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGeneralspaceByWorkspaceValidateBeforeCall(workspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateGeneralspaceByID + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateGeneralspaceByIDCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, 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 = generalspaceUpdateRequest; + + // create path and map variables + String localVarPath = "/generalspaces/{workspace}/{generalspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "generalspace" + "}", localVarApiClient.escapeString(generalspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateGeneralspaceByIDValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateGeneralspaceByID(Async)"); + } + + // verify the required parameter 'generalspace' is set + if (generalspace == null) { + throw new ApiException("Missing the required parameter 'generalspace' when calling updateGeneralspaceByID(Async)"); + } + + // verify the required parameter 'generalspaceUpdateRequest' is set + if (generalspaceUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'generalspaceUpdateRequest' when calling updateGeneralspaceByID(Async)"); + } + + return updateGeneralspaceByIDCall(workspace, generalspace, generalspaceUpdateRequest, _callback); + + } + + /** + * Update the given generalspace + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public void updateGeneralspaceByID(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest) throws ApiException { + updateGeneralspaceByIDWithHttpInfo(workspace, generalspace, generalspaceUpdateRequest); + } + + /** + * Update the given generalspace + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public ApiResponse updateGeneralspaceByIDWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateGeneralspaceByIDValidateBeforeCall(workspace, generalspace, generalspaceUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the given generalspace (asynchronously) + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspace The generalspace id or name (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateGeneralspaceByIDAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String generalspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateGeneralspaceByIDValidateBeforeCall(workspace, generalspace, generalspaceUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateGeneralspaceByWorkspace + * @param workspace The workspace name or id (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateGeneralspaceByWorkspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, 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 = generalspaceUpdateRequest; + + // create path and map variables + String localVarPath = "/generalspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateGeneralspaceByWorkspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateGeneralspaceByWorkspace(Async)"); + } + + // verify the required parameter 'generalspaceUpdateRequest' is set + if (generalspaceUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'generalspaceUpdateRequest' when calling updateGeneralspaceByWorkspace(Async)"); + } + + return updateGeneralspaceByWorkspaceCall(workspace, generalspaceUpdateRequest, _callback); + + } + + /** + * Update the given generalspace + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public void updateGeneralspaceByWorkspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest) throws ApiException { + updateGeneralspaceByWorkspaceWithHttpInfo(workspace, generalspaceUpdateRequest); + } + + /** + * Update the given generalspace + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public ApiResponse updateGeneralspaceByWorkspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateGeneralspaceByWorkspaceValidateBeforeCall(workspace, generalspaceUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the given generalspace (asynchronously) + * Update a generalspace + * @param workspace The workspace name or id (required) + * @param generalspaceUpdateRequest The request body containing the generalspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Generalspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateGeneralspaceByWorkspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull GeneralspaceUpdateRequest generalspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateGeneralspaceByWorkspaceValidateBeforeCall(workspace, generalspaceUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/ImagesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/ImagesApi.java new file mode 100644 index 0000000..d05c281 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/ImagesApi.java @@ -0,0 +1,214 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import java.io.File; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ImagesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ImagesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImagesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getImage + * @param imageId The image id in the form img_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful image response -
404 Image does not exist -
0 error response -
+ */ + public okhttp3.Call getImageCall(@javax.annotation.Nonnull String imageId, 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 = "/static/images/{image_id}" + .replace("{" + "image_id" + "}", localVarApiClient.escapeString(imageId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "image/png", + "image/jpeg", + "image/gif", + "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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getImageValidateBeforeCall(@javax.annotation.Nonnull String imageId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException("Missing the required parameter 'imageId' when calling getImage(Async)"); + } + + return getImageCall(imageId, _callback); + + } + + /** + * Retrieves the given image + * End point to get the given workspace + * @param imageId The image id in the form img_9m4e2mr0ui3e8a215n4g (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful image response -
404 Image does not exist -
0 error response -
+ */ + public File getImage(@javax.annotation.Nonnull String imageId) throws ApiException { + ApiResponse localVarResp = getImageWithHttpInfo(imageId); + return localVarResp.getData(); + } + + /** + * Retrieves the given image + * End point to get the given workspace + * @param imageId The image id in the form img_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful image response -
404 Image does not exist -
0 error response -
+ */ + public ApiResponse getImageWithHttpInfo(@javax.annotation.Nonnull String imageId) throws ApiException { + okhttp3.Call localVarCall = getImageValidateBeforeCall(imageId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the given image (asynchronously) + * End point to get the given workspace + * @param imageId The image id in the form img_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful image response -
404 Image does not exist -
0 error response -
+ */ + public okhttp3.Call getImageAsync(@javax.annotation.Nonnull String imageId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getImageValidateBeforeCall(imageId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/InvitationsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/InvitationsApi.java new file mode 100644 index 0000000..196764a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/InvitationsApi.java @@ -0,0 +1,779 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.InvitationRespondRequest; +import io.tiledb.cloud.rest_api.v4.model.InvitationRetrieveRequest; +import io.tiledb.cloud.rest_api.v4.model.InvitationRetrieveResponse; +import io.tiledb.cloud.rest_api.v4.model.InvitationsCreateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.InvitationsListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InvitationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InvitationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public InvitationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createInvitations + * @param workspace The workspace name or id (required) + * @param invitationsCreateRequestInner The request body containing the invitation to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Invitations created -
0 An error occurred -
+ */ + public okhttp3.Call createInvitationsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List invitationsCreateRequestInner, 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 = invitationsCreateRequestInner; + + // create path and map variables + String localVarPath = "/invitations/admin/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createInvitationsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List invitationsCreateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createInvitations(Async)"); + } + + // verify the required parameter 'invitationsCreateRequestInner' is set + if (invitationsCreateRequestInner == null) { + throw new ApiException("Missing the required parameter 'invitationsCreateRequestInner' when calling createInvitations(Async)"); + } + + return createInvitationsCall(workspace, invitationsCreateRequestInner, _callback); + + } + + /** + * Create one or more invitations + * Create one or more invitations + * @param workspace The workspace name or id (required) + * @param invitationsCreateRequestInner The request body containing the invitation to create (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Invitations created -
0 An error occurred -
+ */ + public void createInvitations(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List invitationsCreateRequestInner) throws ApiException { + createInvitationsWithHttpInfo(workspace, invitationsCreateRequestInner); + } + + /** + * Create one or more invitations + * Create one or more invitations + * @param workspace The workspace name or id (required) + * @param invitationsCreateRequestInner The request body containing the invitation to create (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Invitations created -
0 An error occurred -
+ */ + public ApiResponse createInvitationsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List invitationsCreateRequestInner) throws ApiException { + okhttp3.Call localVarCall = createInvitationsValidateBeforeCall(workspace, invitationsCreateRequestInner, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create one or more invitations (asynchronously) + * Create one or more invitations + * @param workspace The workspace name or id (required) + * @param invitationsCreateRequestInner The request body containing the invitation to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Invitations created -
0 An error occurred -
+ */ + public okhttp3.Call createInvitationsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List invitationsCreateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createInvitationsValidateBeforeCall(workspace, invitationsCreateRequestInner, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getInvitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRetrieveRequest The request body for retrieving an invitation (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 + + + + + +
Response Details
Status Code Description Response Headers
200 Invitation retrieved -
0 An error occurred -
+ */ + public okhttp3.Call getInvitationCall(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRetrieveRequest invitationRetrieveRequest, 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 = invitationRetrieveRequest; + + // create path and map variables + String localVarPath = "/invitations/{invitation_id}" + .replace("{" + "invitation_id" + "}", localVarApiClient.escapeString(invitationId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInvitationValidateBeforeCall(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRetrieveRequest invitationRetrieveRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationId' is set + if (invitationId == null) { + throw new ApiException("Missing the required parameter 'invitationId' when calling getInvitation(Async)"); + } + + // verify the required parameter 'invitationRetrieveRequest' is set + if (invitationRetrieveRequest == null) { + throw new ApiException("Missing the required parameter 'invitationRetrieveRequest' when calling getInvitation(Async)"); + } + + return getInvitationCall(invitationId, invitationRetrieveRequest, _callback); + + } + + /** + * Retrieve an invitation + * Invitee retrieves an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRetrieveRequest The request body for retrieving an invitation (required) + * @return InvitationRetrieveResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitation retrieved -
0 An error occurred -
+ */ + public InvitationRetrieveResponse getInvitation(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRetrieveRequest invitationRetrieveRequest) throws ApiException { + ApiResponse localVarResp = getInvitationWithHttpInfo(invitationId, invitationRetrieveRequest); + return localVarResp.getData(); + } + + /** + * Retrieve an invitation + * Invitee retrieves an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRetrieveRequest The request body for retrieving an invitation (required) + * @return ApiResponse<InvitationRetrieveResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitation retrieved -
0 An error occurred -
+ */ + public ApiResponse getInvitationWithHttpInfo(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRetrieveRequest invitationRetrieveRequest) throws ApiException { + okhttp3.Call localVarCall = getInvitationValidateBeforeCall(invitationId, invitationRetrieveRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve an invitation (asynchronously) + * Invitee retrieves an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRetrieveRequest The request body for retrieving an invitation (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 + + + + + +
Response Details
Status Code Description Response Headers
200 Invitation retrieved -
0 An error occurred -
+ */ + public okhttp3.Call getInvitationAsync(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRetrieveRequest invitationRetrieveRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getInvitationValidateBeforeCall(invitationId, invitationRetrieveRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listInvitations + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitations list retrieved -
0 An error occurred -
+ */ + public okhttp3.Call listInvitationsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, 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 = "/invitations/admin/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listInvitationsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listInvitations(Async)"); + } + + return listInvitationsCall(workspace, page, perPage, _callback); + + } + + /** + * Retrieve all sent invitations + * Retrieve all invitations that the user has sent + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return InvitationsListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitations list retrieved -
0 An error occurred -
+ */ + public InvitationsListResponse listInvitations(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + ApiResponse localVarResp = listInvitationsWithHttpInfo(workspace, page, perPage); + return localVarResp.getData(); + } + + /** + * Retrieve all sent invitations + * Retrieve all invitations that the user has sent + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<InvitationsListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitations list retrieved -
0 An error occurred -
+ */ + public ApiResponse listInvitationsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + okhttp3.Call localVarCall = listInvitationsValidateBeforeCall(workspace, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve all sent invitations (asynchronously) + * Retrieve all invitations that the user has sent + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Invitations list retrieved -
0 An error occurred -
+ */ + public okhttp3.Call listInvitationsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listInvitationsValidateBeforeCall(workspace, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for respondInvitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRespondRequest The request body for responding to an invitation (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation responded to -
0 An error occurred -
+ */ + public okhttp3.Call respondInvitationCall(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRespondRequest invitationRespondRequest, 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 = invitationRespondRequest; + + // create path and map variables + String localVarPath = "/invitations/{invitation_id}" + .replace("{" + "invitation_id" + "}", localVarApiClient.escapeString(invitationId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call respondInvitationValidateBeforeCall(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRespondRequest invitationRespondRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationId' is set + if (invitationId == null) { + throw new ApiException("Missing the required parameter 'invitationId' when calling respondInvitation(Async)"); + } + + // verify the required parameter 'invitationRespondRequest' is set + if (invitationRespondRequest == null) { + throw new ApiException("Missing the required parameter 'invitationRespondRequest' when calling respondInvitation(Async)"); + } + + return respondInvitationCall(invitationId, invitationRespondRequest, _callback); + + } + + /** + * Respond to an invitation + * Invitee responds to an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRespondRequest The request body for responding to an invitation (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation responded to -
0 An error occurred -
+ */ + public void respondInvitation(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRespondRequest invitationRespondRequest) throws ApiException { + respondInvitationWithHttpInfo(invitationId, invitationRespondRequest); + } + + /** + * Respond to an invitation + * Invitee responds to an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRespondRequest The request body for responding to an invitation (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation responded to -
0 An error occurred -
+ */ + public ApiResponse respondInvitationWithHttpInfo(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRespondRequest invitationRespondRequest) throws ApiException { + okhttp3.Call localVarCall = respondInvitationValidateBeforeCall(invitationId, invitationRespondRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Respond to an invitation (asynchronously) + * Invitee responds to an invitation + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @param invitationRespondRequest The request body for responding to an invitation (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation responded to -
0 An error occurred -
+ */ + public okhttp3.Call respondInvitationAsync(@javax.annotation.Nonnull String invitationId, @javax.annotation.Nonnull InvitationRespondRequest invitationRespondRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = respondInvitationValidateBeforeCall(invitationId, invitationRespondRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for revokeInvitation + * @param workspace The workspace name or id (required) + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation revoked -
0 An error occurred -
+ */ + public okhttp3.Call revokeInvitationCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String invitationId, 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 = "/invitations/admin/{workspace}/{invitation_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "invitation_id" + "}", localVarApiClient.escapeString(invitationId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeInvitationValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String invitationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling revokeInvitation(Async)"); + } + + // verify the required parameter 'invitationId' is set + if (invitationId == null) { + throw new ApiException("Missing the required parameter 'invitationId' when calling revokeInvitation(Async)"); + } + + return revokeInvitationCall(workspace, invitationId, _callback); + + } + + /** + * Revoke an invitation + * Inviter revokes a previously-sent invitation + * @param workspace The workspace name or id (required) + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation revoked -
0 An error occurred -
+ */ + public void revokeInvitation(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String invitationId) throws ApiException { + revokeInvitationWithHttpInfo(workspace, invitationId); + } + + /** + * Revoke an invitation + * Inviter revokes a previously-sent invitation + * @param workspace The workspace name or id (required) + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation revoked -
0 An error occurred -
+ */ + public ApiResponse revokeInvitationWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String invitationId) throws ApiException { + okhttp3.Call localVarCall = revokeInvitationValidateBeforeCall(workspace, invitationId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Revoke an invitation (asynchronously) + * Inviter revokes a previously-sent invitation + * @param workspace The workspace name or id (required) + * @param invitationId The invitation ID in the form inv_9m4e2mr0ui3e8a215n4g (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Invitation revoked -
0 An error occurred -
+ */ + public okhttp3.Call revokeInvitationAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String invitationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeInvitationValidateBeforeCall(workspace, invitationId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/OnboardingApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/OnboardingApi.java new file mode 100644 index 0000000..fae6589 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/OnboardingApi.java @@ -0,0 +1,442 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.OnboardingGetItemsResponse; +import io.tiledb.cloud.rest_api.v4.model.OnboardingSetItemsRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OnboardingApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OnboardingApi() { + this(Configuration.getDefaultApiClient()); + } + + public OnboardingApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteOnboardingItems + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 UI requests Rest server to delete Onboarding items -
0 error response -
+ */ + public okhttp3.Call deleteOnboardingItemsCall(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 = "/onboarding"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOnboardingItemsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return deleteOnboardingItemsCall(_callback); + + } + + /** + * Delete Onboarding items + * Delete Onboarding items + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 UI requests Rest server to delete Onboarding items -
0 error response -
+ */ + public void deleteOnboardingItems() throws ApiException { + deleteOnboardingItemsWithHttpInfo(); + } + + /** + * Delete Onboarding items + * Delete Onboarding items + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 UI requests Rest server to delete Onboarding items -
0 error response -
+ */ + public ApiResponse deleteOnboardingItemsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = deleteOnboardingItemsValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Onboarding items (asynchronously) + * Delete Onboarding items + * @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 + + + + + +
Response Details
Status Code Description Response Headers
204 UI requests Rest server to delete Onboarding items -
0 error response -
+ */ + public okhttp3.Call deleteOnboardingItemsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOnboardingItemsValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getOnboardingItems + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Onboarding Items -
0 error response -
+ */ + public okhttp3.Call getOnboardingItemsCall(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 = "/onboarding"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOnboardingItemsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOnboardingItemsCall(_callback); + + } + + /** + * Get onboarding items + * Get onboarding items + * @return OnboardingGetItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Onboarding Items -
0 error response -
+ */ + public OnboardingGetItemsResponse getOnboardingItems() throws ApiException { + ApiResponse localVarResp = getOnboardingItemsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get onboarding items + * Get onboarding items + * @return ApiResponse<OnboardingGetItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Onboarding Items -
0 error response -
+ */ + public ApiResponse getOnboardingItemsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOnboardingItemsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get onboarding items (asynchronously) + * Get onboarding items + * @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 + + + + + +
Response Details
Status Code Description Response Headers
200 Onboarding Items -
0 error response -
+ */ + public okhttp3.Call getOnboardingItemsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOnboardingItemsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setOnboardingItems + * @param onboardingSetItemsRequest workspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Onboarding item complete -
0 error response -
+ */ + public okhttp3.Call setOnboardingItemsCall(@javax.annotation.Nonnull OnboardingSetItemsRequest onboardingSetItemsRequest, 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 = onboardingSetItemsRequest; + + // create path and map variables + String localVarPath = "/onboarding"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setOnboardingItemsValidateBeforeCall(@javax.annotation.Nonnull OnboardingSetItemsRequest onboardingSetItemsRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'onboardingSetItemsRequest' is set + if (onboardingSetItemsRequest == null) { + throw new ApiException("Missing the required parameter 'onboardingSetItemsRequest' when calling setOnboardingItems(Async)"); + } + + return setOnboardingItemsCall(onboardingSetItemsRequest, _callback); + + } + + /** + * Set Onboarding items + * Set Onboarding items + * @param onboardingSetItemsRequest workspace to create (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Onboarding item complete -
0 error response -
+ */ + public void setOnboardingItems(@javax.annotation.Nonnull OnboardingSetItemsRequest onboardingSetItemsRequest) throws ApiException { + setOnboardingItemsWithHttpInfo(onboardingSetItemsRequest); + } + + /** + * Set Onboarding items + * Set Onboarding items + * @param onboardingSetItemsRequest workspace to create (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Onboarding item complete -
0 error response -
+ */ + public ApiResponse setOnboardingItemsWithHttpInfo(@javax.annotation.Nonnull OnboardingSetItemsRequest onboardingSetItemsRequest) throws ApiException { + okhttp3.Call localVarCall = setOnboardingItemsValidateBeforeCall(onboardingSetItemsRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Set Onboarding items (asynchronously) + * Set Onboarding items + * @param onboardingSetItemsRequest workspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Onboarding item complete -
0 error response -
+ */ + public okhttp3.Call setOnboardingItemsAsync(@javax.annotation.Nonnull OnboardingSetItemsRequest onboardingSetItemsRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setOnboardingItemsValidateBeforeCall(onboardingSetItemsRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/StoragesettingsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/StoragesettingsApi.java new file mode 100644 index 0000000..5616351 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/StoragesettingsApi.java @@ -0,0 +1,841 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingGetResponse; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingsCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingsCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingsListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StoragesettingsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public StoragesettingsApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoragesettingsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createStorageSetting + * @param workspace The workspace name or id (required) + * @param storageSettingsCreateRequest The request body containing the storage setting to create (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Storage settings created -
0 error response -
+ */ + public okhttp3.Call createStorageSettingCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingsCreateRequest storageSettingsCreateRequest, @javax.annotation.Nullable String teamspaceId, 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 = storageSettingsCreateRequest; + + // create path and map variables + String localVarPath = "/storagesettings/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createStorageSettingValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingsCreateRequest storageSettingsCreateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createStorageSetting(Async)"); + } + + // verify the required parameter 'storageSettingsCreateRequest' is set + if (storageSettingsCreateRequest == null) { + throw new ApiException("Missing the required parameter 'storageSettingsCreateRequest' when calling createStorageSetting(Async)"); + } + + return createStorageSettingCall(workspace, storageSettingsCreateRequest, teamspaceId, _callback); + + } + + /** + * Create a new storage setting + * create a storage setting + * @param workspace The workspace name or id (required) + * @param storageSettingsCreateRequest The request body containing the storage setting to create (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return StorageSettingsCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Storage settings created -
0 error response -
+ */ + public StorageSettingsCreateResponse createStorageSetting(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingsCreateRequest storageSettingsCreateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + ApiResponse localVarResp = createStorageSettingWithHttpInfo(workspace, storageSettingsCreateRequest, teamspaceId); + return localVarResp.getData(); + } + + /** + * Create a new storage setting + * create a storage setting + * @param workspace The workspace name or id (required) + * @param storageSettingsCreateRequest The request body containing the storage setting to create (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<StorageSettingsCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Storage settings created -
0 error response -
+ */ + public ApiResponse createStorageSettingWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingsCreateRequest storageSettingsCreateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = createStorageSettingValidateBeforeCall(workspace, storageSettingsCreateRequest, teamspaceId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new storage setting (asynchronously) + * create a storage setting + * @param workspace The workspace name or id (required) + * @param storageSettingsCreateRequest The request body containing the storage setting to create (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Storage settings created -
0 error response -
+ */ + public okhttp3.Call createStorageSettingAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingsCreateRequest storageSettingsCreateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createStorageSettingValidateBeforeCall(workspace, storageSettingsCreateRequest, teamspaceId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteStorageSettingByID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 storage setting deleted -
0 error response -
+ */ + public okhttp3.Call deleteStorageSettingByIDCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, 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 = "/storagesettings/{workspace}/{stset_id}" + .replace("{" + "stset_id" + "}", localVarApiClient.escapeString(stsetId.toString())) + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteStorageSettingByIDValidateBeforeCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stsetId' is set + if (stsetId == null) { + throw new ApiException("Missing the required parameter 'stsetId' when calling deleteStorageSettingByID(Async)"); + } + + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteStorageSettingByID(Async)"); + } + + return deleteStorageSettingByIDCall(stsetId, workspace, teamspaceId, _callback); + + } + + /** + * Delete storage setting + * Delete the storage setting. + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 storage setting deleted -
0 error response -
+ */ + public void deleteStorageSettingByID(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId) throws ApiException { + deleteStorageSettingByIDWithHttpInfo(stsetId, workspace, teamspaceId); + } + + /** + * Delete storage setting + * Delete the storage setting. + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 storage setting deleted -
0 error response -
+ */ + public ApiResponse deleteStorageSettingByIDWithHttpInfo(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = deleteStorageSettingByIDValidateBeforeCall(stsetId, workspace, teamspaceId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete storage setting (asynchronously) + * Delete the storage setting. + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 storage setting deleted -
0 error response -
+ */ + public okhttp3.Call deleteStorageSettingByIDAsync(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteStorageSettingByIDValidateBeforeCall(stsetId, workspace, teamspaceId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getStorageSettingByID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage setting response -
404 Storage setting does not exist -
0 error response -
+ */ + public okhttp3.Call getStorageSettingByIDCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, 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 = "/storagesettings/{workspace}/{stset_id}" + .replace("{" + "stset_id" + "}", localVarApiClient.escapeString(stsetId.toString())) + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStorageSettingByIDValidateBeforeCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stsetId' is set + if (stsetId == null) { + throw new ApiException("Missing the required parameter 'stsetId' when calling getStorageSettingByID(Async)"); + } + + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getStorageSettingByID(Async)"); + } + + return getStorageSettingByIDCall(stsetId, workspace, teamspaceId, _callback); + + } + + /** + * Get storage setting + * get information about storage setting by ID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return StorageSettingGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage setting response -
404 Storage setting does not exist -
0 error response -
+ */ + public StorageSettingGetResponse getStorageSettingByID(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId) throws ApiException { + ApiResponse localVarResp = getStorageSettingByIDWithHttpInfo(stsetId, workspace, teamspaceId); + return localVarResp.getData(); + } + + /** + * Get storage setting + * get information about storage setting by ID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<StorageSettingGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage setting response -
404 Storage setting does not exist -
0 error response -
+ */ + public ApiResponse getStorageSettingByIDWithHttpInfo(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = getStorageSettingByIDValidateBeforeCall(stsetId, workspace, teamspaceId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get storage setting (asynchronously) + * get information about storage setting by ID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage setting response -
404 Storage setting does not exist -
0 error response -
+ */ + public okhttp3.Call getStorageSettingByIDAsync(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStorageSettingByIDValidateBeforeCall(stsetId, workspace, teamspaceId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listStorageSettings + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage settings list response -
0 error response -
+ */ + public okhttp3.Call listStorageSettingsCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, 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 = "/storagesettings/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listStorageSettingsValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listStorageSettings(Async)"); + } + + return listStorageSettingsCall(workspace, teamspaceId, page, perPage, _callback); + + } + + /** + * Get storage settings + * list the storage settings available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return StorageSettingsListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage settings list response -
0 error response -
+ */ + public StorageSettingsListResponse listStorageSettings(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + ApiResponse localVarResp = listStorageSettingsWithHttpInfo(workspace, teamspaceId, page, perPage); + return localVarResp.getData(); + } + + /** + * Get storage settings + * list the storage settings available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<StorageSettingsListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage settings list response -
0 error response -
+ */ + public ApiResponse listStorageSettingsWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + okhttp3.Call localVarCall = listStorageSettingsValidateBeforeCall(workspace, teamspaceId, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get storage settings (asynchronously) + * list the storage settings available for the user + * @param workspace The workspace name or id (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful storage settings list response -
0 error response -
+ */ + public okhttp3.Call listStorageSettingsAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String teamspaceId, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listStorageSettingsValidateBeforeCall(workspace, teamspaceId, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for patchStorageSettingByID + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param storageSettingUpdateRequest storage setting update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 The storage setting was updated successfully -
404 Storage setting does not exist -
0 error response -
+ */ + public okhttp3.Call patchStorageSettingByIDCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingUpdateRequest storageSettingUpdateRequest, @javax.annotation.Nullable String teamspaceId, 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 = storageSettingUpdateRequest; + + // create path and map variables + String localVarPath = "/storagesettings/{workspace}/{stset_id}" + .replace("{" + "stset_id" + "}", localVarApiClient.escapeString(stsetId.toString())) + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (teamspaceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamspace_id", teamspaceId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call patchStorageSettingByIDValidateBeforeCall(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingUpdateRequest storageSettingUpdateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'stsetId' is set + if (stsetId == null) { + throw new ApiException("Missing the required parameter 'stsetId' when calling patchStorageSettingByID(Async)"); + } + + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling patchStorageSettingByID(Async)"); + } + + // verify the required parameter 'storageSettingUpdateRequest' is set + if (storageSettingUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'storageSettingUpdateRequest' when calling patchStorageSettingByID(Async)"); + } + + return patchStorageSettingByIDCall(stsetId, workspace, storageSettingUpdateRequest, teamspaceId, _callback); + + } + + /** + * Update storage setting + * update storage setting given by the user + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param storageSettingUpdateRequest storage setting update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 The storage setting was updated successfully -
404 Storage setting does not exist -
0 error response -
+ */ + public void patchStorageSettingByID(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingUpdateRequest storageSettingUpdateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + patchStorageSettingByIDWithHttpInfo(stsetId, workspace, storageSettingUpdateRequest, teamspaceId); + } + + /** + * Update storage setting + * update storage setting given by the user + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param storageSettingUpdateRequest storage setting update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 The storage setting was updated successfully -
404 Storage setting does not exist -
0 error response -
+ */ + public ApiResponse patchStorageSettingByIDWithHttpInfo(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingUpdateRequest storageSettingUpdateRequest, @javax.annotation.Nullable String teamspaceId) throws ApiException { + okhttp3.Call localVarCall = patchStorageSettingByIDValidateBeforeCall(stsetId, workspace, storageSettingUpdateRequest, teamspaceId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update storage setting (asynchronously) + * update storage setting given by the user + * @param stsetId The storage setting id in the form stset_9m4e2mr0ui3e8a215n4g (required) + * @param workspace The workspace name or id (required) + * @param storageSettingUpdateRequest storage setting update details (required) + * @param teamspaceId Teamspace id should be empty, if the request is about an action on workspace level (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 The storage setting was updated successfully -
404 Storage setting does not exist -
0 error response -
+ */ + public okhttp3.Call patchStorageSettingByIDAsync(@javax.annotation.Nonnull String stsetId, @javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull StorageSettingUpdateRequest storageSettingUpdateRequest, @javax.annotation.Nullable String teamspaceId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = patchStorageSettingByIDValidateBeforeCall(stsetId, workspace, storageSettingUpdateRequest, teamspaceId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/TeamspacesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/TeamspacesApi.java new file mode 100644 index 0000000..effeadd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/TeamspacesApi.java @@ -0,0 +1,2298 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceGetResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUserGetResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUserUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersBulkUpdateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersCreateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersJoinResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUsersListResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspacesCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.TeamspacesCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.TeamspacesListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TeamspacesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TeamspacesApi() { + this(Configuration.getDefaultApiClient()); + } + + public TeamspacesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createTeamspaceUsers + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersCreateRequestInner The request body containing the teamspace users to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace users created -
0 An error occurred -
+ */ + public okhttp3.Call createTeamspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersCreateRequestInner, 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 = teamspaceUsersCreateRequestInner; + + // create path and map variables + String localVarPath = "/teamspaces/{workspace}/{teamspace}/users" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTeamspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersCreateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling createTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspaceUsersCreateRequestInner' is set + if (teamspaceUsersCreateRequestInner == null) { + throw new ApiException("Missing the required parameter 'teamspaceUsersCreateRequestInner' when calling createTeamspaceUsers(Async)"); + } + + return createTeamspaceUsersCall(workspace, teamspace, teamspaceUsersCreateRequestInner, _callback); + + } + + /** + * Create one or more teamspace users in a teamspace + * Create one or more teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersCreateRequestInner The request body containing the teamspace users to create (required) + * @return TeamspaceUsersCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace users created -
0 An error occurred -
+ */ + public TeamspaceUsersCreateResponse createTeamspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersCreateRequestInner) throws ApiException { + ApiResponse localVarResp = createTeamspaceUsersWithHttpInfo(workspace, teamspace, teamspaceUsersCreateRequestInner); + return localVarResp.getData(); + } + + /** + * Create one or more teamspace users in a teamspace + * Create one or more teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersCreateRequestInner The request body containing the teamspace users to create (required) + * @return ApiResponse<TeamspaceUsersCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace users created -
0 An error occurred -
+ */ + public ApiResponse createTeamspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersCreateRequestInner) throws ApiException { + okhttp3.Call localVarCall = createTeamspaceUsersValidateBeforeCall(workspace, teamspace, teamspaceUsersCreateRequestInner, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create one or more teamspace users in a teamspace (asynchronously) + * Create one or more teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersCreateRequestInner The request body containing the teamspace users to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace users created -
0 An error occurred -
+ */ + public okhttp3.Call createTeamspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersCreateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createTeamspaceUsersValidateBeforeCall(workspace, teamspace, teamspaceUsersCreateRequestInner, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createTeamspaces + * @param workspace The workspace name or id (required) + * @param teamspacesCreateRequest The request body containing the teamspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspaces created -
0 An error occurred -
+ */ + public okhttp3.Call createTeamspacesCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull TeamspacesCreateRequest teamspacesCreateRequest, 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 = teamspacesCreateRequest; + + // create path and map variables + String localVarPath = "/teamspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTeamspacesValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull TeamspacesCreateRequest teamspacesCreateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createTeamspaces(Async)"); + } + + // verify the required parameter 'teamspacesCreateRequest' is set + if (teamspacesCreateRequest == null) { + throw new ApiException("Missing the required parameter 'teamspacesCreateRequest' when calling createTeamspaces(Async)"); + } + + return createTeamspacesCall(workspace, teamspacesCreateRequest, _callback); + + } + + /** + * Create a teamspace + * Create a teamspace. The user creating the teamspace will be the teamspace owner. + * @param workspace The workspace name or id (required) + * @param teamspacesCreateRequest The request body containing the teamspace to create (required) + * @return TeamspacesCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspaces created -
0 An error occurred -
+ */ + public TeamspacesCreateResponse createTeamspaces(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull TeamspacesCreateRequest teamspacesCreateRequest) throws ApiException { + ApiResponse localVarResp = createTeamspacesWithHttpInfo(workspace, teamspacesCreateRequest); + return localVarResp.getData(); + } + + /** + * Create a teamspace + * Create a teamspace. The user creating the teamspace will be the teamspace owner. + * @param workspace The workspace name or id (required) + * @param teamspacesCreateRequest The request body containing the teamspace to create (required) + * @return ApiResponse<TeamspacesCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspaces created -
0 An error occurred -
+ */ + public ApiResponse createTeamspacesWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull TeamspacesCreateRequest teamspacesCreateRequest) throws ApiException { + okhttp3.Call localVarCall = createTeamspacesValidateBeforeCall(workspace, teamspacesCreateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a teamspace (asynchronously) + * Create a teamspace. The user creating the teamspace will be the teamspace owner. + * @param workspace The workspace name or id (required) + * @param teamspacesCreateRequest The request body containing the teamspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspaces created -
0 An error occurred -
+ */ + public okhttp3.Call createTeamspacesAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull TeamspacesCreateRequest teamspacesCreateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createTeamspacesValidateBeforeCall(workspace, teamspacesCreateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteTeamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace deleted -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Boolean deleteAssets, 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 = "/teamspaces/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (deleteAssets != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("delete-assets", deleteAssets)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTeamspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Boolean deleteAssets, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteTeamspace(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling deleteTeamspace(Async)"); + } + + return deleteTeamspaceCall(workspace, teamspace, deleteAssets, _callback); + + } + + /** + * Delete a teamspace + * Delete the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace deleted -
0 An error occurred -
+ */ + public void deleteTeamspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Boolean deleteAssets) throws ApiException { + deleteTeamspaceWithHttpInfo(workspace, teamspace, deleteAssets); + } + + /** + * Delete a teamspace + * Delete the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace deleted -
0 An error occurred -
+ */ + public ApiResponse deleteTeamspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Boolean deleteAssets) throws ApiException { + okhttp3.Call localVarCall = deleteTeamspaceValidateBeforeCall(workspace, teamspace, deleteAssets, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a teamspace (asynchronously) + * Delete the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param deleteAssets If `true`, the entity's assets will be deregistered in TileDB *and* deleted from the underlying storage (e.g., S3). If `false`, the entity's assets will be deregistered in TileDB but remain in the underlying storage. (optional, default to false) + * @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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace deleted -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nullable Boolean deleteAssets, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTeamspaceValidateBeforeCall(workspace, teamspace, deleteAssets, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteTeamspaceUser + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user deleted -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, 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 = "/teamspaces/{workspace}/{teamspace}/users/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTeamspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteTeamspaceUser(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling deleteTeamspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteTeamspaceUser(Async)"); + } + + return deleteTeamspaceUserCall(workspace, teamspace, userId, _callback); + + } + + /** + * Delete a teamspace user + * Delete the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user deleted -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public void deleteTeamspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId) throws ApiException { + deleteTeamspaceUserWithHttpInfo(workspace, teamspace, userId); + } + + /** + * Delete a teamspace user + * Delete the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user deleted -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse deleteTeamspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = deleteTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a teamspace user (asynchronously) + * Delete the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user deleted -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteTeamspaceUsers + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param requestBody The request body containing the teamspace users to delete (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users deleted -
404 One or more of the given teamspace users do not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/actions/teamspaces/{workspace}/{teamspace}/users/bulk_delete" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTeamspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List requestBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling deleteTeamspaceUsers(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling deleteTeamspaceUsers(Async)"); + } + + return deleteTeamspaceUsersCall(workspace, teamspace, requestBody, _callback); + + } + + /** + * Delete the given teamspace users in a teamspace + * Delete the given teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param requestBody The request body containing the teamspace users to delete (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users deleted -
404 One or more of the given teamspace users do not exist -
0 An error occurred -
+ */ + public void deleteTeamspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List requestBody) throws ApiException { + deleteTeamspaceUsersWithHttpInfo(workspace, teamspace, requestBody); + } + + /** + * Delete the given teamspace users in a teamspace + * Delete the given teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param requestBody The request body containing the teamspace users to delete (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users deleted -
404 One or more of the given teamspace users do not exist -
0 An error occurred -
+ */ + public ApiResponse deleteTeamspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List requestBody) throws ApiException { + okhttp3.Call localVarCall = deleteTeamspaceUsersValidateBeforeCall(workspace, teamspace, requestBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete the given teamspace users in a teamspace (asynchronously) + * Delete the given teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param requestBody The request body containing the teamspace users to delete (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users deleted -
404 One or more of the given teamspace users do not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTeamspaceUsersValidateBeforeCall(workspace, teamspace, requestBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteTeamspaces + * @param workspace The workspace name or id (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspaces deleted -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspacesCall(@javax.annotation.Nonnull String workspace, 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 = "/teamspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTeamspacesValidateBeforeCall(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteTeamspaces(Async)"); + } + + return deleteTeamspacesCall(workspace, _callback); + + } + + /** + * Delete all teamspaces in the workspace + * Delete all teamspaces in the workspace + * @param workspace The workspace name or id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspaces deleted -
0 An error occurred -
+ */ + public void deleteTeamspaces(@javax.annotation.Nonnull String workspace) throws ApiException { + deleteTeamspacesWithHttpInfo(workspace); + } + + /** + * Delete all teamspaces in the workspace + * Delete all teamspaces in the workspace + * @param workspace The workspace name or id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspaces deleted -
0 An error occurred -
+ */ + public ApiResponse deleteTeamspacesWithHttpInfo(@javax.annotation.Nonnull String workspace) throws ApiException { + okhttp3.Call localVarCall = deleteTeamspacesValidateBeforeCall(workspace, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete all teamspaces in the workspace (asynchronously) + * Delete all teamspaces in the workspace + * @param workspace The workspace name or id (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspaces deleted -
0 An error occurred -
+ */ + public okhttp3.Call deleteTeamspacesAsync(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTeamspacesValidateBeforeCall(workspace, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getTeamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace retrieved -
404 Teamspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getTeamspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, 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 = "/teamspaces/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTeamspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getTeamspace(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getTeamspace(Async)"); + } + + return getTeamspaceCall(workspace, teamspace, _callback); + + } + + /** + * Retrieve a teamspace + * Retrieve the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return TeamspaceGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace retrieved -
404 Teamspace does not exist -
0 An error occurred -
+ */ + public TeamspaceGetResponse getTeamspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + ApiResponse localVarResp = getTeamspaceWithHttpInfo(workspace, teamspace); + return localVarResp.getData(); + } + + /** + * Retrieve a teamspace + * Retrieve the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return ApiResponse<TeamspaceGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace retrieved -
404 Teamspace does not exist -
0 An error occurred -
+ */ + public ApiResponse getTeamspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + okhttp3.Call localVarCall = getTeamspaceValidateBeforeCall(workspace, teamspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a teamspace (asynchronously) + * Retrieve the given teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace retrieved -
404 Teamspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getTeamspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTeamspaceValidateBeforeCall(workspace, teamspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTeamspaceUser + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace user retrieved -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getTeamspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, 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 = "/teamspaces/{workspace}/{teamspace}/users/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTeamspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getTeamspaceUser(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling getTeamspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getTeamspaceUser(Async)"); + } + + return getTeamspaceUserCall(workspace, teamspace, userId, _callback); + + } + + /** + * Retrieve a teamspace user + * Retrieve the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return TeamspaceUserGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace user retrieved -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public TeamspaceUserGetResponse getTeamspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId) throws ApiException { + ApiResponse localVarResp = getTeamspaceUserWithHttpInfo(workspace, teamspace, userId); + return localVarResp.getData(); + } + + /** + * Retrieve a teamspace user + * Retrieve the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<TeamspaceUserGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace user retrieved -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse getTeamspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = getTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a teamspace user (asynchronously) + * Retrieve the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace user retrieved -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getTeamspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for joinTeamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace joined -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call joinTeamspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, 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 = "/actions/teamspaces/{workspace}/{teamspace}/users/join" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call joinTeamspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling joinTeamspace(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling joinTeamspace(Async)"); + } + + return joinTeamspaceCall(workspace, teamspace, _callback); + + } + + /** + * Join the given public teamspace + * Allows users to join a public teamspace if they are a member of the corresponding workspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return TeamspaceUsersJoinResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace joined -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public TeamspaceUsersJoinResponse joinTeamspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + ApiResponse localVarResp = joinTeamspaceWithHttpInfo(workspace, teamspace); + return localVarResp.getData(); + } + + /** + * Join the given public teamspace + * Allows users to join a public teamspace if they are a member of the corresponding workspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return ApiResponse<TeamspaceUsersJoinResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace joined -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public ApiResponse joinTeamspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + okhttp3.Call localVarCall = joinTeamspaceValidateBeforeCall(workspace, teamspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Join the given public teamspace (asynchronously) + * Allows users to join a public teamspace if they are a member of the corresponding workspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
201 Teamspace joined -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call joinTeamspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = joinTeamspaceValidateBeforeCall(workspace, teamspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for leaveTeamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace left -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call leaveTeamspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, 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 = "/actions/teamspaces/{workspace}/{teamspace}/users/leave" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call leaveTeamspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling leaveTeamspace(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling leaveTeamspace(Async)"); + } + + return leaveTeamspaceCall(workspace, teamspace, _callback); + + } + + /** + * Leave the given teamspace + * Allows teamspace members to leave a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace left -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public void leaveTeamspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + leaveTeamspaceWithHttpInfo(workspace, teamspace); + } + + /** + * Leave the given teamspace + * Allows teamspace members to leave a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace left -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public ApiResponse leaveTeamspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + okhttp3.Call localVarCall = leaveTeamspaceValidateBeforeCall(workspace, teamspace, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Leave the given teamspace (asynchronously) + * Allows teamspace members to leave a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace left -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call leaveTeamspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = leaveTeamspaceValidateBeforeCall(workspace, teamspace, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for listTeamspaceUsers + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace users list retrieved -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listTeamspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, 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 = "/teamspaces/{workspace}/{teamspace}/users" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTeamspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling listTeamspaceUsers(Async)"); + } + + return listTeamspaceUsersCall(workspace, teamspace, _callback); + + } + + /** + * Retrieve all teamspace users in a teamspace + * Retrieve a list of all teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return TeamspaceUsersListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace users list retrieved -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public TeamspaceUsersListResponse listTeamspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + ApiResponse localVarResp = listTeamspaceUsersWithHttpInfo(workspace, teamspace); + return localVarResp.getData(); + } + + /** + * Retrieve all teamspace users in a teamspace + * Retrieve a list of all teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @return ApiResponse<TeamspaceUsersListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace users list retrieved -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public ApiResponse listTeamspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace) throws ApiException { + okhttp3.Call localVarCall = listTeamspaceUsersValidateBeforeCall(workspace, teamspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve all teamspace users in a teamspace (asynchronously) + * Retrieve a list of all teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspace users list retrieved -
404 Teamspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listTeamspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTeamspaceUsersValidateBeforeCall(workspace, teamspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listTeamspaces + * @param workspace The workspace name or id (required) + * @param orderBy The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at (optional) + * @param order Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc (optional) + * @param memberships If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. (optional, default to true) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspaces retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listTeamspacesCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Boolean memberships, 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 = "/teamspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (orderBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order_by", orderBy)); + } + + if (order != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); + } + + if (memberships != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("memberships", memberships)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTeamspacesValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Boolean memberships, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listTeamspaces(Async)"); + } + + return listTeamspacesCall(workspace, orderBy, order, memberships, _callback); + + } + + /** + * Retrieve teamspaces in the workspace + * If `memberships=true`, fetches teamspaces the user is a member of. If `memberships=false`, fetches public teamspaces the user is not a member of. + * @param workspace The workspace name or id (required) + * @param orderBy The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at (optional) + * @param order Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc (optional) + * @param memberships If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. (optional, default to true) + * @return TeamspacesListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspaces retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public TeamspacesListResponse listTeamspaces(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Boolean memberships) throws ApiException { + ApiResponse localVarResp = listTeamspacesWithHttpInfo(workspace, orderBy, order, memberships); + return localVarResp.getData(); + } + + /** + * Retrieve teamspaces in the workspace + * If `memberships=true`, fetches teamspaces the user is a member of. If `memberships=false`, fetches public teamspaces the user is not a member of. + * @param workspace The workspace name or id (required) + * @param orderBy The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at (optional) + * @param order Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc (optional) + * @param memberships If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. (optional, default to true) + * @return ApiResponse<TeamspacesListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspaces retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public ApiResponse listTeamspacesWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Boolean memberships) throws ApiException { + okhttp3.Call localVarCall = listTeamspacesValidateBeforeCall(workspace, orderBy, order, memberships, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve teamspaces in the workspace (asynchronously) + * If `memberships=true`, fetches teamspaces the user is a member of. If `memberships=false`, fetches public teamspaces the user is not a member of. + * @param workspace The workspace name or id (required) + * @param orderBy The field to order the results by. Defaults to `created_at`. Can be one of the following: - name - created_at - updated_at (optional) + * @param order Specifies the sorting direction for the results returned by the query. Defaults to `desc`. Can be one of the following: - asc - desc (optional) + * @param memberships If true, returns teamspaces the user is a member of. If false, returns public teamspaces in the workspace that the user is NOT a member of. (optional, default to true) + * @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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Teamspaces retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listTeamspacesAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable String orderBy, @javax.annotation.Nullable String order, @javax.annotation.Nullable Boolean memberships, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTeamspacesValidateBeforeCall(workspace, orderBy, order, memberships, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateTeamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUpdateRequest The request body containing the teamspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull TeamspaceUpdateRequest teamspaceUpdateRequest, 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 = teamspaceUpdateRequest; + + // create path and map variables + String localVarPath = "/teamspaces/{workspace}/{teamspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTeamspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull TeamspaceUpdateRequest teamspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateTeamspace(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateTeamspace(Async)"); + } + + // verify the required parameter 'teamspaceUpdateRequest' is set + if (teamspaceUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'teamspaceUpdateRequest' when calling updateTeamspace(Async)"); + } + + return updateTeamspaceCall(workspace, teamspace, teamspaceUpdateRequest, _callback); + + } + + /** + * Update the given teamspace + * Update a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUpdateRequest The request body containing the teamspace to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace updated -
0 An error occurred -
+ */ + public void updateTeamspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull TeamspaceUpdateRequest teamspaceUpdateRequest) throws ApiException { + updateTeamspaceWithHttpInfo(workspace, teamspace, teamspaceUpdateRequest); + } + + /** + * Update the given teamspace + * Update a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUpdateRequest The request body containing the teamspace to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace updated -
0 An error occurred -
+ */ + public ApiResponse updateTeamspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull TeamspaceUpdateRequest teamspaceUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateTeamspaceValidateBeforeCall(workspace, teamspace, teamspaceUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the given teamspace (asynchronously) + * Update a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUpdateRequest The request body containing the teamspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull TeamspaceUpdateRequest teamspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTeamspaceValidateBeforeCall(workspace, teamspace, teamspaceUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateTeamspaceUser + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param teamspaceUserUpdateRequest The request body containing the teamspace user to update (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user updated -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull TeamspaceUserUpdateRequest teamspaceUserUpdateRequest, 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 = teamspaceUserUpdateRequest; + + // create path and map variables + String localVarPath = "/teamspaces/{workspace}/{teamspace}/users/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTeamspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull TeamspaceUserUpdateRequest teamspaceUserUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateTeamspaceUser(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateTeamspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling updateTeamspaceUser(Async)"); + } + + // verify the required parameter 'teamspaceUserUpdateRequest' is set + if (teamspaceUserUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'teamspaceUserUpdateRequest' when calling updateTeamspaceUser(Async)"); + } + + return updateTeamspaceUserCall(workspace, teamspace, userId, teamspaceUserUpdateRequest, _callback); + + } + + /** + * Update a teamspace user + * Update the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param teamspaceUserUpdateRequest The request body containing the teamspace user to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user updated -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public void updateTeamspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull TeamspaceUserUpdateRequest teamspaceUserUpdateRequest) throws ApiException { + updateTeamspaceUserWithHttpInfo(workspace, teamspace, userId, teamspaceUserUpdateRequest); + } + + /** + * Update a teamspace user + * Update the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param teamspaceUserUpdateRequest The request body containing the teamspace user to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user updated -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse updateTeamspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull TeamspaceUserUpdateRequest teamspaceUserUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, teamspaceUserUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update a teamspace user (asynchronously) + * Update the given teamspace user + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param userId The user ID in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param teamspaceUserUpdateRequest The request body containing the teamspace user to update (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace user updated -
404 Teamspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull TeamspaceUserUpdateRequest teamspaceUserUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTeamspaceUserValidateBeforeCall(workspace, teamspace, userId, teamspaceUserUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateTeamspaceUsers + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersBulkUpdateRequestInner The request body containing the teamspace users to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users updated successfully -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersBulkUpdateRequestInner, 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 = teamspaceUsersBulkUpdateRequestInner; + + // create path and map variables + String localVarPath = "/actions/teamspaces/{workspace}/{teamspace}/users/bulk_update" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTeamspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersBulkUpdateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspace' is set + if (teamspace == null) { + throw new ApiException("Missing the required parameter 'teamspace' when calling updateTeamspaceUsers(Async)"); + } + + // verify the required parameter 'teamspaceUsersBulkUpdateRequestInner' is set + if (teamspaceUsersBulkUpdateRequestInner == null) { + throw new ApiException("Missing the required parameter 'teamspaceUsersBulkUpdateRequestInner' when calling updateTeamspaceUsers(Async)"); + } + + return updateTeamspaceUsersCall(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner, _callback); + + } + + /** + * Update multiple teamspace users in a teamspace + * Update multiple teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersBulkUpdateRequestInner The request body containing the teamspace users to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users updated successfully -
0 An error occurred -
+ */ + public void updateTeamspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersBulkUpdateRequestInner) throws ApiException { + updateTeamspaceUsersWithHttpInfo(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner); + } + + /** + * Update multiple teamspace users in a teamspace + * Update multiple teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersBulkUpdateRequestInner The request body containing the teamspace users to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users updated successfully -
0 An error occurred -
+ */ + public ApiResponse updateTeamspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersBulkUpdateRequestInner) throws ApiException { + okhttp3.Call localVarCall = updateTeamspaceUsersValidateBeforeCall(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update multiple teamspace users in a teamspace (asynchronously) + * Update multiple teamspace users in a teamspace + * @param workspace The workspace name or id (required) + * @param teamspace The teamspace name or id (required) + * @param teamspaceUsersBulkUpdateRequestInner The request body containing the teamspace users to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Teamspace users updated successfully -
0 An error occurred -
+ */ + public okhttp3.Call updateTeamspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String teamspace, @javax.annotation.Nonnull List teamspaceUsersBulkUpdateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTeamspaceUsersValidateBeforeCall(workspace, teamspace, teamspaceUsersBulkUpdateRequestInner, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/TokensApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/TokensApi.java new file mode 100644 index 0000000..c2ba2ce --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/TokensApi.java @@ -0,0 +1,486 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.TokenCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.TokenCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.TokenListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TokensApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TokensApi() { + this(Configuration.getDefaultApiClient()); + } + + public TokensApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createToken + * @param tokenCreateRequest The request body containing the token to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Token created -
0 An error occurred -
+ */ + public okhttp3.Call createTokenCall(@javax.annotation.Nonnull TokenCreateRequest tokenCreateRequest, 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 = tokenCreateRequest; + + // create path and map variables + String localVarPath = "/tokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTokenValidateBeforeCall(@javax.annotation.Nonnull TokenCreateRequest tokenCreateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tokenCreateRequest' is set + if (tokenCreateRequest == null) { + throw new ApiException("Missing the required parameter 'tokenCreateRequest' when calling createToken(Async)"); + } + + return createTokenCall(tokenCreateRequest, _callback); + + } + + /** + * Create a new token + * Create a new token + * @param tokenCreateRequest The request body containing the token to create (required) + * @return TokenCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Token created -
0 An error occurred -
+ */ + public TokenCreateResponse createToken(@javax.annotation.Nonnull TokenCreateRequest tokenCreateRequest) throws ApiException { + ApiResponse localVarResp = createTokenWithHttpInfo(tokenCreateRequest); + return localVarResp.getData(); + } + + /** + * Create a new token + * Create a new token + * @param tokenCreateRequest The request body containing the token to create (required) + * @return ApiResponse<TokenCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Token created -
0 An error occurred -
+ */ + public ApiResponse createTokenWithHttpInfo(@javax.annotation.Nonnull TokenCreateRequest tokenCreateRequest) throws ApiException { + okhttp3.Call localVarCall = createTokenValidateBeforeCall(tokenCreateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new token (asynchronously) + * Create a new token + * @param tokenCreateRequest The request body containing the token to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Token created -
0 An error occurred -
+ */ + public okhttp3.Call createTokenAsync(@javax.annotation.Nonnull TokenCreateRequest tokenCreateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createTokenValidateBeforeCall(tokenCreateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listTokens + * @param type The type of tokens to retrieve (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Tokens retrieved -
0 An error occurred -
+ */ + public okhttp3.Call listTokensCall(@javax.annotation.Nonnull String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, 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 = "/tokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTokensValidateBeforeCall(@javax.annotation.Nonnull String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling listTokens(Async)"); + } + + return listTokensCall(type, page, perPage, _callback); + + } + + /** + * Retrieve all of the user's tokens + * Retrieve all of the user's tokens of the given type + * @param type The type of tokens to retrieve (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return TokenListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Tokens retrieved -
0 An error occurred -
+ */ + public TokenListResponse listTokens(@javax.annotation.Nonnull String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + ApiResponse localVarResp = listTokensWithHttpInfo(type, page, perPage); + return localVarResp.getData(); + } + + /** + * Retrieve all of the user's tokens + * Retrieve all of the user's tokens of the given type + * @param type The type of tokens to retrieve (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<TokenListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Tokens retrieved -
0 An error occurred -
+ */ + public ApiResponse listTokensWithHttpInfo(@javax.annotation.Nonnull String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage) throws ApiException { + okhttp3.Call localVarCall = listTokensValidateBeforeCall(type, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve all of the user's tokens (asynchronously) + * Retrieve all of the user's tokens of the given type + * @param type The type of tokens to retrieve (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Tokens retrieved -
0 An error occurred -
+ */ + public okhttp3.Call listTokensAsync(@javax.annotation.Nonnull String type, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTokensValidateBeforeCall(type, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeToken + * @param tokenId The ID of the token to revoke (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Token revoked -
0 An error occurred -
+ */ + public okhttp3.Call revokeTokenCall(@javax.annotation.Nonnull String tokenId, 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 = "/tokens/{token_id}" + .replace("{" + "token_id" + "}", localVarApiClient.escapeString(tokenId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeTokenValidateBeforeCall(@javax.annotation.Nonnull String tokenId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + throw new ApiException("Missing the required parameter 'tokenId' when calling revokeToken(Async)"); + } + + return revokeTokenCall(tokenId, _callback); + + } + + /** + * Revoke a token + * Revoke a token that was previously created + * @param tokenId The ID of the token to revoke (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Token revoked -
0 An error occurred -
+ */ + public void revokeToken(@javax.annotation.Nonnull String tokenId) throws ApiException { + revokeTokenWithHttpInfo(tokenId); + } + + /** + * Revoke a token + * Revoke a token that was previously created + * @param tokenId The ID of the token to revoke (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Token revoked -
0 An error occurred -
+ */ + public ApiResponse revokeTokenWithHttpInfo(@javax.annotation.Nonnull String tokenId) throws ApiException { + okhttp3.Call localVarCall = revokeTokenValidateBeforeCall(tokenId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Revoke a token (asynchronously) + * Revoke a token that was previously created + * @param tokenId The ID of the token to revoke (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Token revoked -
0 An error occurred -
+ */ + public okhttp3.Call revokeTokenAsync(@javax.annotation.Nonnull String tokenId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeTokenValidateBeforeCall(tokenId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/UsersApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/UsersApi.java new file mode 100644 index 0000000..a3c592b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/UsersApi.java @@ -0,0 +1,1396 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.ChangePasswordRequest; +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.RequestEmailConfirmationRequest; +import io.tiledb.cloud.rest_api.v4.model.RequestPasswordResetRequest; +import io.tiledb.cloud.rest_api.v4.model.ResetPasswordRequest; +import io.tiledb.cloud.rest_api.v4.model.UserCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.UserCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.UserGetResponse; +import io.tiledb.cloud.rest_api.v4.model.UserSelfResponse; +import io.tiledb.cloud.rest_api.v4.model.UserUpdateRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UsersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UsersApi() { + this(Configuration.getDefaultApiClient()); + } + + public UsersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for changePassword + * @param changePasswordRequest data required to changes a user's password (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public okhttp3.Call changePasswordCall(@javax.annotation.Nonnull ChangePasswordRequest changePasswordRequest, 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 = changePasswordRequest; + + // create path and map variables + String localVarPath = "/actions/users/change_password"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call changePasswordValidateBeforeCall(@javax.annotation.Nonnull ChangePasswordRequest changePasswordRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'changePasswordRequest' is set + if (changePasswordRequest == null) { + throw new ApiException("Missing the required parameter 'changePasswordRequest' when calling changePassword(Async)"); + } + + return changePasswordCall(changePasswordRequest, _callback); + + } + + /** + * Changes a user's password. + * This endpoint allows a user to change their password. The user must provide the current password along with the new password. + * @param changePasswordRequest data required to changes a user's password (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public void changePassword(@javax.annotation.Nonnull ChangePasswordRequest changePasswordRequest) throws ApiException { + changePasswordWithHttpInfo(changePasswordRequest); + } + + /** + * Changes a user's password. + * This endpoint allows a user to change their password. The user must provide the current password along with the new password. + * @param changePasswordRequest data required to changes a user's password (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public ApiResponse changePasswordWithHttpInfo(@javax.annotation.Nonnull ChangePasswordRequest changePasswordRequest) throws ApiException { + okhttp3.Call localVarCall = changePasswordValidateBeforeCall(changePasswordRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Changes a user's password. (asynchronously) + * This endpoint allows a user to change their password. The user must provide the current password along with the new password. + * @param changePasswordRequest data required to changes a user's password (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public okhttp3.Call changePasswordAsync(@javax.annotation.Nonnull ChangePasswordRequest changePasswordRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = changePasswordValidateBeforeCall(changePasswordRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for confirmEmail + * @param X_TILEDB_REST_API_KEY The confirm email scoped token to validate the user's email address (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Email confirmed successfully -
0 error response -
+ */ + public okhttp3.Call confirmEmailCall(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, 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 = "/actions/users/confirm_email"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + if (X_TILEDB_REST_API_KEY != null) { + localVarHeaderParams.put("X-TILEDB-REST-API-KEY", localVarApiClient.parameterToString(X_TILEDB_REST_API_KEY)); + } + + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call confirmEmailValidateBeforeCall(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'X_TILEDB_REST_API_KEY' is set + if (X_TILEDB_REST_API_KEY == null) { + throw new ApiException("Missing the required parameter 'X_TILEDB_REST_API_KEY' when calling confirmEmail(Async)"); + } + + return confirmEmailCall(X_TILEDB_REST_API_KEY, _callback); + + } + + /** + * Confirm an email address + * Operation to confirm the email address by providing the token sent to user's email address + * @param X_TILEDB_REST_API_KEY The confirm email scoped token to validate the user's email address (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Email confirmed successfully -
0 error response -
+ */ + public void confirmEmail(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY) throws ApiException { + confirmEmailWithHttpInfo(X_TILEDB_REST_API_KEY); + } + + /** + * Confirm an email address + * Operation to confirm the email address by providing the token sent to user's email address + * @param X_TILEDB_REST_API_KEY The confirm email scoped token to validate the user's email address (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Email confirmed successfully -
0 error response -
+ */ + public ApiResponse confirmEmailWithHttpInfo(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY) throws ApiException { + okhttp3.Call localVarCall = confirmEmailValidateBeforeCall(X_TILEDB_REST_API_KEY, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Confirm an email address (asynchronously) + * Operation to confirm the email address by providing the token sent to user's email address + * @param X_TILEDB_REST_API_KEY The confirm email scoped token to validate the user's email address (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Email confirmed successfully -
0 error response -
+ */ + public okhttp3.Call confirmEmailAsync(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = confirmEmailValidateBeforeCall(X_TILEDB_REST_API_KEY, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for createUser + * @param userCreateRequest user to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful user response -
0 error response -
+ */ + public okhttp3.Call createUserCall(@javax.annotation.Nonnull UserCreateRequest userCreateRequest, 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 = userCreateRequest; + + // create path and map variables + String localVarPath = "/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUserValidateBeforeCall(@javax.annotation.Nonnull UserCreateRequest userCreateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userCreateRequest' is set + if (userCreateRequest == null) { + throw new ApiException("Missing the required parameter 'userCreateRequest' when calling createUser(Async)"); + } + + return createUserCall(userCreateRequest, _callback); + + } + + /** + * Create a user + * create a user for a new registration + * @param userCreateRequest user to create (required) + * @return UserCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful user response -
0 error response -
+ */ + public UserCreateResponse createUser(@javax.annotation.Nonnull UserCreateRequest userCreateRequest) throws ApiException { + ApiResponse localVarResp = createUserWithHttpInfo(userCreateRequest); + return localVarResp.getData(); + } + + /** + * Create a user + * create a user for a new registration + * @param userCreateRequest user to create (required) + * @return ApiResponse<UserCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful user response -
0 error response -
+ */ + public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull UserCreateRequest userCreateRequest) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(userCreateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a user (asynchronously) + * create a user for a new registration + * @param userCreateRequest user to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful user response -
0 error response -
+ */ + public okhttp3.Call createUserAsync(@javax.annotation.Nonnull UserCreateRequest userCreateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUserValidateBeforeCall(userCreateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteUser + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully deleted user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call deleteUserCall(@javax.annotation.Nonnull String userId, 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 = "/users/{user_id}" + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteUserValidateBeforeCall(@javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteUser(Async)"); + } + + return deleteUserCall(userId, _callback); + + } + + /** + * Delete a user + * Delete an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully deleted user -
404 User does not exist -
0 error response -
+ */ + public void deleteUser(@javax.annotation.Nonnull String userId) throws ApiException { + deleteUserWithHttpInfo(userId); + } + + /** + * Delete a user + * Delete an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully deleted user -
404 User does not exist -
0 error response -
+ */ + public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a user (asynchronously) + * Delete an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully deleted user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call deleteUserAsync(@javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getSelfUser + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful user response -
0 error response -
+ */ + public okhttp3.Call getSelfUserCall(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 = "/users/self"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSelfUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSelfUserCall(_callback); + + } + + /** + * Retrieve the current user + * Retrieve the user that is currently logged in + * @return UserSelfResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful user response -
0 error response -
+ */ + public UserSelfResponse getSelfUser() throws ApiException { + ApiResponse localVarResp = getSelfUserWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve the current user + * Retrieve the user that is currently logged in + * @return ApiResponse<UserSelfResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Successful user response -
0 error response -
+ */ + public ApiResponse getSelfUserWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSelfUserValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve the current user (asynchronously) + * Retrieve the user that is currently logged in + * @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 + + + + + +
Response Details
Status Code Description Response Headers
200 Successful user response -
0 error response -
+ */ + public okhttp3.Call getSelfUserAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSelfUserValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getUser + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully retrieved user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call getUserCall(@javax.annotation.Nonnull String userId, 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 = "/users/{user_id}" + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserValidateBeforeCall(@javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getUser(Async)"); + } + + return getUserCall(userId, _callback); + + } + + /** + * Retrieve a user + * Retrieve an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return UserGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully retrieved user -
404 User does not exist -
0 error response -
+ */ + public UserGetResponse getUser(@javax.annotation.Nonnull String userId) throws ApiException { + ApiResponse localVarResp = getUserWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * Retrieve a user + * Retrieve an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<UserGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully retrieved user -
404 User does not exist -
0 error response -
+ */ + public ApiResponse getUserWithHttpInfo(@javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a user (asynchronously) + * Retrieve an existing user based on the provided user id + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successfully retrieved user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call getUserAsync(@javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for requestEmailConfirmation + * @param requestEmailConfirmationRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Email sent successfully -
0 error response -
+ */ + public okhttp3.Call requestEmailConfirmationCall(@javax.annotation.Nonnull RequestEmailConfirmationRequest requestEmailConfirmationRequest, 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 = requestEmailConfirmationRequest; + + // create path and map variables + String localVarPath = "/actions/users/request_email_confirmation"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call requestEmailConfirmationValidateBeforeCall(@javax.annotation.Nonnull RequestEmailConfirmationRequest requestEmailConfirmationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestEmailConfirmationRequest' is set + if (requestEmailConfirmationRequest == null) { + throw new ApiException("Missing the required parameter 'requestEmailConfirmationRequest' when calling requestEmailConfirmation(Async)"); + } + + return requestEmailConfirmationCall(requestEmailConfirmationRequest, _callback); + + } + + /** + * Request a new email to be sent containing the email confirmation token + * Operation to request for a new email to allow the user to confirm their email address. This email contains a link with the required api token. + * @param requestEmailConfirmationRequest data required to initiate a password reset request (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Email sent successfully -
0 error response -
+ */ + public void requestEmailConfirmation(@javax.annotation.Nonnull RequestEmailConfirmationRequest requestEmailConfirmationRequest) throws ApiException { + requestEmailConfirmationWithHttpInfo(requestEmailConfirmationRequest); + } + + /** + * Request a new email to be sent containing the email confirmation token + * Operation to request for a new email to allow the user to confirm their email address. This email contains a link with the required api token. + * @param requestEmailConfirmationRequest data required to initiate a password reset request (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Email sent successfully -
0 error response -
+ */ + public ApiResponse requestEmailConfirmationWithHttpInfo(@javax.annotation.Nonnull RequestEmailConfirmationRequest requestEmailConfirmationRequest) throws ApiException { + okhttp3.Call localVarCall = requestEmailConfirmationValidateBeforeCall(requestEmailConfirmationRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Request a new email to be sent containing the email confirmation token (asynchronously) + * Operation to request for a new email to allow the user to confirm their email address. This email contains a link with the required api token. + * @param requestEmailConfirmationRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Email sent successfully -
0 error response -
+ */ + public okhttp3.Call requestEmailConfirmationAsync(@javax.annotation.Nonnull RequestEmailConfirmationRequest requestEmailConfirmationRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = requestEmailConfirmationValidateBeforeCall(requestEmailConfirmationRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for requestPasswordReset + * @param requestPasswordResetRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 The request was accepted. If the user exists they will receive an email. -
0 error response -
+ */ + public okhttp3.Call requestPasswordResetCall(@javax.annotation.Nonnull RequestPasswordResetRequest requestPasswordResetRequest, 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 = requestPasswordResetRequest; + + // create path and map variables + String localVarPath = "/actions/users/request_password_reset"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call requestPasswordResetValidateBeforeCall(@javax.annotation.Nonnull RequestPasswordResetRequest requestPasswordResetRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestPasswordResetRequest' is set + if (requestPasswordResetRequest == null) { + throw new ApiException("Missing the required parameter 'requestPasswordResetRequest' when calling requestPasswordReset(Async)"); + } + + return requestPasswordResetCall(requestPasswordResetRequest, _callback); + + } + + /** + * Request a password reset while unauthorized + * This endpoint sends an email to the user's registered email address with a password reset link. The link contains a scoped token that authorizes the user to reset their password securely. + * @param requestPasswordResetRequest data required to initiate a password reset request (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The request was accepted. If the user exists they will receive an email. -
0 error response -
+ */ + public void requestPasswordReset(@javax.annotation.Nonnull RequestPasswordResetRequest requestPasswordResetRequest) throws ApiException { + requestPasswordResetWithHttpInfo(requestPasswordResetRequest); + } + + /** + * Request a password reset while unauthorized + * This endpoint sends an email to the user's registered email address with a password reset link. The link contains a scoped token that authorizes the user to reset their password securely. + * @param requestPasswordResetRequest data required to initiate a password reset request (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 The request was accepted. If the user exists they will receive an email. -
0 error response -
+ */ + public ApiResponse requestPasswordResetWithHttpInfo(@javax.annotation.Nonnull RequestPasswordResetRequest requestPasswordResetRequest) throws ApiException { + okhttp3.Call localVarCall = requestPasswordResetValidateBeforeCall(requestPasswordResetRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Request a password reset while unauthorized (asynchronously) + * This endpoint sends an email to the user's registered email address with a password reset link. The link contains a scoped token that authorizes the user to reset their password securely. + * @param requestPasswordResetRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 The request was accepted. If the user exists they will receive an email. -
0 error response -
+ */ + public okhttp3.Call requestPasswordResetAsync(@javax.annotation.Nonnull RequestPasswordResetRequest requestPasswordResetRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = requestPasswordResetValidateBeforeCall(requestPasswordResetRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for resetPassword + * @param X_TILEDB_REST_API_KEY The reset password scoped token to reset the user's password (required) + * @param resetPasswordRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public okhttp3.Call resetPasswordCall(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, @javax.annotation.Nonnull ResetPasswordRequest resetPasswordRequest, 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 = resetPasswordRequest; + + // create path and map variables + String localVarPath = "/actions/users/reset_password"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + if (X_TILEDB_REST_API_KEY != null) { + localVarHeaderParams.put("X-TILEDB-REST-API-KEY", localVarApiClient.parameterToString(X_TILEDB_REST_API_KEY)); + } + + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPasswordValidateBeforeCall(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, @javax.annotation.Nonnull ResetPasswordRequest resetPasswordRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'X_TILEDB_REST_API_KEY' is set + if (X_TILEDB_REST_API_KEY == null) { + throw new ApiException("Missing the required parameter 'X_TILEDB_REST_API_KEY' when calling resetPassword(Async)"); + } + + // verify the required parameter 'resetPasswordRequest' is set + if (resetPasswordRequest == null) { + throw new ApiException("Missing the required parameter 'resetPasswordRequest' when calling resetPassword(Async)"); + } + + return resetPasswordCall(X_TILEDB_REST_API_KEY, resetPasswordRequest, _callback); + + } + + /** + * Reset a user's password using a scoped token. + * This endpoint allows a user to reset their password. The user must provide a valid scoped token, received via email, along with their new password. The token ensures secure and authorized access to update the password. + * @param X_TILEDB_REST_API_KEY The reset password scoped token to reset the user's password (required) + * @param resetPasswordRequest data required to initiate a password reset request (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public void resetPassword(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, @javax.annotation.Nonnull ResetPasswordRequest resetPasswordRequest) throws ApiException { + resetPasswordWithHttpInfo(X_TILEDB_REST_API_KEY, resetPasswordRequest); + } + + /** + * Reset a user's password using a scoped token. + * This endpoint allows a user to reset their password. The user must provide a valid scoped token, received via email, along with their new password. The token ensures secure and authorized access to update the password. + * @param X_TILEDB_REST_API_KEY The reset password scoped token to reset the user's password (required) + * @param resetPasswordRequest data required to initiate a password reset request (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public ApiResponse resetPasswordWithHttpInfo(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, @javax.annotation.Nonnull ResetPasswordRequest resetPasswordRequest) throws ApiException { + okhttp3.Call localVarCall = resetPasswordValidateBeforeCall(X_TILEDB_REST_API_KEY, resetPasswordRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Reset a user's password using a scoped token. (asynchronously) + * This endpoint allows a user to reset their password. The user must provide a valid scoped token, received via email, along with their new password. The token ensures secure and authorized access to update the password. + * @param X_TILEDB_REST_API_KEY The reset password scoped token to reset the user's password (required) + * @param resetPasswordRequest data required to initiate a password reset request (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Password updated successfully -
0 error response -
+ */ + public okhttp3.Call resetPasswordAsync(@javax.annotation.Nonnull String X_TILEDB_REST_API_KEY, @javax.annotation.Nonnull ResetPasswordRequest resetPasswordRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPasswordValidateBeforeCall(X_TILEDB_REST_API_KEY, resetPasswordRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateUser + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param userUpdateRequest userUpdateDetails (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully updated user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call updateUserCall(@javax.annotation.Nonnull String userId, @javax.annotation.Nonnull UserUpdateRequest userUpdateRequest, 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 = userUpdateRequest; + + // create path and map variables + String localVarPath = "/users/{user_id}" + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateUserValidateBeforeCall(@javax.annotation.Nonnull String userId, @javax.annotation.Nonnull UserUpdateRequest userUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling updateUser(Async)"); + } + + // verify the required parameter 'userUpdateRequest' is set + if (userUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'userUpdateRequest' when calling updateUser(Async)"); + } + + return updateUserCall(userId, userUpdateRequest, _callback); + + } + + /** + * Update a user + * Update an existing user based on the provided data + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param userUpdateRequest userUpdateDetails (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully updated user -
404 User does not exist -
0 error response -
+ */ + public void updateUser(@javax.annotation.Nonnull String userId, @javax.annotation.Nonnull UserUpdateRequest userUpdateRequest) throws ApiException { + updateUserWithHttpInfo(userId, userUpdateRequest); + } + + /** + * Update a user + * Update an existing user based on the provided data + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param userUpdateRequest userUpdateDetails (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully updated user -
404 User does not exist -
0 error response -
+ */ + public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String userId, @javax.annotation.Nonnull UserUpdateRequest userUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(userId, userUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update a user (asynchronously) + * Update an existing user based on the provided data + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param userUpdateRequest userUpdateDetails (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Successfully updated user -
404 User does not exist -
0 error response -
+ */ + public okhttp3.Call updateUserAsync(@javax.annotation.Nonnull String userId, @javax.annotation.Nonnull UserUpdateRequest userUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateUserValidateBeforeCall(userId, userUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/UserspacesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/UserspacesApi.java new file mode 100644 index 0000000..9216773 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/UserspacesApi.java @@ -0,0 +1,369 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.UserspaceGetResponse; +import io.tiledb.cloud.rest_api.v4.model.UserspaceUpdateRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserspacesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserspacesApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserspacesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getUserspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Userspace retrieved -
404 Userspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getUserspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, 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 = "/userspaces/{workspace}/{userspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "userspace" + "}", localVarApiClient.escapeString(userspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getUserspace(Async)"); + } + + // verify the required parameter 'userspace' is set + if (userspace == null) { + throw new ApiException("Missing the required parameter 'userspace' when calling getUserspace(Async)"); + } + + return getUserspaceCall(workspace, userspace, _callback); + + } + + /** + * Retrieve a userspace + * Retrieve the given userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @return UserspaceGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Userspace retrieved -
404 Userspace does not exist -
0 An error occurred -
+ */ + public UserspaceGetResponse getUserspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace) throws ApiException { + ApiResponse localVarResp = getUserspaceWithHttpInfo(workspace, userspace); + return localVarResp.getData(); + } + + /** + * Retrieve a userspace + * Retrieve the given userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @return ApiResponse<UserspaceGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Userspace retrieved -
404 Userspace does not exist -
0 An error occurred -
+ */ + public ApiResponse getUserspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace) throws ApiException { + okhttp3.Call localVarCall = getUserspaceValidateBeforeCall(workspace, userspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a userspace (asynchronously) + * Retrieve the given userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Userspace retrieved -
404 Userspace does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getUserspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserspaceValidateBeforeCall(workspace, userspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateUserspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @param userspaceUpdateRequest The request body containing the userspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Userspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateUserspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, @javax.annotation.Nonnull UserspaceUpdateRequest userspaceUpdateRequest, 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 = userspaceUpdateRequest; + + // create path and map variables + String localVarPath = "/userspaces/{workspace}/{userspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "userspace" + "}", localVarApiClient.escapeString(userspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateUserspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, @javax.annotation.Nonnull UserspaceUpdateRequest userspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateUserspace(Async)"); + } + + // verify the required parameter 'userspace' is set + if (userspace == null) { + throw new ApiException("Missing the required parameter 'userspace' when calling updateUserspace(Async)"); + } + + // verify the required parameter 'userspaceUpdateRequest' is set + if (userspaceUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'userspaceUpdateRequest' when calling updateUserspace(Async)"); + } + + return updateUserspaceCall(workspace, userspace, userspaceUpdateRequest, _callback); + + } + + /** + * Update the given userspace + * Update a userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @param userspaceUpdateRequest The request body containing the userspace to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Userspace updated -
0 An error occurred -
+ */ + public void updateUserspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, @javax.annotation.Nonnull UserspaceUpdateRequest userspaceUpdateRequest) throws ApiException { + updateUserspaceWithHttpInfo(workspace, userspace, userspaceUpdateRequest); + } + + /** + * Update the given userspace + * Update a userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @param userspaceUpdateRequest The request body containing the userspace to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Userspace updated -
0 An error occurred -
+ */ + public ApiResponse updateUserspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, @javax.annotation.Nonnull UserspaceUpdateRequest userspaceUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateUserspaceValidateBeforeCall(workspace, userspace, userspaceUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the given userspace (asynchronously) + * Update a userspace + * @param workspace The workspace name or id (required) + * @param userspace The userspace id or the user's username (required) + * @param userspaceUpdateRequest The request body containing the userspace to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Userspace updated -
0 An error occurred -
+ */ + public okhttp3.Call updateUserspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userspace, @javax.annotation.Nonnull UserspaceUpdateRequest userspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateUserspaceValidateBeforeCall(workspace, userspace, userspaceUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/VersionsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/VersionsApi.java new file mode 100644 index 0000000..3ff92da --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/VersionsApi.java @@ -0,0 +1,197 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.VersionsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class VersionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public VersionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public VersionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getVersions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved server versions -
0 error response -
+ */ + public okhttp3.Call getVersionsCall(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 = "/versions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVersionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getVersionsCall(_callback); + + } + + /** + * Get Server versions + * This endpoint returns various version numbers pertaining to the server. + * @return VersionsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved server versions -
0 error response -
+ */ + public VersionsResponse getVersions() throws ApiException { + ApiResponse localVarResp = getVersionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get Server versions + * This endpoint returns various version numbers pertaining to the server. + * @return ApiResponse<VersionsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved server versions -
0 error response -
+ */ + public ApiResponse getVersionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getVersionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Server versions (asynchronously) + * This endpoint returns various version numbers pertaining to the server. + * @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 + + + + + +
Response Details
Status Code Description Response Headers
200 Retrieved server versions -
0 error response -
+ */ + public okhttp3.Call getVersionsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getVersionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/api/WorkspacesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v4/api/WorkspacesApi.java new file mode 100644 index 0000000..9fe7333 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/api/WorkspacesApi.java @@ -0,0 +1,1630 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.api; + +import io.tiledb.cloud.rest_api.v4.ApiCallback; +import io.tiledb.cloud.rest_api.v4.ApiClient; +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.ApiResponse; +import io.tiledb.cloud.rest_api.v4.Configuration; +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ProgressRequestBody; +import io.tiledb.cloud.rest_api.v4.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.tiledb.cloud.rest_api.v4.model.Error; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceGetResponse; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUserGetResponse; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUserUpdateRequest; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersBulkUpdateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersCreateRequestInner; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersCreateResponse; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUsersListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WorkspacesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WorkspacesApi() { + this(Configuration.getDefaultApiClient()); + } + + public WorkspacesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createWorkspace + * @param workspaceCreateRequest workspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful workspace response -
0 error response -
+ */ + public okhttp3.Call createWorkspaceCall(@javax.annotation.Nonnull WorkspaceCreateRequest workspaceCreateRequest, 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 = workspaceCreateRequest; + + // create path and map variables + String localVarPath = "/workspaces"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createWorkspaceValidateBeforeCall(@javax.annotation.Nonnull WorkspaceCreateRequest workspaceCreateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspaceCreateRequest' is set + if (workspaceCreateRequest == null) { + throw new ApiException("Missing the required parameter 'workspaceCreateRequest' when calling createWorkspace(Async)"); + } + + return createWorkspaceCall(workspaceCreateRequest, _callback); + + } + + /** + * Create a workspace + * create a workspace, the user creating will be listed as owner + * @param workspaceCreateRequest workspace to create (required) + * @return WorkspaceCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful workspace response -
0 error response -
+ */ + public WorkspaceCreateResponse createWorkspace(@javax.annotation.Nonnull WorkspaceCreateRequest workspaceCreateRequest) throws ApiException { + ApiResponse localVarResp = createWorkspaceWithHttpInfo(workspaceCreateRequest); + return localVarResp.getData(); + } + + /** + * Create a workspace + * create a workspace, the user creating will be listed as owner + * @param workspaceCreateRequest workspace to create (required) + * @return ApiResponse<WorkspaceCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Successful workspace response -
0 error response -
+ */ + public ApiResponse createWorkspaceWithHttpInfo(@javax.annotation.Nonnull WorkspaceCreateRequest workspaceCreateRequest) throws ApiException { + okhttp3.Call localVarCall = createWorkspaceValidateBeforeCall(workspaceCreateRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a workspace (asynchronously) + * create a workspace, the user creating will be listed as owner + * @param workspaceCreateRequest workspace to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Successful workspace response -
0 error response -
+ */ + public okhttp3.Call createWorkspaceAsync(@javax.annotation.Nonnull WorkspaceCreateRequest workspaceCreateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createWorkspaceValidateBeforeCall(workspaceCreateRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createWorkspaceUsers + * @param workspace The workspace name or id (required) + * @param workspaceUsersCreateRequestInner The request body containing the workspace users to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Workspace user(s) created -
0 An error occurred -
+ */ + public okhttp3.Call createWorkspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersCreateRequestInner, 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 = workspaceUsersCreateRequestInner; + + // create path and map variables + String localVarPath = "/workspaceusers/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createWorkspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersCreateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling createWorkspaceUsers(Async)"); + } + + // verify the required parameter 'workspaceUsersCreateRequestInner' is set + if (workspaceUsersCreateRequestInner == null) { + throw new ApiException("Missing the required parameter 'workspaceUsersCreateRequestInner' when calling createWorkspaceUsers(Async)"); + } + + return createWorkspaceUsersCall(workspace, workspaceUsersCreateRequestInner, _callback); + + } + + /** + * Create one or more workspace users + * Create one or more workspace users + * @param workspace The workspace name or id (required) + * @param workspaceUsersCreateRequestInner The request body containing the workspace users to create (required) + * @return WorkspaceUsersCreateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Workspace user(s) created -
0 An error occurred -
+ */ + public WorkspaceUsersCreateResponse createWorkspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersCreateRequestInner) throws ApiException { + ApiResponse localVarResp = createWorkspaceUsersWithHttpInfo(workspace, workspaceUsersCreateRequestInner); + return localVarResp.getData(); + } + + /** + * Create one or more workspace users + * Create one or more workspace users + * @param workspace The workspace name or id (required) + * @param workspaceUsersCreateRequestInner The request body containing the workspace users to create (required) + * @return ApiResponse<WorkspaceUsersCreateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 Workspace user(s) created -
0 An error occurred -
+ */ + public ApiResponse createWorkspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersCreateRequestInner) throws ApiException { + okhttp3.Call localVarCall = createWorkspaceUsersValidateBeforeCall(workspace, workspaceUsersCreateRequestInner, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create one or more workspace users (asynchronously) + * Create one or more workspace users + * @param workspace The workspace name or id (required) + * @param workspaceUsersCreateRequestInner The request body containing the workspace users to create (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 + + + + + +
Response Details
Status Code Description Response Headers
201 Workspace user(s) created -
0 An error occurred -
+ */ + public okhttp3.Call createWorkspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersCreateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createWorkspaceUsersValidateBeforeCall(workspace, workspaceUsersCreateRequestInner, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteWorkspace + * @param workspace The workspace name or id (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 + + + + + +
Response Details
Status Code Description Response Headers
204 workspace deleted -
0 error response -
+ */ + public okhttp3.Call deleteWorkspaceCall(@javax.annotation.Nonnull String workspace, 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 = "/workspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWorkspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteWorkspace(Async)"); + } + + return deleteWorkspaceCall(workspace, _callback); + + } + + /** + * Delete a workspace + * delete a workspace + * @param workspace The workspace name or id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 workspace deleted -
0 error response -
+ */ + public void deleteWorkspace(@javax.annotation.Nonnull String workspace) throws ApiException { + deleteWorkspaceWithHttpInfo(workspace); + } + + /** + * Delete a workspace + * delete a workspace + * @param workspace The workspace name or id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 workspace deleted -
0 error response -
+ */ + public ApiResponse deleteWorkspaceWithHttpInfo(@javax.annotation.Nonnull String workspace) throws ApiException { + okhttp3.Call localVarCall = deleteWorkspaceValidateBeforeCall(workspace, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a workspace (asynchronously) + * delete a workspace + * @param workspace The workspace name or id (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 + + + + + +
Response Details
Status Code Description Response Headers
204 workspace deleted -
0 error response -
+ */ + public okhttp3.Call deleteWorkspaceAsync(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWorkspaceValidateBeforeCall(workspace, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteWorkspaceUser + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user deleted -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteWorkspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, 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 = "/workspaceusers/{workspace}/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWorkspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteWorkspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteWorkspaceUser(Async)"); + } + + return deleteWorkspaceUserCall(workspace, userId, _callback); + + } + + /** + * Delete a workspace user + * Delete the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user deleted -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public void deleteWorkspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId) throws ApiException { + deleteWorkspaceUserWithHttpInfo(workspace, userId); + } + + /** + * Delete a workspace user + * Delete the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user deleted -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse deleteWorkspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = deleteWorkspaceUserValidateBeforeCall(workspace, userId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a workspace user (asynchronously) + * Delete the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user deleted -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteWorkspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWorkspaceUserValidateBeforeCall(workspace, userId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteWorkspaceUsers + * @param workspace The workspace name or id (required) + * @param requestBody The request body containing the workspace users to delete (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users deleted -
404 One or more of the given workspace users do not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteWorkspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/actions/workspaces/{workspace}/users/bulk_delete" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWorkspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List requestBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling deleteWorkspaceUsers(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling deleteWorkspaceUsers(Async)"); + } + + return deleteWorkspaceUsersCall(workspace, requestBody, _callback); + + } + + /** + * Delete the given workspace users in a workspace + * Delete the given workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param requestBody The request body containing the workspace users to delete (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users deleted -
404 One or more of the given workspace users do not exist -
0 An error occurred -
+ */ + public void deleteWorkspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List requestBody) throws ApiException { + deleteWorkspaceUsersWithHttpInfo(workspace, requestBody); + } + + /** + * Delete the given workspace users in a workspace + * Delete the given workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param requestBody The request body containing the workspace users to delete (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users deleted -
404 One or more of the given workspace users do not exist -
0 An error occurred -
+ */ + public ApiResponse deleteWorkspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List requestBody) throws ApiException { + okhttp3.Call localVarCall = deleteWorkspaceUsersValidateBeforeCall(workspace, requestBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete the given workspace users in a workspace (asynchronously) + * Delete the given workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param requestBody The request body containing the workspace users to delete (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users deleted -
404 One or more of the given workspace users do not exist -
0 An error occurred -
+ */ + public okhttp3.Call deleteWorkspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWorkspaceUsersValidateBeforeCall(workspace, requestBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getWorkspace + * @param workspace The workspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful workspace response -
404 Workspace does not exist -
0 error response -
+ */ + public okhttp3.Call getWorkspaceCall(@javax.annotation.Nonnull String workspace, 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 = "/workspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWorkspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getWorkspace(Async)"); + } + + return getWorkspaceCall(workspace, _callback); + + } + + /** + * Retrieves metadata for the given workspace + * End point to retrieve metadata for the passed workspace + * @param workspace The workspace name or id (required) + * @return WorkspaceGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful workspace response -
404 Workspace does not exist -
0 error response -
+ */ + public WorkspaceGetResponse getWorkspace(@javax.annotation.Nonnull String workspace) throws ApiException { + ApiResponse localVarResp = getWorkspaceWithHttpInfo(workspace); + return localVarResp.getData(); + } + + /** + * Retrieves metadata for the given workspace + * End point to retrieve metadata for the passed workspace + * @param workspace The workspace name or id (required) + * @return ApiResponse<WorkspaceGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful workspace response -
404 Workspace does not exist -
0 error response -
+ */ + public ApiResponse getWorkspaceWithHttpInfo(@javax.annotation.Nonnull String workspace) throws ApiException { + okhttp3.Call localVarCall = getWorkspaceValidateBeforeCall(workspace, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves metadata for the given workspace (asynchronously) + * End point to retrieve metadata for the passed workspace + * @param workspace The workspace name or id (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Successful workspace response -
404 Workspace does not exist -
0 error response -
+ */ + public okhttp3.Call getWorkspaceAsync(@javax.annotation.Nonnull String workspace, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getWorkspaceValidateBeforeCall(workspace, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getWorkspaceUser + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user retrieved -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getWorkspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, 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 = "/workspaceusers/{workspace}/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/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[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWorkspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling getWorkspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling getWorkspaceUser(Async)"); + } + + return getWorkspaceUserCall(workspace, userId, _callback); + + } + + /** + * Retrieve a workspace user + * Retrieve the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return WorkspaceUserGetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user retrieved -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public WorkspaceUserGetResponse getWorkspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId) throws ApiException { + ApiResponse localVarResp = getWorkspaceUserWithHttpInfo(workspace, userId); + return localVarResp.getData(); + } + + /** + * Retrieve a workspace user + * Retrieve the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @return ApiResponse<WorkspaceUserGetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user retrieved -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse getWorkspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId) throws ApiException { + okhttp3.Call localVarCall = getWorkspaceUserValidateBeforeCall(workspace, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a workspace user (asynchronously) + * Retrieve the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (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 + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user retrieved -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call getWorkspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getWorkspaceUserValidateBeforeCall(workspace, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listWorkspaceUsers + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param search Search filter to find users by username or email (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user(s) list retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listWorkspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable String search, 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 = "/workspaceusers/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listWorkspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling listWorkspaceUsers(Async)"); + } + + return listWorkspaceUsersCall(workspace, page, perPage, search, _callback); + + } + + /** + * Retrieve multiple workspace users + * Retrieve a list of workspace users + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param search Search filter to find users by username or email (optional) + * @return WorkspaceUsersListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user(s) list retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public WorkspaceUsersListResponse listWorkspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable String search) throws ApiException { + ApiResponse localVarResp = listWorkspaceUsersWithHttpInfo(workspace, page, perPage, search); + return localVarResp.getData(); + } + + /** + * Retrieve multiple workspace users + * Retrieve a list of workspace users + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param search Search filter to find users by username or email (optional) + * @return ApiResponse<WorkspaceUsersListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user(s) list retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public ApiResponse listWorkspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable String search) throws ApiException { + okhttp3.Call localVarCall = listWorkspaceUsersValidateBeforeCall(workspace, page, perPage, search, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve multiple workspace users (asynchronously) + * Retrieve a list of workspace users + * @param workspace The workspace name or id (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @param search Search filter to find users by username or email (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 Workspace user(s) list retrieved -
404 Workspace ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call listWorkspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nullable Integer page, @javax.annotation.Nullable Integer perPage, @javax.annotation.Nullable String search, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listWorkspaceUsersValidateBeforeCall(workspace, page, perPage, search, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateWorkspace + * @param workspace The workspace name or id (required) + * @param workspaceUpdateRequest workspaceUpdateDetails (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 + + + + + +
Response Details
Status Code Description Response Headers
204 workspace updated -
0 error response -
+ */ + public okhttp3.Call updateWorkspaceCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull WorkspaceUpdateRequest workspaceUpdateRequest, 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 = workspaceUpdateRequest; + + // create path and map variables + String localVarPath = "/workspaces/{workspace}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWorkspaceValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull WorkspaceUpdateRequest workspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateWorkspace(Async)"); + } + + // verify the required parameter 'workspaceUpdateRequest' is set + if (workspaceUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'workspaceUpdateRequest' when calling updateWorkspace(Async)"); + } + + return updateWorkspaceCall(workspace, workspaceUpdateRequest, _callback); + + } + + /** + * Update a workspace + * update a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUpdateRequest workspaceUpdateDetails (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 workspace updated -
0 error response -
+ */ + public void updateWorkspace(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull WorkspaceUpdateRequest workspaceUpdateRequest) throws ApiException { + updateWorkspaceWithHttpInfo(workspace, workspaceUpdateRequest); + } + + /** + * Update a workspace + * update a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUpdateRequest workspaceUpdateDetails (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 workspace updated -
0 error response -
+ */ + public ApiResponse updateWorkspaceWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull WorkspaceUpdateRequest workspaceUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateWorkspaceValidateBeforeCall(workspace, workspaceUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update a workspace (asynchronously) + * update a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUpdateRequest workspaceUpdateDetails (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 + + + + + +
Response Details
Status Code Description Response Headers
204 workspace updated -
0 error response -
+ */ + public okhttp3.Call updateWorkspaceAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull WorkspaceUpdateRequest workspaceUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWorkspaceValidateBeforeCall(workspace, workspaceUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateWorkspaceUser + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param workspaceUserUpdateRequest The request body containing the workspace user to update (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user updated -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateWorkspaceUserCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull WorkspaceUserUpdateRequest workspaceUserUpdateRequest, 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 = workspaceUserUpdateRequest; + + // create path and map variables + String localVarPath = "/workspaceusers/{workspace}/{user_id}" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "user_id" + "}", localVarApiClient.escapeString(userId.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWorkspaceUserValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull WorkspaceUserUpdateRequest workspaceUserUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateWorkspaceUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling updateWorkspaceUser(Async)"); + } + + // verify the required parameter 'workspaceUserUpdateRequest' is set + if (workspaceUserUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'workspaceUserUpdateRequest' when calling updateWorkspaceUser(Async)"); + } + + return updateWorkspaceUserCall(workspace, userId, workspaceUserUpdateRequest, _callback); + + } + + /** + * Update a workspace user + * Update the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param workspaceUserUpdateRequest The request body containing the workspace user to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user updated -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public void updateWorkspaceUser(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull WorkspaceUserUpdateRequest workspaceUserUpdateRequest) throws ApiException { + updateWorkspaceUserWithHttpInfo(workspace, userId, workspaceUserUpdateRequest); + } + + /** + * Update a workspace user + * Update the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param workspaceUserUpdateRequest The request body containing the workspace user to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user updated -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public ApiResponse updateWorkspaceUserWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull WorkspaceUserUpdateRequest workspaceUserUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateWorkspaceUserValidateBeforeCall(workspace, userId, workspaceUserUpdateRequest, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update a workspace user (asynchronously) + * Update the given workspace user + * @param workspace The workspace name or id (required) + * @param userId The user id in the form usr_9m4e2mr0ui3e8a215n4g (required) + * @param workspaceUserUpdateRequest The request body containing the workspace user to update (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 + + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace user updated -
404 Workspace user ID does not exist -
0 An error occurred -
+ */ + public okhttp3.Call updateWorkspaceUserAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull String userId, @javax.annotation.Nonnull WorkspaceUserUpdateRequest workspaceUserUpdateRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWorkspaceUserValidateBeforeCall(workspace, userId, workspaceUserUpdateRequest, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateWorkspaceUsers + * @param workspace The workspace name or id (required) + * @param workspaceUsersBulkUpdateRequestInner The request body containing the workspace users to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users updated successfully -
0 An error occurred -
+ */ + public okhttp3.Call updateWorkspaceUsersCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersBulkUpdateRequestInner, 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 = workspaceUsersBulkUpdateRequestInner; + + // create path and map variables + String localVarPath = "/actions/workspaces/{workspace}/users/bulk_update" + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.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/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "OAuth2", "BasicAuth", "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWorkspaceUsersValidateBeforeCall(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersBulkUpdateRequestInner, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workspace' is set + if (workspace == null) { + throw new ApiException("Missing the required parameter 'workspace' when calling updateWorkspaceUsers(Async)"); + } + + // verify the required parameter 'workspaceUsersBulkUpdateRequestInner' is set + if (workspaceUsersBulkUpdateRequestInner == null) { + throw new ApiException("Missing the required parameter 'workspaceUsersBulkUpdateRequestInner' when calling updateWorkspaceUsers(Async)"); + } + + return updateWorkspaceUsersCall(workspace, workspaceUsersBulkUpdateRequestInner, _callback); + + } + + /** + * Update multiple workspace users in a workspace + * Update multiple workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUsersBulkUpdateRequestInner The request body containing the workspace users to update (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users updated successfully -
0 An error occurred -
+ */ + public void updateWorkspaceUsers(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersBulkUpdateRequestInner) throws ApiException { + updateWorkspaceUsersWithHttpInfo(workspace, workspaceUsersBulkUpdateRequestInner); + } + + /** + * Update multiple workspace users in a workspace + * Update multiple workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUsersBulkUpdateRequestInner The request body containing the workspace users to update (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users updated successfully -
0 An error occurred -
+ */ + public ApiResponse updateWorkspaceUsersWithHttpInfo(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersBulkUpdateRequestInner) throws ApiException { + okhttp3.Call localVarCall = updateWorkspaceUsersValidateBeforeCall(workspace, workspaceUsersBulkUpdateRequestInner, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update multiple workspace users in a workspace (asynchronously) + * Update multiple workspace users in a workspace + * @param workspace The workspace name or id (required) + * @param workspaceUsersBulkUpdateRequestInner The request body containing the workspace users to update (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 + + + + + +
Response Details
Status Code Description Response Headers
204 Workspace users updated successfully -
0 An error occurred -
+ */ + public okhttp3.Call updateWorkspaceUsersAsync(@javax.annotation.Nonnull String workspace, @javax.annotation.Nonnull List workspaceUsersBulkUpdateRequestInner, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWorkspaceUsersValidateBeforeCall(workspace, workspaceUsersBulkUpdateRequestInner, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/ApiKeyAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/ApiKeyAuth.java new file mode 100644 index 0000000..edd3fe1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/Authentication.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/Authentication.java new file mode 100644 index 0000000..4540e5b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/Authentication.java @@ -0,0 +1,37 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBasicAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBasicAuth.java new file mode 100644 index 0000000..396f4b1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBearerAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBearerAuth.java new file mode 100644 index 0000000..7fdccba --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuth.java new file mode 100644 index 0000000..5d70bc9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuth.java @@ -0,0 +1,42 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.Pair; +import io.tiledb.cloud.rest_api.v4.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthFlow.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthFlow.java new file mode 100644 index 0000000..0d4b2bf --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthFlow.java @@ -0,0 +1,25 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +/** + * OAuth flows that are supported by this client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public enum OAuthFlow { + ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 + IMPLICIT, + PASSWORD, + APPLICATION //called clientCredentials in OpenAPI 3.0 +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthOkHttpClient.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthOkHttpClient.java new file mode 100644 index 0000000..a50c8c3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/OAuthOkHttpClient.java @@ -0,0 +1,81 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import okhttp3.OkHttpClient; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.HttpClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthClientResponse; +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class OAuthOkHttpClient implements HttpClient { + private OkHttpClient client; + + public OAuthOkHttpClient() { + this.client = new OkHttpClient(); + } + + public OAuthOkHttpClient(OkHttpClient client) { + this.client = client; + } + + @Override + public T execute(OAuthClientRequest request, Map headers, + String requestMethod, Class responseClass) + throws OAuthSystemException, OAuthProblemException { + + MediaType mediaType = MediaType.parse("application/json"); + Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); + + if(headers != null) { + for (Entry entry : headers.entrySet()) { + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + mediaType = MediaType.parse(entry.getValue()); + } else { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + } + } + + RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; + requestBuilder.method(requestMethod, body); + + try { + Response response = client.newCall(requestBuilder.build()).execute(); + return OAuthClientResponseFactory.createCustomResponse( + response.body().string(), + response.body().contentType().toString(), + response.code(), + responseClass); + } catch (IOException e) { + throw new OAuthSystemException(e); + } + } + + @Override + public void shutdown() { + // Nothing to do here + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/auth/RetryingOAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/RetryingOAuth.java new file mode 100644 index 0000000..8aa91b8 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/auth/RetryingOAuth.java @@ -0,0 +1,223 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.auth; + +import io.tiledb.cloud.rest_api.v4.ApiException; +import io.tiledb.cloud.rest_api.v4.Pair; + +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class RetryingOAuth extends OAuth implements Interceptor { + private OAuthClient oAuthClient; + + private TokenRequestBuilder tokenRequestBuilder; + + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ + public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { + this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); + this.tokenRequestBuilder = tokenRequestBuilder; + } + + /** + * @param tokenRequestBuilder A token request builder + */ + public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { + this(new OkHttpClient(), tokenRequestBuilder); + } + + /** + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ + public RetryingOAuth( + String tokenUrl, + String clientId, + OAuthFlow flow, + String clientSecret, + Map parameters + ) { + this(OAuthClientRequest.tokenLocation(tokenUrl) + .setClientId(clientId) + .setClientSecret(clientSecret)); + setFlow(flow); + if (parameters != null) { + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); + } + } + } + + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ + public void setFlow(OAuthFlow flow) { + switch(flow) { + case ACCESS_CODE: + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); + break; + case IMPLICIT: + tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); + break; + case PASSWORD: + tokenRequestBuilder.setGrantType(GrantType.PASSWORD); + break; + case APPLICATION: + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); + break; + default: + break; + } + } + + @Override + public Response intercept(Chain chain) throws IOException { + return retryingIntercept(chain, true); + } + + private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { + Request request = chain.request(); + + // If the request already has an authorization (e.g. Basic auth), proceed with the request as is + if (request.header("Authorization") != null) { + return chain.proceed(request); + } + + // Get the token if it has not yet been acquired + if (getAccessToken() == null) { + updateAccessToken(null); + } + + OAuthClientRequest oAuthRequest; + if (getAccessToken() != null) { + // Build the request + Request.Builder requestBuilder = request.newBuilder(); + + String requestAccessToken = getAccessToken(); + try { + oAuthRequest = + new OAuthBearerClientRequest(request.url().toString()). + setAccessToken(requestAccessToken). + buildHeaderMessage(); + } catch (OAuthSystemException e) { + throw new IOException(e); + } + + Map headers = oAuthRequest.getHeaders(); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + requestBuilder.url(oAuthRequest.getLocationUri()); + + // Execute the request + Response response = chain.proceed(requestBuilder.build()); + + // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row + if ( + response != null && + ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || + response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && + updateTokenAndRetryOnAuthorizationFailure + ) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } + } + return response; + } + else { + return chain.proceed(chain.request()); + } + } + + /** + * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token + */ + public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + try { + OAuthJSONAccessTokenResponse accessTokenResponse = + oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken()); + } + } catch (OAuthSystemException | OAuthProblemException e) { + throw new IOException(e); + } + } + return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); + } + + /** + * Gets the token request builder + * + * @return A token request builder + */ + public TokenRequestBuilder getTokenRequestBuilder() { + return tokenRequestBuilder; + } + + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ + public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { + this.tokenRequestBuilder = tokenRequestBuilder; + } + + // Applying authorization to parameters is performed in the retryingIntercept method + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + // No implementation necessary + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/APIToken.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/APIToken.java new file mode 100644 index 0000000..c88684f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/APIToken.java @@ -0,0 +1,381 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TokenScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * An API token + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class APIToken { + public static final String SERIALIZED_NAME_TOKEN_ID = "token_id"; + @SerializedName(SERIALIZED_NAME_TOKEN_ID) + @javax.annotation.Nonnull + private String tokenId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nonnull + private OffsetDateTime expiresAt; + + public static final String SERIALIZED_NAME_API_KEY = "api_key"; + @SerializedName(SERIALIZED_NAME_API_KEY) + @javax.annotation.Nonnull + private String apiKey; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nullable + private String workspaceId; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private TokenScope scope; + + public APIToken() { + } + + public APIToken tokenId(@javax.annotation.Nonnull String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * The token's ID + * @return tokenId + */ + @javax.annotation.Nonnull + public String getTokenId() { + return tokenId; + } + + public void setTokenId(@javax.annotation.Nonnull String tokenId) { + this.tokenId = tokenId; + } + + + public APIToken name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the token + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public APIToken createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation date and time of the token + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public APIToken expiresAt(@javax.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The expiration date and time of the token + * @return expiresAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + public APIToken apiKey(@javax.annotation.Nonnull String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * The secret API key that's used for authentication. If workspace_id is set, the format of the key is \"tiledb_<random bytes>\". Otherwise, the format is a JWT. + * @return apiKey + */ + @javax.annotation.Nonnull + public String getApiKey() { + return apiKey; + } + + public void setApiKey(@javax.annotation.Nonnull String apiKey) { + this.apiKey = apiKey; + } + + + public APIToken workspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace ID of the token (if API token) + * @return workspaceId + */ + @javax.annotation.Nullable + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + } + + + public APIToken scope(@javax.annotation.Nonnull TokenScope scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nonnull + public TokenScope getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull TokenScope scope) { + this.scope = scope; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIToken apIToken = (APIToken) o; + return Objects.equals(this.tokenId, apIToken.tokenId) && + Objects.equals(this.name, apIToken.name) && + Objects.equals(this.createdAt, apIToken.createdAt) && + Objects.equals(this.expiresAt, apIToken.expiresAt) && + Objects.equals(this.apiKey, apIToken.apiKey) && + Objects.equals(this.workspaceId, apIToken.workspaceId) && + Objects.equals(this.scope, apIToken.scope); + } + + @Override + public int hashCode() { + return Objects.hash(tokenId, name, createdAt, expiresAt, apiKey, workspaceId, scope); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APIToken {\n"); + sb.append(" tokenId: ").append(toIndentedString(tokenId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).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(Arrays.asList("token_id", "name", "created_at", "expires_at", "api_key", "workspace_id", "scope")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("token_id", "name", "created_at", "expires_at", "api_key", "scope")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to APIToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!APIToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in APIToken is not found in the empty JSON string", APIToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!APIToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `APIToken` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : APIToken.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_id").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())); + } + if (!jsonObj.get("api_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `api_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("api_key").toString())); + } + if ((jsonObj.get("workspace_id") != null && !jsonObj.get("workspace_id").isJsonNull()) && !jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + // validate the required field `scope` + TokenScope.validateJsonElement(jsonObj.get("scope")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!APIToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APIToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APIToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, APIToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public APIToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of APIToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of APIToken + * @throws IOException if the JSON string is invalid with respect to APIToken + */ + public static APIToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APIToken.class); + } + + /** + * Convert an instance of APIToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSCredential.java new file mode 100644 index 0000000..dd3ee2c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSCredential.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Credential information to access Amazon Web Services + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AWSCredential { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + @javax.annotation.Nonnull + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + @javax.annotation.Nonnull + private String secretAccessKey; + + public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; + @SerializedName(SERIALIZED_NAME_ENDPOINT) + @javax.annotation.Nullable + private String endpoint; + + public AWSCredential() { + } + + public AWSCredential accessKeyId(@javax.annotation.Nonnull String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * The ID of the access key + * @return accessKeyId + */ + @javax.annotation.Nonnull + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(@javax.annotation.Nonnull String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public AWSCredential secretAccessKey(@javax.annotation.Nonnull String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * The access key's secret. Never returned in responses. + * @return secretAccessKey + */ + @javax.annotation.Nonnull + public String getSecretAccessKey() { + return secretAccessKey; + } + + public void setSecretAccessKey(@javax.annotation.Nonnull String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + + public AWSCredential endpoint(@javax.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * The endpoint used for this credential + * @return endpoint + */ + @javax.annotation.Nullable + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(@javax.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCredential awSCredential = (AWSCredential) o; + return Objects.equals(this.accessKeyId, awSCredential.accessKeyId) && + Objects.equals(this.secretAccessKey, awSCredential.secretAccessKey) && + Objects.equals(this.endpoint, awSCredential.endpoint); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, endpoint); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCredential {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).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(Arrays.asList("access_key_id", "secret_access_key", "endpoint")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("access_key_id", "secret_access_key")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AWSCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AWSCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AWSCredential is not found in the empty JSON string", AWSCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AWSCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AWSCredential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AWSCredential.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + if (!jsonObj.get("secret_access_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret_access_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_access_key").toString())); + } + if ((jsonObj.get("endpoint") != null && !jsonObj.get("endpoint").isJsonNull()) && !jsonObj.get("endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AWSCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AWSCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AWSCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AWSCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AWSCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AWSCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of AWSCredential + * @throws IOException if the JSON string is invalid with respect to AWSCredential + */ + public static AWSCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AWSCredential.class); + } + + /** + * Convert an instance of AWSCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSRole.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSRole.java new file mode 100644 index 0000000..cfb3da4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AWSRole.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The role information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AWSRole { + public static final String SERIALIZED_NAME_ROLE_ARN = "role_arn"; + @SerializedName(SERIALIZED_NAME_ROLE_ARN) + @javax.annotation.Nonnull + private String roleArn; + + public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_ID) + @javax.annotation.Nonnull + private String externalId; + + public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; + @SerializedName(SERIALIZED_NAME_ENDPOINT) + @javax.annotation.Nullable + private String endpoint; + + public AWSRole() { + } + + public AWSRole roleArn(@javax.annotation.Nonnull String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * The role arn used to access + * @return roleArn + */ + @javax.annotation.Nonnull + public String getRoleArn() { + return roleArn; + } + + public void setRoleArn(@javax.annotation.Nonnull String roleArn) { + this.roleArn = roleArn; + } + + + public AWSRole externalId(@javax.annotation.Nonnull String externalId) { + this.externalId = externalId; + return this; + } + + /** + * The role external id used to access + * @return externalId + */ + @javax.annotation.Nonnull + public String getExternalId() { + return externalId; + } + + public void setExternalId(@javax.annotation.Nonnull String externalId) { + this.externalId = externalId; + } + + + public AWSRole endpoint(@javax.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * The endpoint used for this role + * @return endpoint + */ + @javax.annotation.Nullable + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(@javax.annotation.Nullable String endpoint) { + this.endpoint = endpoint; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSRole awSRole = (AWSRole) o; + return Objects.equals(this.roleArn, awSRole.roleArn) && + Objects.equals(this.externalId, awSRole.externalId) && + Objects.equals(this.endpoint, awSRole.endpoint); + } + + @Override + public int hashCode() { + return Objects.hash(roleArn, externalId, endpoint); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSRole {\n"); + sb.append(" roleArn: ").append(toIndentedString(roleArn)).append("\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).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(Arrays.asList("role_arn", "external_id", "endpoint")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("role_arn", "external_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AWSRole + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AWSRole.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AWSRole is not found in the empty JSON string", AWSRole.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AWSRole.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AWSRole` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AWSRole.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("role_arn").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `role_arn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role_arn").toString())); + } + if (!jsonObj.get("external_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `external_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("external_id").toString())); + } + if ((jsonObj.get("endpoint") != null && !jsonObj.get("endpoint").isJsonNull()) && !jsonObj.get("endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AWSRole.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AWSRole' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AWSRole.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AWSRole value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AWSRole read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AWSRole given an JSON string + * + * @param jsonString JSON string + * @return An instance of AWSRole + * @throws IOException if the JSON string is invalid with respect to AWSRole + */ + public static AWSRole fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AWSRole.class); + } + + /** + * Convert an instance of AWSRole to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AbstractOpenApiSchema.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..ec209c3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import io.tiledb.cloud.rest_api.v4.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLesson.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLesson.java new file mode 100644 index 0000000..cee5aa3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLesson.java @@ -0,0 +1,293 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The academy lesson object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AcademyLesson { + public static final String SERIALIZED_NAME_LESSON_ID = "lesson_id"; + @SerializedName(SERIALIZED_NAME_LESSON_ID) + @javax.annotation.Nonnull + private String lessonId; + + public static final String SERIALIZED_NAME_LESSON_VERSION = "lesson_version"; + @SerializedName(SERIALIZED_NAME_LESSON_VERSION) + @javax.annotation.Nonnull + private String lessonVersion; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + @javax.annotation.Nullable + private Boolean completed; + + public static final String SERIALIZED_NAME_PINNED = "pinned"; + @SerializedName(SERIALIZED_NAME_PINNED) + @javax.annotation.Nullable + private Boolean pinned; + + public AcademyLesson() { + } + + public AcademyLesson lessonId(@javax.annotation.Nonnull String lessonId) { + this.lessonId = lessonId; + return this; + } + + /** + * Unique ID of the lesson + * @return lessonId + */ + @javax.annotation.Nonnull + public String getLessonId() { + return lessonId; + } + + public void setLessonId(@javax.annotation.Nonnull String lessonId) { + this.lessonId = lessonId; + } + + + public AcademyLesson lessonVersion(@javax.annotation.Nonnull String lessonVersion) { + this.lessonVersion = lessonVersion; + return this; + } + + /** + * Version of the lesson + * @return lessonVersion + */ + @javax.annotation.Nonnull + public String getLessonVersion() { + return lessonVersion; + } + + public void setLessonVersion(@javax.annotation.Nonnull String lessonVersion) { + this.lessonVersion = lessonVersion; + } + + + public AcademyLesson completed(@javax.annotation.Nullable Boolean completed) { + this.completed = completed; + return this; + } + + /** + * Indicates if lesson is completed + * @return completed + */ + @javax.annotation.Nullable + public Boolean getCompleted() { + return completed; + } + + public void setCompleted(@javax.annotation.Nullable Boolean completed) { + this.completed = completed; + } + + + public AcademyLesson pinned(@javax.annotation.Nullable Boolean pinned) { + this.pinned = pinned; + return this; + } + + /** + * Indicates if lesson is pinned + * @return pinned + */ + @javax.annotation.Nullable + public Boolean getPinned() { + return pinned; + } + + public void setPinned(@javax.annotation.Nullable Boolean pinned) { + this.pinned = pinned; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcademyLesson academyLesson = (AcademyLesson) o; + return Objects.equals(this.lessonId, academyLesson.lessonId) && + Objects.equals(this.lessonVersion, academyLesson.lessonVersion) && + Objects.equals(this.completed, academyLesson.completed) && + Objects.equals(this.pinned, academyLesson.pinned); + } + + @Override + public int hashCode() { + return Objects.hash(lessonId, lessonVersion, completed, pinned); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcademyLesson {\n"); + sb.append(" lessonId: ").append(toIndentedString(lessonId)).append("\n"); + sb.append(" lessonVersion: ").append(toIndentedString(lessonVersion)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" pinned: ").append(toIndentedString(pinned)).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(Arrays.asList("lesson_id", "lesson_version", "completed", "pinned")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("lesson_id", "lesson_version")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AcademyLesson + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AcademyLesson.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AcademyLesson is not found in the empty JSON string", AcademyLesson.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AcademyLesson.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcademyLesson` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AcademyLesson.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("lesson_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lesson_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lesson_id").toString())); + } + if (!jsonObj.get("lesson_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lesson_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lesson_version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AcademyLesson.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AcademyLesson' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AcademyLesson.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AcademyLesson value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AcademyLesson read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AcademyLesson given an JSON string + * + * @param jsonString JSON string + * @return An instance of AcademyLesson + * @throws IOException if the JSON string is invalid with respect to AcademyLesson + */ + public static AcademyLesson fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AcademyLesson.class); + } + + /** + * Convert an instance of AcademyLesson to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLessonsListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLessonsListResponse.java new file mode 100644 index 0000000..eb34d40 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyLessonsListResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AcademyLesson; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get academy lessons list response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AcademyLessonsListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public AcademyLessonsListResponse() { + } + + public AcademyLessonsListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AcademyLessonsListResponse addDataItem(AcademyLesson dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of academy lessons items + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcademyLessonsListResponse academyLessonsListResponse = (AcademyLessonsListResponse) o; + return Objects.equals(this.data, academyLessonsListResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcademyLessonsListResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AcademyLessonsListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AcademyLessonsListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AcademyLessonsListResponse is not found in the empty JSON string", AcademyLessonsListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AcademyLessonsListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcademyLessonsListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AcademyLessonsListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AcademyLesson.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AcademyLessonsListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AcademyLessonsListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AcademyLessonsListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AcademyLessonsListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AcademyLessonsListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AcademyLessonsListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AcademyLessonsListResponse + * @throws IOException if the JSON string is invalid with respect to AcademyLessonsListResponse + */ + public static AcademyLessonsListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AcademyLessonsListResponse.class); + } + + /** + * Convert an instance of AcademyLessonsListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaire.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaire.java new file mode 100644 index 0000000..ce7f0a3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaire.java @@ -0,0 +1,314 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.UserAnswer; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The academy questionnaire object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AcademyQuestionnaire { + public static final String SERIALIZED_NAME_QUESTIONNAIRE_ID = "questionnaire_id"; + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE_ID) + @javax.annotation.Nonnull + private String questionnaireId; + + public static final String SERIALIZED_NAME_QUESTIONNAIRE_VERSION = "questionnaire_version"; + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE_VERSION) + @javax.annotation.Nonnull + private String questionnaireVersion; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + @javax.annotation.Nonnull + private Boolean completed; + + public static final String SERIALIZED_NAME_USER_ANSWERS = "user_answers"; + @SerializedName(SERIALIZED_NAME_USER_ANSWERS) + @javax.annotation.Nonnull + private List userAnswers = new ArrayList<>(); + + public AcademyQuestionnaire() { + } + + public AcademyQuestionnaire questionnaireId(@javax.annotation.Nonnull String questionnaireId) { + this.questionnaireId = questionnaireId; + return this; + } + + /** + * Unique ID of the questionnaire + * @return questionnaireId + */ + @javax.annotation.Nonnull + public String getQuestionnaireId() { + return questionnaireId; + } + + public void setQuestionnaireId(@javax.annotation.Nonnull String questionnaireId) { + this.questionnaireId = questionnaireId; + } + + + public AcademyQuestionnaire questionnaireVersion(@javax.annotation.Nonnull String questionnaireVersion) { + this.questionnaireVersion = questionnaireVersion; + return this; + } + + /** + * Version of the questionnaire + * @return questionnaireVersion + */ + @javax.annotation.Nonnull + public String getQuestionnaireVersion() { + return questionnaireVersion; + } + + public void setQuestionnaireVersion(@javax.annotation.Nonnull String questionnaireVersion) { + this.questionnaireVersion = questionnaireVersion; + } + + + public AcademyQuestionnaire completed(@javax.annotation.Nonnull Boolean completed) { + this.completed = completed; + return this; + } + + /** + * Indicates if questionnaire is completed + * @return completed + */ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + public void setCompleted(@javax.annotation.Nonnull Boolean completed) { + this.completed = completed; + } + + + public AcademyQuestionnaire userAnswers(@javax.annotation.Nonnull List userAnswers) { + this.userAnswers = userAnswers; + return this; + } + + public AcademyQuestionnaire addUserAnswersItem(UserAnswer userAnswersItem) { + if (this.userAnswers == null) { + this.userAnswers = new ArrayList<>(); + } + this.userAnswers.add(userAnswersItem); + return this; + } + + /** + * Array of user answers + * @return userAnswers + */ + @javax.annotation.Nonnull + public List getUserAnswers() { + return userAnswers; + } + + public void setUserAnswers(@javax.annotation.Nonnull List userAnswers) { + this.userAnswers = userAnswers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcademyQuestionnaire academyQuestionnaire = (AcademyQuestionnaire) o; + return Objects.equals(this.questionnaireId, academyQuestionnaire.questionnaireId) && + Objects.equals(this.questionnaireVersion, academyQuestionnaire.questionnaireVersion) && + Objects.equals(this.completed, academyQuestionnaire.completed) && + Objects.equals(this.userAnswers, academyQuestionnaire.userAnswers); + } + + @Override + public int hashCode() { + return Objects.hash(questionnaireId, questionnaireVersion, completed, userAnswers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcademyQuestionnaire {\n"); + sb.append(" questionnaireId: ").append(toIndentedString(questionnaireId)).append("\n"); + sb.append(" questionnaireVersion: ").append(toIndentedString(questionnaireVersion)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" userAnswers: ").append(toIndentedString(userAnswers)).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(Arrays.asList("questionnaire_id", "questionnaire_version", "completed", "user_answers")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("questionnaire_id", "questionnaire_version", "completed", "user_answers")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AcademyQuestionnaire + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AcademyQuestionnaire.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AcademyQuestionnaire is not found in the empty JSON string", AcademyQuestionnaire.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AcademyQuestionnaire.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcademyQuestionnaire` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AcademyQuestionnaire.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("questionnaire_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `questionnaire_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("questionnaire_id").toString())); + } + if (!jsonObj.get("questionnaire_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `questionnaire_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("questionnaire_version").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("user_answers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `user_answers` to be an array in the JSON string but got `%s`", jsonObj.get("user_answers").toString())); + } + + JsonArray jsonArrayuserAnswers = jsonObj.getAsJsonArray("user_answers"); + // validate the required field `user_answers` (array) + for (int i = 0; i < jsonArrayuserAnswers.size(); i++) { + UserAnswer.validateJsonElement(jsonArrayuserAnswers.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AcademyQuestionnaire.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AcademyQuestionnaire' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AcademyQuestionnaire.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AcademyQuestionnaire value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AcademyQuestionnaire read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AcademyQuestionnaire given an JSON string + * + * @param jsonString JSON string + * @return An instance of AcademyQuestionnaire + * @throws IOException if the JSON string is invalid with respect to AcademyQuestionnaire + */ + public static AcademyQuestionnaire fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AcademyQuestionnaire.class); + } + + /** + * Convert an instance of AcademyQuestionnaire to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaireListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaireListResponse.java new file mode 100644 index 0000000..730b675 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnaireListResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AcademyQuestionnaire; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get academy questionnaire list response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AcademyQuestionnaireListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public AcademyQuestionnaireListResponse() { + } + + public AcademyQuestionnaireListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AcademyQuestionnaireListResponse addDataItem(AcademyQuestionnaire dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of academy questionnaires items + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcademyQuestionnaireListResponse academyQuestionnaireListResponse = (AcademyQuestionnaireListResponse) o; + return Objects.equals(this.data, academyQuestionnaireListResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcademyQuestionnaireListResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AcademyQuestionnaireListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AcademyQuestionnaireListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AcademyQuestionnaireListResponse is not found in the empty JSON string", AcademyQuestionnaireListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AcademyQuestionnaireListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcademyQuestionnaireListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AcademyQuestionnaireListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AcademyQuestionnaire.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AcademyQuestionnaireListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AcademyQuestionnaireListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AcademyQuestionnaireListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AcademyQuestionnaireListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AcademyQuestionnaireListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AcademyQuestionnaireListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AcademyQuestionnaireListResponse + * @throws IOException if the JSON string is invalid with respect to AcademyQuestionnaireListResponse + */ + public static AcademyQuestionnaireListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AcademyQuestionnaireListResponse.class); + } + + /** + * Convert an instance of AcademyQuestionnaireListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnairePutRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnairePutRequest.java new file mode 100644 index 0000000..4cd7ef0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AcademyQuestionnairePutRequest.java @@ -0,0 +1,314 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.UserAnswer; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * parameters for build create academy questionnaire request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AcademyQuestionnairePutRequest { + public static final String SERIALIZED_NAME_QUESTIONNAIRE_ID = "questionnaire_id"; + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE_ID) + @javax.annotation.Nonnull + private String questionnaireId; + + public static final String SERIALIZED_NAME_QUESTIONNAIRE_VERSION = "questionnaire_version"; + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE_VERSION) + @javax.annotation.Nonnull + private String questionnaireVersion; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + @SerializedName(SERIALIZED_NAME_COMPLETED) + @javax.annotation.Nonnull + private Boolean completed; + + public static final String SERIALIZED_NAME_USER_ANSWERS = "user_answers"; + @SerializedName(SERIALIZED_NAME_USER_ANSWERS) + @javax.annotation.Nonnull + private List userAnswers = new ArrayList<>(); + + public AcademyQuestionnairePutRequest() { + } + + public AcademyQuestionnairePutRequest questionnaireId(@javax.annotation.Nonnull String questionnaireId) { + this.questionnaireId = questionnaireId; + return this; + } + + /** + * Unique ID of the questionnaire + * @return questionnaireId + */ + @javax.annotation.Nonnull + public String getQuestionnaireId() { + return questionnaireId; + } + + public void setQuestionnaireId(@javax.annotation.Nonnull String questionnaireId) { + this.questionnaireId = questionnaireId; + } + + + public AcademyQuestionnairePutRequest questionnaireVersion(@javax.annotation.Nonnull String questionnaireVersion) { + this.questionnaireVersion = questionnaireVersion; + return this; + } + + /** + * Version of the questionnaire + * @return questionnaireVersion + */ + @javax.annotation.Nonnull + public String getQuestionnaireVersion() { + return questionnaireVersion; + } + + public void setQuestionnaireVersion(@javax.annotation.Nonnull String questionnaireVersion) { + this.questionnaireVersion = questionnaireVersion; + } + + + public AcademyQuestionnairePutRequest completed(@javax.annotation.Nonnull Boolean completed) { + this.completed = completed; + return this; + } + + /** + * Indicates if questionnaire is completed + * @return completed + */ + @javax.annotation.Nonnull + public Boolean getCompleted() { + return completed; + } + + public void setCompleted(@javax.annotation.Nonnull Boolean completed) { + this.completed = completed; + } + + + public AcademyQuestionnairePutRequest userAnswers(@javax.annotation.Nonnull List userAnswers) { + this.userAnswers = userAnswers; + return this; + } + + public AcademyQuestionnairePutRequest addUserAnswersItem(UserAnswer userAnswersItem) { + if (this.userAnswers == null) { + this.userAnswers = new ArrayList<>(); + } + this.userAnswers.add(userAnswersItem); + return this; + } + + /** + * Array of user answers + * @return userAnswers + */ + @javax.annotation.Nonnull + public List getUserAnswers() { + return userAnswers; + } + + public void setUserAnswers(@javax.annotation.Nonnull List userAnswers) { + this.userAnswers = userAnswers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AcademyQuestionnairePutRequest academyQuestionnairePutRequest = (AcademyQuestionnairePutRequest) o; + return Objects.equals(this.questionnaireId, academyQuestionnairePutRequest.questionnaireId) && + Objects.equals(this.questionnaireVersion, academyQuestionnairePutRequest.questionnaireVersion) && + Objects.equals(this.completed, academyQuestionnairePutRequest.completed) && + Objects.equals(this.userAnswers, academyQuestionnairePutRequest.userAnswers); + } + + @Override + public int hashCode() { + return Objects.hash(questionnaireId, questionnaireVersion, completed, userAnswers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AcademyQuestionnairePutRequest {\n"); + sb.append(" questionnaireId: ").append(toIndentedString(questionnaireId)).append("\n"); + sb.append(" questionnaireVersion: ").append(toIndentedString(questionnaireVersion)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" userAnswers: ").append(toIndentedString(userAnswers)).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(Arrays.asList("questionnaire_id", "questionnaire_version", "completed", "user_answers")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("questionnaire_id", "questionnaire_version", "completed", "user_answers")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AcademyQuestionnairePutRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AcademyQuestionnairePutRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AcademyQuestionnairePutRequest is not found in the empty JSON string", AcademyQuestionnairePutRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AcademyQuestionnairePutRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcademyQuestionnairePutRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AcademyQuestionnairePutRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("questionnaire_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `questionnaire_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("questionnaire_id").toString())); + } + if (!jsonObj.get("questionnaire_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `questionnaire_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("questionnaire_version").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("user_answers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `user_answers` to be an array in the JSON string but got `%s`", jsonObj.get("user_answers").toString())); + } + + JsonArray jsonArrayuserAnswers = jsonObj.getAsJsonArray("user_answers"); + // validate the required field `user_answers` (array) + for (int i = 0; i < jsonArrayuserAnswers.size(); i++) { + UserAnswer.validateJsonElement(jsonArrayuserAnswers.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AcademyQuestionnairePutRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AcademyQuestionnairePutRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AcademyQuestionnairePutRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AcademyQuestionnairePutRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AcademyQuestionnairePutRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AcademyQuestionnairePutRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AcademyQuestionnairePutRequest + * @throws IOException if the JSON string is invalid with respect to AcademyQuestionnairePutRequest + */ + public static AcademyQuestionnairePutRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AcademyQuestionnairePutRequest.class); + } + + /** + * Convert an instance of AcademyQuestionnairePutRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredential.java new file mode 100644 index 0000000..9e6f883 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredential.java @@ -0,0 +1,497 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredentialRole; +import io.tiledb.cloud.rest_api.v4.model.CloudProvider; +import io.tiledb.cloud.rest_api.v4.model.Credential; +import io.tiledb.cloud.rest_api.v4.model.CredentialType; +import io.tiledb.cloud.rest_api.v4.model.Token; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The user credential object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AccessCredential { + public static final String SERIALIZED_NAME_CREDENTIAL_TYPE = "credential_type"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_TYPE) + @javax.annotation.Nonnull + private CredentialType credentialType; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private CloudProvider provider; + + public static final String SERIALIZED_NAME_PROVIDER_DEFAULT = "provider_default"; + @SerializedName(SERIALIZED_NAME_PROVIDER_DEFAULT) + @javax.annotation.Nullable + private Boolean providerDefault; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_ALLOWED_IN_TASKS = "allowed_in_tasks"; + @SerializedName(SERIALIZED_NAME_ALLOWED_IN_TASKS) + @javax.annotation.Nullable + private Boolean allowedInTasks; + + public static final String SERIALIZED_NAME_CREDENTIAL = "credential"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL) + @javax.annotation.Nullable + private Credential credential; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private AccessCredentialRole role; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private Token token; + + public AccessCredential() { + } + + public AccessCredential credentialType(@javax.annotation.Nonnull CredentialType credentialType) { + this.credentialType = credentialType; + return this; + } + + /** + * Get credentialType + * @return credentialType + */ + @javax.annotation.Nonnull + public CredentialType getCredentialType() { + return credentialType; + } + + public void setCredentialType(@javax.annotation.Nonnull CredentialType credentialType) { + this.credentialType = credentialType; + } + + + public AccessCredential id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The ID of the credential + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public AccessCredential name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * credential name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public AccessCredential provider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nonnull + public CloudProvider getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + } + + + public AccessCredential providerDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + return this; + } + + /** + * True if this is the user's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider + * @return providerDefault + */ + @javax.annotation.Nullable + public Boolean getProviderDefault() { + return providerDefault; + } + + public void setProviderDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + } + + + public AccessCredential createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime credentials were created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public AccessCredential updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime credentials were updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public AccessCredential allowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + return this; + } + + /** + * Is this credential allowed to be used in tasks + * @return allowedInTasks + */ + @javax.annotation.Nullable + public Boolean getAllowedInTasks() { + return allowedInTasks; + } + + public void setAllowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + } + + + public AccessCredential credential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + return this; + } + + /** + * Get credential + * @return credential + */ + @javax.annotation.Nullable + public Credential getCredential() { + return credential; + } + + public void setCredential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + } + + + public AccessCredential role(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public AccessCredentialRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + } + + + public AccessCredential token(@javax.annotation.Nullable Token token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nullable + public Token getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable Token token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessCredential accessCredential = (AccessCredential) o; + return Objects.equals(this.credentialType, accessCredential.credentialType) && + Objects.equals(this.id, accessCredential.id) && + Objects.equals(this.name, accessCredential.name) && + Objects.equals(this.provider, accessCredential.provider) && + Objects.equals(this.providerDefault, accessCredential.providerDefault) && + Objects.equals(this.createdAt, accessCredential.createdAt) && + Objects.equals(this.updatedAt, accessCredential.updatedAt) && + Objects.equals(this.allowedInTasks, accessCredential.allowedInTasks) && + Objects.equals(this.credential, accessCredential.credential) && + Objects.equals(this.role, accessCredential.role) && + Objects.equals(this.token, accessCredential.token); + } + + @Override + public int hashCode() { + return Objects.hash(credentialType, id, name, provider, providerDefault, createdAt, updatedAt, allowedInTasks, credential, role, token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredential {\n"); + sb.append(" credentialType: ").append(toIndentedString(credentialType)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerDefault: ").append(toIndentedString(providerDefault)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" allowedInTasks: ").append(toIndentedString(allowedInTasks)).append("\n"); + sb.append(" credential: ").append(toIndentedString(credential)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).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(Arrays.asList("credential_type", "id", "name", "provider", "provider_default", "created_at", "updated_at", "allowed_in_tasks", "credential", "role", "token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credential_type", "id", "name", "provider", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredential is not found in the empty JSON string", AccessCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccessCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccessCredential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccessCredential.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `credential_type` + CredentialType.validateJsonElement(jsonObj.get("credential_type")); + 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").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())); + } + // validate the required field `provider` + CloudProvider.validateJsonElement(jsonObj.get("provider")); + // validate the optional field `credential` + if (jsonObj.get("credential") != null && !jsonObj.get("credential").isJsonNull()) { + Credential.validateJsonElement(jsonObj.get("credential")); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + AccessCredentialRole.validateJsonElement(jsonObj.get("role")); + } + // validate the optional field `token` + if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) { + Token.validateJsonElement(jsonObj.get("token")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessCredential + * @throws IOException if the JSON string is invalid with respect to AccessCredential + */ + public static AccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessCredential.class); + } + + /** + * Convert an instance of AccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredentialRole.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredentialRole.java new file mode 100644 index 0000000..020b6f9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AccessCredentialRole.java @@ -0,0 +1,207 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AWSRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for access credential role + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AccessCredentialRole { + public static final String SERIALIZED_NAME_AWS = "aws"; + @SerializedName(SERIALIZED_NAME_AWS) + @javax.annotation.Nullable + private AWSRole aws; + + public AccessCredentialRole() { + } + + public AccessCredentialRole aws(@javax.annotation.Nullable AWSRole aws) { + this.aws = aws; + return this; + } + + /** + * Get aws + * @return aws + */ + @javax.annotation.Nullable + public AWSRole getAws() { + return aws; + } + + public void setAws(@javax.annotation.Nullable AWSRole aws) { + this.aws = aws; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessCredentialRole accessCredentialRole = (AccessCredentialRole) o; + return Objects.equals(this.aws, accessCredentialRole.aws); + } + + @Override + public int hashCode() { + return Objects.hash(aws); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredentialRole {\n"); + sb.append(" aws: ").append(toIndentedString(aws)).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(Arrays.asList("aws")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccessCredentialRole + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessCredentialRole.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredentialRole is not found in the empty JSON string", AccessCredentialRole.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AccessCredentialRole.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccessCredentialRole` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `aws` + if (jsonObj.get("aws") != null && !jsonObj.get("aws").isJsonNull()) { + AWSRole.validateJsonElement(jsonObj.get("aws")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessCredentialRole.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessCredentialRole' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessCredentialRole.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessCredentialRole value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccessCredentialRole read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessCredentialRole given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessCredentialRole + * @throws IOException if the JSON string is invalid with respect to AccessCredentialRole + */ + public static AccessCredentialRole fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessCredentialRole.class); + } + + /** + * Convert an instance of AccessCredentialRole to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ArrayInfo.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ArrayInfo.java new file mode 100644 index 0000000..dcc1001 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ArrayInfo.java @@ -0,0 +1,209 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * ArrayInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ArrayInfo { + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public ArrayInfo() { + } + + public ArrayInfo size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Size of the array in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayInfo arrayInfo = (ArrayInfo) o; + return Objects.equals(this.size, arrayInfo.size); + } + + @Override + public int hashCode() { + return Objects.hash(size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayInfo {\n"); + sb.append(" size: ").append(toIndentedString(size)).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(Arrays.asList("size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("size")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ArrayInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayInfo is not found in the empty JSON string", ArrayInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ArrayInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayInfo + * @throws IOException if the JSON string is invalid with respect to ArrayInfo + */ + public static ArrayInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayInfo.class); + } + + /** + * Convert an instance of ArrayInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Asset.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Asset.java new file mode 100644 index 0000000..ebf80d2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Asset.java @@ -0,0 +1,790 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.ArrayInfo; +import io.tiledb.cloud.rest_api.v4.model.AssetBackingType; +import io.tiledb.cloud.rest_api.v4.model.AssetMemberType; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadata; +import io.tiledb.cloud.rest_api.v4.model.AssetType; +import io.tiledb.cloud.rest_api.v4.model.FileInfo; +import io.tiledb.cloud.rest_api.v4.model.FolderInfo; +import io.tiledb.cloud.rest_api.v4.model.GroupInfo; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Asset + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Asset { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_TEAMSPACE_ID = "teamspace_id"; + @SerializedName(SERIALIZED_NAME_TEAMSPACE_ID) + @javax.annotation.Nonnull + private String teamspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_MEMBER_TYPE = "member_type"; + @SerializedName(SERIALIZED_NAME_MEMBER_TYPE) + @javax.annotation.Nullable + private AssetMemberType memberType; + + public static final String SERIALIZED_NAME_MIME = "mime"; + @SerializedName(SERIALIZED_NAME_MIME) + @javax.annotation.Nullable + private String mime; + + public static final String SERIALIZED_NAME_BACKING_TYPE = "backing_type"; + @SerializedName(SERIALIZED_NAME_BACKING_TYPE) + @javax.annotation.Nonnull + private AssetBackingType backingType; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private AssetType type; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private String path; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private WorkspaceUser createdBy; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private List metadata = new ArrayList<>(); + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + @javax.annotation.Nullable + private String uri; + + public static final String SERIALIZED_NAME_TILEDB_URI = "tiledb_uri"; + @SerializedName(SERIALIZED_NAME_TILEDB_URI) + @javax.annotation.Nonnull + private String tiledbUri; + + public static final String SERIALIZED_NAME_FILE_INFO = "fileInfo"; + @SerializedName(SERIALIZED_NAME_FILE_INFO) + @javax.annotation.Nullable + private FileInfo fileInfo; + + public static final String SERIALIZED_NAME_ARRAY_INFO = "arrayInfo"; + @SerializedName(SERIALIZED_NAME_ARRAY_INFO) + @javax.annotation.Nullable + private ArrayInfo arrayInfo; + + public static final String SERIALIZED_NAME_GROUP_INFO = "groupInfo"; + @SerializedName(SERIALIZED_NAME_GROUP_INFO) + @javax.annotation.Nullable + private GroupInfo groupInfo; + + public static final String SERIALIZED_NAME_FOLDER_INFO = "folderInfo"; + @SerializedName(SERIALIZED_NAME_FOLDER_INFO) + @javax.annotation.Nullable + private FolderInfo folderInfo; + + public Asset() { + } + + public Asset id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The asset's ID + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public Asset workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public Asset teamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + return this; + } + + /** + * The teamspace's ID + * @return teamspaceId + */ + @javax.annotation.Nonnull + public String getTeamspaceId() { + return teamspaceId; + } + + public void setTeamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + } + + + public Asset name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the asset. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Asset description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the asset. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Asset memberType(@javax.annotation.Nullable AssetMemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get memberType + * @return memberType + */ + @javax.annotation.Nullable + public AssetMemberType getMemberType() { + return memberType; + } + + public void setMemberType(@javax.annotation.Nullable AssetMemberType memberType) { + this.memberType = memberType; + } + + + public Asset mime(@javax.annotation.Nullable String mime) { + this.mime = mime; + return this; + } + + /** + * The MIME type of the asset. + * @return mime + */ + @javax.annotation.Nullable + public String getMime() { + return mime; + } + + public void setMime(@javax.annotation.Nullable String mime) { + this.mime = mime; + } + + + public Asset backingType(@javax.annotation.Nonnull AssetBackingType backingType) { + this.backingType = backingType; + return this; + } + + /** + * Get backingType + * @return backingType + */ + @javax.annotation.Nonnull + public AssetBackingType getBackingType() { + return backingType; + } + + public void setBackingType(@javax.annotation.Nonnull AssetBackingType backingType) { + this.backingType = backingType; + } + + + public Asset type(@javax.annotation.Nonnull AssetType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public AssetType getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull AssetType type) { + this.type = type; + } + + + public Asset path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The path of the asset. + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + + public Asset createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime asset was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Asset updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime asset was updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public Asset createdBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public WorkspaceUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + } + + + public Asset metadata(@javax.annotation.Nullable List metadata) { + this.metadata = metadata; + return this; + } + + public Asset addMetadataItem(AssetMetadata metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public List getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable List metadata) { + this.metadata = metadata; + } + + + public Asset uri(@javax.annotation.Nullable String uri) { + this.uri = uri; + return this; + } + + /** + * URI where the asset is located. + * @return uri + */ + @javax.annotation.Nullable + public String getUri() { + return uri; + } + + public void setUri(@javax.annotation.Nullable String uri) { + this.uri = uri; + } + + + public Asset tiledbUri(@javax.annotation.Nonnull String tiledbUri) { + this.tiledbUri = tiledbUri; + return this; + } + + /** + * The TileDB URI in the form of tiledb://workspace_name/teamspace_name/asset_id + * @return tiledbUri + */ + @javax.annotation.Nonnull + public String getTiledbUri() { + return tiledbUri; + } + + public void setTiledbUri(@javax.annotation.Nonnull String tiledbUri) { + this.tiledbUri = tiledbUri; + } + + + public Asset fileInfo(@javax.annotation.Nullable FileInfo fileInfo) { + this.fileInfo = fileInfo; + return this; + } + + /** + * Get fileInfo + * @return fileInfo + */ + @javax.annotation.Nullable + public FileInfo getFileInfo() { + return fileInfo; + } + + public void setFileInfo(@javax.annotation.Nullable FileInfo fileInfo) { + this.fileInfo = fileInfo; + } + + + public Asset arrayInfo(@javax.annotation.Nullable ArrayInfo arrayInfo) { + this.arrayInfo = arrayInfo; + return this; + } + + /** + * Get arrayInfo + * @return arrayInfo + */ + @javax.annotation.Nullable + public ArrayInfo getArrayInfo() { + return arrayInfo; + } + + public void setArrayInfo(@javax.annotation.Nullable ArrayInfo arrayInfo) { + this.arrayInfo = arrayInfo; + } + + + public Asset groupInfo(@javax.annotation.Nullable GroupInfo groupInfo) { + this.groupInfo = groupInfo; + return this; + } + + /** + * Get groupInfo + * @return groupInfo + */ + @javax.annotation.Nullable + public GroupInfo getGroupInfo() { + return groupInfo; + } + + public void setGroupInfo(@javax.annotation.Nullable GroupInfo groupInfo) { + this.groupInfo = groupInfo; + } + + + public Asset folderInfo(@javax.annotation.Nullable FolderInfo folderInfo) { + this.folderInfo = folderInfo; + return this; + } + + /** + * Get folderInfo + * @return folderInfo + */ + @javax.annotation.Nullable + public FolderInfo getFolderInfo() { + return folderInfo; + } + + public void setFolderInfo(@javax.annotation.Nullable FolderInfo folderInfo) { + this.folderInfo = folderInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Asset asset = (Asset) o; + return Objects.equals(this.id, asset.id) && + Objects.equals(this.workspaceId, asset.workspaceId) && + Objects.equals(this.teamspaceId, asset.teamspaceId) && + Objects.equals(this.name, asset.name) && + Objects.equals(this.description, asset.description) && + Objects.equals(this.memberType, asset.memberType) && + Objects.equals(this.mime, asset.mime) && + Objects.equals(this.backingType, asset.backingType) && + Objects.equals(this.type, asset.type) && + Objects.equals(this.path, asset.path) && + Objects.equals(this.createdAt, asset.createdAt) && + Objects.equals(this.updatedAt, asset.updatedAt) && + Objects.equals(this.createdBy, asset.createdBy) && + Objects.equals(this.metadata, asset.metadata) && + Objects.equals(this.uri, asset.uri) && + Objects.equals(this.tiledbUri, asset.tiledbUri) && + Objects.equals(this.fileInfo, asset.fileInfo) && + Objects.equals(this.arrayInfo, asset.arrayInfo) && + Objects.equals(this.groupInfo, asset.groupInfo) && + Objects.equals(this.folderInfo, asset.folderInfo); + } + + @Override + public int hashCode() { + return Objects.hash(id, workspaceId, teamspaceId, name, description, memberType, mime, backingType, type, path, createdAt, updatedAt, createdBy, metadata, uri, tiledbUri, fileInfo, arrayInfo, groupInfo, folderInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Asset {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" teamspaceId: ").append(toIndentedString(teamspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" memberType: ").append(toIndentedString(memberType)).append("\n"); + sb.append(" mime: ").append(toIndentedString(mime)).append("\n"); + sb.append(" backingType: ").append(toIndentedString(backingType)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" tiledbUri: ").append(toIndentedString(tiledbUri)).append("\n"); + sb.append(" fileInfo: ").append(toIndentedString(fileInfo)).append("\n"); + sb.append(" arrayInfo: ").append(toIndentedString(arrayInfo)).append("\n"); + sb.append(" groupInfo: ").append(toIndentedString(groupInfo)).append("\n"); + sb.append(" folderInfo: ").append(toIndentedString(folderInfo)).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(Arrays.asList("id", "workspace_id", "teamspace_id", "name", "description", "member_type", "mime", "backing_type", "type", "path", "created_at", "updated_at", "created_by", "metadata", "uri", "tiledb_uri", "fileInfo", "arrayInfo", "groupInfo", "folderInfo")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "workspace_id", "teamspace_id", "name", "backing_type", "type", "path", "created_at", "created_by", "tiledb_uri")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Asset + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Asset.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Asset is not found in the empty JSON string", Asset.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Asset.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Asset` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Asset.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + if (!jsonObj.get("teamspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `teamspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("teamspace_id").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())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field `member_type` + if (jsonObj.get("member_type") != null && !jsonObj.get("member_type").isJsonNull()) { + AssetMemberType.validateJsonElement(jsonObj.get("member_type")); + } + if ((jsonObj.get("mime") != null && !jsonObj.get("mime").isJsonNull()) && !jsonObj.get("mime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mime").toString())); + } + // validate the required field `backing_type` + AssetBackingType.validateJsonElement(jsonObj.get("backing_type")); + // validate the required field `type` + AssetType.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + // validate the required field `created_by` + WorkspaceUser.validateJsonElement(jsonObj.get("created_by")); + if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { + JsonArray jsonArraymetadata = jsonObj.getAsJsonArray("metadata"); + if (jsonArraymetadata != null) { + // ensure the json data is an array + if (!jsonObj.get("metadata").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be an array in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + + // validate the optional field `metadata` (array) + for (int i = 0; i < jsonArraymetadata.size(); i++) { + AssetMetadata.validateJsonElement(jsonArraymetadata.get(i)); + }; + } + } + if ((jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonNull()) && !jsonObj.get("uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uri").toString())); + } + if (!jsonObj.get("tiledb_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tiledb_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tiledb_uri").toString())); + } + // validate the optional field `fileInfo` + if (jsonObj.get("fileInfo") != null && !jsonObj.get("fileInfo").isJsonNull()) { + FileInfo.validateJsonElement(jsonObj.get("fileInfo")); + } + // validate the optional field `arrayInfo` + if (jsonObj.get("arrayInfo") != null && !jsonObj.get("arrayInfo").isJsonNull()) { + ArrayInfo.validateJsonElement(jsonObj.get("arrayInfo")); + } + // validate the optional field `groupInfo` + if (jsonObj.get("groupInfo") != null && !jsonObj.get("groupInfo").isJsonNull()) { + GroupInfo.validateJsonElement(jsonObj.get("groupInfo")); + } + // validate the optional field `folderInfo` + if (jsonObj.get("folderInfo") != null && !jsonObj.get("folderInfo").isJsonNull()) { + FolderInfo.validateJsonElement(jsonObj.get("folderInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Asset.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Asset' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Asset.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Asset value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Asset read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Asset given an JSON string + * + * @param jsonString JSON string + * @return An instance of Asset + * @throws IOException if the JSON string is invalid with respect to Asset + */ + public static Asset fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Asset.class); + } + + /** + * Convert an instance of Asset to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetBackingType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetBackingType.java new file mode 100644 index 0000000..d000422 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetBackingType.java @@ -0,0 +1,82 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The backing type of the asset (e.g., array, group, file, folder). + */ +@JsonAdapter(AssetBackingType.Adapter.class) +public enum AssetBackingType { + + ARRAY("array"), + + GROUP("group"), + + FILE("file"), + + FOLDER("folder"); + + private String value; + + AssetBackingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssetBackingType fromValue(String value) { + for (AssetBackingType b : AssetBackingType.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 AssetBackingType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssetBackingType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssetBackingType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssetBackingType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetGetResponse.java new file mode 100644 index 0000000..6b44016 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Asset; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a single asset + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Asset data; + + public AssetGetResponse() { + } + + public AssetGetResponse data(@javax.annotation.Nonnull Asset data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Asset getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Asset data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetGetResponse assetGetResponse = (AssetGetResponse) o; + return Objects.equals(this.data, assetGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetGetResponse is not found in the empty JSON string", AssetGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Asset.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetGetResponse + * @throws IOException if the JSON string is invalid with respect to AssetGetResponse + */ + public static AssetGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetGetResponse.class); + } + + /** + * Convert an instance of AssetGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetListResponse.java new file mode 100644 index 0000000..6caaa0c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetListResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Asset; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting the list of assets + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nonnull + private PaginationMetadata paginationMetadata; + + public AssetListResponse() { + } + + public AssetListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AssetListResponse addDataItem(Asset dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of assets + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public AssetListResponse paginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nonnull + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetListResponse assetListResponse = (AssetListResponse) o; + return Objects.equals(this.data, assetListResponse.data) && + Objects.equals(this.paginationMetadata, assetListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "pagination_metadata")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetListResponse is not found in the empty JSON string", AssetListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Asset.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `pagination_metadata` + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetListResponse + * @throws IOException if the JSON string is invalid with respect to AssetListResponse + */ + public static AssetListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetListResponse.class); + } + + /** + * Convert an instance of AssetListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMemberType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMemberType.java new file mode 100644 index 0000000..65912ae --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMemberType.java @@ -0,0 +1,88 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The member type associated with the asset. + */ +@JsonAdapter(AssetMemberType.Adapter.class) +public enum AssetMemberType { + + VCF_MEMBER("vcf_member"), + + SOMA_MEMBER("soma_member"), + + BIOIMG_MEMBER("bioimg_member"), + + VECTOR_SEARCH_MEMBER("vector_search_member"), + + GEOMETRY_MEMBER("geometry_member"), + + RASTER_MEMBER("raster_member"), + + POINT_CLOUD_MEMBER("point_cloud_member"); + + private String value; + + AssetMemberType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssetMemberType fromValue(String value) { + for (AssetMemberType b : AssetMemberType.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 AssetMemberType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssetMemberType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssetMemberType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssetMemberType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadata.java new file mode 100644 index 0000000..e6a2e5a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadata.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadataType; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * key/value pair representing an asset metadata entry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetMetadata { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nonnull + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private AssetMetadataType type; + + public AssetMetadata() { + } + + public AssetMetadata key(@javax.annotation.Nonnull String key) { + this.key = key; + return this; + } + + /** + * The key property of metadata pair. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nonnull String key) { + this.key = key; + } + + + public AssetMetadata value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The value property of metadata pair. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + + public AssetMetadata type(@javax.annotation.Nonnull AssetMetadataType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public AssetMetadataType getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull AssetMetadataType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetMetadata assetMetadata = (AssetMetadata) o; + return Objects.equals(this.key, assetMetadata.key) && + Objects.equals(this.value, assetMetadata.value) && + Objects.equals(this.type, assetMetadata.type); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetMetadata {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("key", "value", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("key", "value", "type")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetMetadata is not found in the empty JSON string", AssetMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the required field `type` + AssetMetadataType.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetMetadata + * @throws IOException if the JSON string is invalid with respect to AssetMetadata + */ + public static AssetMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetMetadata.class); + } + + /** + * Convert an instance of AssetMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataListResponse.java new file mode 100644 index 0000000..c57db8a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataListResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadata; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting the list of asset metadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetMetadataListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nonnull + private PaginationMetadata paginationMetadata; + + public AssetMetadataListResponse() { + } + + public AssetMetadataListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AssetMetadataListResponse addDataItem(AssetMetadata dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of asset's metadata + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public AssetMetadataListResponse paginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nonnull + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetMetadataListResponse assetMetadataListResponse = (AssetMetadataListResponse) o; + return Objects.equals(this.data, assetMetadataListResponse.data) && + Objects.equals(this.paginationMetadata, assetMetadataListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetMetadataListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "pagination_metadata")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetMetadataListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetMetadataListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetMetadataListResponse is not found in the empty JSON string", AssetMetadataListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetMetadataListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetMetadataListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetMetadataListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AssetMetadata.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `pagination_metadata` + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetMetadataListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetMetadataListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetMetadataListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetMetadataListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetMetadataListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetMetadataListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetMetadataListResponse + * @throws IOException if the JSON string is invalid with respect to AssetMetadataListResponse + */ + public static AssetMetadataListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetMetadataListResponse.class); + } + + /** + * Convert an instance of AssetMetadataListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveRequestInner.java new file mode 100644 index 0000000..ea553a6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveRequestInner.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadataType; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Asset metadata entry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetMetadataSaveRequestInner { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nonnull + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private AssetMetadataType type; + + public AssetMetadataSaveRequestInner() { + } + + public AssetMetadataSaveRequestInner key(@javax.annotation.Nonnull String key) { + this.key = key; + return this; + } + + /** + * The key property of metadata pair. + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nonnull String key) { + this.key = key; + } + + + public AssetMetadataSaveRequestInner value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The value property of metadata pair. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + + public AssetMetadataSaveRequestInner type(@javax.annotation.Nonnull AssetMetadataType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public AssetMetadataType getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull AssetMetadataType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetMetadataSaveRequestInner assetMetadataSaveRequestInner = (AssetMetadataSaveRequestInner) o; + return Objects.equals(this.key, assetMetadataSaveRequestInner.key) && + Objects.equals(this.value, assetMetadataSaveRequestInner.value) && + Objects.equals(this.type, assetMetadataSaveRequestInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetMetadataSaveRequestInner {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("key", "value", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("key", "value", "type")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetMetadataSaveRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetMetadataSaveRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetMetadataSaveRequestInner is not found in the empty JSON string", AssetMetadataSaveRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetMetadataSaveRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetMetadataSaveRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetMetadataSaveRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the required field `type` + AssetMetadataType.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetMetadataSaveRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetMetadataSaveRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetMetadataSaveRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetMetadataSaveRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetMetadataSaveRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetMetadataSaveRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetMetadataSaveRequestInner + * @throws IOException if the JSON string is invalid with respect to AssetMetadataSaveRequestInner + */ + public static AssetMetadataSaveRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetMetadataSaveRequestInner.class); + } + + /** + * Convert an instance of AssetMetadataSaveRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveResponse.java new file mode 100644 index 0000000..0164ecf --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataSaveResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AssetMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for save asset metadata response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetMetadataSaveResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public AssetMetadataSaveResponse() { + } + + public AssetMetadataSaveResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AssetMetadataSaveResponse addDataItem(AssetMetadata dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of asset's metadata that were saved + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetMetadataSaveResponse assetMetadataSaveResponse = (AssetMetadataSaveResponse) o; + return Objects.equals(this.data, assetMetadataSaveResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetMetadataSaveResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetMetadataSaveResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetMetadataSaveResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetMetadataSaveResponse is not found in the empty JSON string", AssetMetadataSaveResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetMetadataSaveResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetMetadataSaveResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetMetadataSaveResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AssetMetadata.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetMetadataSaveResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetMetadataSaveResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetMetadataSaveResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetMetadataSaveResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetMetadataSaveResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetMetadataSaveResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetMetadataSaveResponse + * @throws IOException if the JSON string is invalid with respect to AssetMetadataSaveResponse + */ + public static AssetMetadataSaveResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetMetadataSaveResponse.class); + } + + /** + * Convert an instance of AssetMetadataSaveResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataType.java new file mode 100644 index 0000000..bbf96b3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetMetadataType.java @@ -0,0 +1,158 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The TileDB type property of metadata pair + */ +@JsonAdapter(AssetMetadataType.Adapter.class) +public enum AssetMetadataType { + + INT32("INT32"), + + INT64("INT64"), + + FLOAT32("FLOAT32"), + + FLOAT64("FLOAT64"), + + CHAR("CHAR"), + + INT8("INT8"), + + UINT8("UINT8"), + + INT16("INT16"), + + UINT16("UINT16"), + + UINT32("UINT32"), + + UINT64("UINT64"), + + STRING_ASCII("STRING_ASCII"), + + STRING_UTF8("STRING_UTF8"), + + STRING_UTF16("STRING_UTF16"), + + STRING_UTF32("STRING_UTF32"), + + STRING_UCS2("STRING_UCS2"), + + STRING_UCS4("STRING_UCS4"), + + ANY("ANY"), + + DATETIME_YEAR("DATETIME_YEAR"), + + DATETIME_MONTH("DATETIME_MONTH"), + + DATETIME_WEEK("DATETIME_WEEK"), + + DATETIME_DAY("DATETIME_DAY"), + + DATETIME_HR("DATETIME_HR"), + + DATETIME_MIN("DATETIME_MIN"), + + DATETIME_SEC("DATETIME_SEC"), + + DATETIME_MS("DATETIME_MS"), + + DATETIME_US("DATETIME_US"), + + DATETIME_NS("DATETIME_NS"), + + DATETIME_PS("DATETIME_PS"), + + DATETIME_FS("DATETIME_FS"), + + DATETIME_AS("DATETIME_AS"), + + TIME_HR("TIME_HR"), + + TIME_MIN("TIME_MIN"), + + TIME_SEC("TIME_SEC"), + + TIME_MS("TIME_MS"), + + TIME_US("TIME_US"), + + TIME_NS("TIME_NS"), + + TIME_PS("TIME_PS"), + + TIME_FS("TIME_FS"), + + TIME_AS("TIME_AS"), + + BLOB("BLOB"), + + BOOL("BOOL"); + + private String value; + + AssetMetadataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssetMetadataType fromValue(String value) { + for (AssetMetadataType b : AssetMetadataType.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 AssetMetadataType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssetMetadataType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssetMetadataType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssetMetadataType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetPathResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetPathResponse.java new file mode 100644 index 0000000..a505518 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetPathResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Asset; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting all assets in a given path + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetPathResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public AssetPathResponse() { + } + + public AssetPathResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public AssetPathResponse addDataItem(Asset dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of assets. The order of the assets corresponds to the order of the path elements. + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetPathResponse assetPathResponse = (AssetPathResponse) o; + return Objects.equals(this.data, assetPathResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetPathResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetPathResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetPathResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetPathResponse is not found in the empty JSON string", AssetPathResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetPathResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetPathResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetPathResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Asset.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetPathResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetPathResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetPathResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetPathResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetPathResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetPathResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetPathResponse + * @throws IOException if the JSON string is invalid with respect to AssetPathResponse + */ + public static AssetPathResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetPathResponse.class); + } + + /** + * Convert an instance of AssetPathResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetRegisterRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetRegisterRequest.java new file mode 100644 index 0000000..b893f49 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetRegisterRequest.java @@ -0,0 +1,300 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Request to register an asset + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetRegisterRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + @javax.annotation.Nonnull + private URI uri; + + public static final String SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME = "access_credentials_name"; + @SerializedName(SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME) + @javax.annotation.Nonnull + private String accessCredentialsName; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private String path; + + public AssetRegisterRequest() { + } + + public AssetRegisterRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the asset + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public AssetRegisterRequest uri(@javax.annotation.Nonnull URI uri) { + this.uri = uri; + return this; + } + + /** + * URI of the asset (e.g., S3 location) + * @return uri + */ + @javax.annotation.Nonnull + public URI getUri() { + return uri; + } + + public void setUri(@javax.annotation.Nonnull URI uri) { + this.uri = uri; + } + + + public AssetRegisterRequest accessCredentialsName(@javax.annotation.Nonnull String accessCredentialsName) { + this.accessCredentialsName = accessCredentialsName; + return this; + } + + /** + * Named reference to access credentials + * @return accessCredentialsName + */ + @javax.annotation.Nonnull + public String getAccessCredentialsName() { + return accessCredentialsName; + } + + public void setAccessCredentialsName(@javax.annotation.Nonnull String accessCredentialsName) { + this.accessCredentialsName = accessCredentialsName; + } + + + public AssetRegisterRequest path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * Target path under the teamspace + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetRegisterRequest assetRegisterRequest = (AssetRegisterRequest) o; + return Objects.equals(this.name, assetRegisterRequest.name) && + Objects.equals(this.uri, assetRegisterRequest.uri) && + Objects.equals(this.accessCredentialsName, assetRegisterRequest.accessCredentialsName) && + Objects.equals(this.path, assetRegisterRequest.path); + } + + @Override + public int hashCode() { + return Objects.hash(name, uri, accessCredentialsName, path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetRegisterRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" accessCredentialsName: ").append(toIndentedString(accessCredentialsName)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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(Arrays.asList("name", "uri", "access_credentials_name", "path")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "uri", "access_credentials_name", "path")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetRegisterRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetRegisterRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetRegisterRequest is not found in the empty JSON string", AssetRegisterRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetRegisterRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetRegisterRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetRegisterRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if (!jsonObj.get("uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uri").toString())); + } + if (!jsonObj.get("access_credentials_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_credentials_name").toString())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetRegisterRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetRegisterRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetRegisterRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetRegisterRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetRegisterRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetRegisterRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetRegisterRequest + * @throws IOException if the JSON string is invalid with respect to AssetRegisterRequest + */ + public static AssetRegisterRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetRegisterRequest.class); + } + + /** + * Convert an instance of AssetRegisterRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetType.java new file mode 100644 index 0000000..162e330 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetType.java @@ -0,0 +1,106 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The type of asset based on how it is represented. + */ +@JsonAdapter(AssetType.Adapter.class) +public enum AssetType { + + ARRAY("array"), + + NOTEBOOK("notebook"), + + DASHBOARD("dashboard"), + + USER_DEFINED_FUNCTION("user_defined_function"), + + ML_MODEL("ml_model"), + + FILE("file"), + + REGISTERED_TASK_GRAPH("registered_task_graph"), + + GROUP("group"), + + VCF("vcf"), + + SOMA("soma"), + + POINTCLOUD("pointcloud"), + + BIOIMG("bioimg"), + + GEOMETRY("geometry"), + + RASTER("raster"), + + VECTOR_SEARCH("vector_search"), + + FOLDER("folder"); + + private String value; + + AssetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssetType fromValue(String value) { + for (AssetType b : AssetType.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 AssetType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssetType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssetType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetUpdateRequest.java new file mode 100644 index 0000000..2f47ac9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetUpdateRequest.java @@ -0,0 +1,265 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AssetType; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Request body for updating an asset. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private AssetType type; + + public AssetUpdateRequest() { + } + + public AssetUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the asset. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public AssetUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the asset. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public AssetUpdateRequest type(@javax.annotation.Nullable AssetType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public AssetType getType() { + return type; + } + + public void setType(@javax.annotation.Nullable AssetType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetUpdateRequest assetUpdateRequest = (AssetUpdateRequest) o; + return Objects.equals(this.name, assetUpdateRequest.name) && + Objects.equals(this.description, assetUpdateRequest.description) && + Objects.equals(this.type, assetUpdateRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name", "description", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetUpdateRequest is not found in the empty JSON string", AssetUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + AssetType.validateJsonElement(jsonObj.get("type")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetUpdateRequest + * @throws IOException if the JSON string is invalid with respect to AssetUpdateRequest + */ + public static AssetUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetUpdateRequest.class); + } + + /** + * Convert an instance of AssetUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetsMoveRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetsMoveRequest.java new file mode 100644 index 0000000..c7775b8 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AssetsMoveRequest.java @@ -0,0 +1,254 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Request to move assets to a target folder + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AssetsMoveRequest { + public static final String SERIALIZED_NAME_ASSETS_TO_ADD = "assets_to_add"; + @SerializedName(SERIALIZED_NAME_ASSETS_TO_ADD) + @javax.annotation.Nonnull + private List assetsToAdd = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TARGET = "target"; + @SerializedName(SERIALIZED_NAME_TARGET) + @javax.annotation.Nonnull + private String target; + + public AssetsMoveRequest() { + } + + public AssetsMoveRequest assetsToAdd(@javax.annotation.Nonnull List assetsToAdd) { + this.assetsToAdd = assetsToAdd; + return this; + } + + public AssetsMoveRequest addAssetsToAddItem(String assetsToAddItem) { + if (this.assetsToAdd == null) { + this.assetsToAdd = new ArrayList<>(); + } + this.assetsToAdd.add(assetsToAddItem); + return this; + } + + /** + * An array of asset ids to move under a target folder + * @return assetsToAdd + */ + @javax.annotation.Nonnull + public List getAssetsToAdd() { + return assetsToAdd; + } + + public void setAssetsToAdd(@javax.annotation.Nonnull List assetsToAdd) { + this.assetsToAdd = assetsToAdd; + } + + + public AssetsMoveRequest target(@javax.annotation.Nonnull String target) { + this.target = target; + return this; + } + + /** + * The asset id or path + * @return target + */ + @javax.annotation.Nonnull + public String getTarget() { + return target; + } + + public void setTarget(@javax.annotation.Nonnull String target) { + this.target = target; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetsMoveRequest assetsMoveRequest = (AssetsMoveRequest) o; + return Objects.equals(this.assetsToAdd, assetsMoveRequest.assetsToAdd) && + Objects.equals(this.target, assetsMoveRequest.target); + } + + @Override + public int hashCode() { + return Objects.hash(assetsToAdd, target); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetsMoveRequest {\n"); + sb.append(" assetsToAdd: ").append(toIndentedString(assetsToAdd)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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(Arrays.asList("assets_to_add", "target")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("assets_to_add", "target")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssetsMoveRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetsMoveRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetsMoveRequest is not found in the empty JSON string", AssetsMoveRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetsMoveRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetsMoveRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetsMoveRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("assets_to_add") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("assets_to_add").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `assets_to_add` to be an array in the JSON string but got `%s`", jsonObj.get("assets_to_add").toString())); + } + if (!jsonObj.get("target").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `target` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetsMoveRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetsMoveRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetsMoveRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetsMoveRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetsMoveRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetsMoveRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetsMoveRequest + * @throws IOException if the JSON string is invalid with respect to AssetsMoveRequest + */ + public static AssetsMoveRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetsMoveRequest.class); + } + + /** + * Convert an instance of AssetsMoveRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureCredential.java new file mode 100644 index 0000000..647dfb9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureCredential.java @@ -0,0 +1,234 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Credential information to access Microsoft Azure. Each supported property is the snake_case version of its name in an Azure Storage connection string + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AzureCredential { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "account_name"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public static final String SERIALIZED_NAME_ACCOUNT_KEY = "account_key"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_KEY) + @javax.annotation.Nullable + private String accountKey; + + public AzureCredential() { + } + + public AzureCredential accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * The name of the Azure account to access + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + + public AzureCredential accountKey(@javax.annotation.Nullable String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * The secret key. Never returned in responses. + * @return accountKey + */ + @javax.annotation.Nullable + public String getAccountKey() { + return accountKey; + } + + public void setAccountKey(@javax.annotation.Nullable String accountKey) { + this.accountKey = accountKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureCredential azureCredential = (AzureCredential) o; + return Objects.equals(this.accountName, azureCredential.accountName) && + Objects.equals(this.accountKey, azureCredential.accountKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, accountKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureCredential {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" accountKey: ").append(toIndentedString(accountKey)).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(Arrays.asList("account_name", "account_key")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AzureCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AzureCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AzureCredential is not found in the empty JSON string", AzureCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AzureCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AzureCredential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("account_name") != null && !jsonObj.get("account_name").isJsonNull()) && !jsonObj.get("account_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_name").toString())); + } + if ((jsonObj.get("account_key") != null && !jsonObj.get("account_key").isJsonNull()) && !jsonObj.get("account_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AzureCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AzureCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AzureCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AzureCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AzureCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AzureCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of AzureCredential + * @throws IOException if the JSON string is invalid with respect to AzureCredential + */ + public static AzureCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AzureCredential.class); + } + + /** + * Convert an instance of AzureCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureToken.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureToken.java new file mode 100644 index 0000000..6ecc53c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/AzureToken.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Token information to access Azure services + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class AzureToken { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "account_name"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nonnull + private String accountName; + + public static final String SERIALIZED_NAME_SAS_TOKEN = "sas_token"; + @SerializedName(SERIALIZED_NAME_SAS_TOKEN) + @javax.annotation.Nonnull + private String sasToken; + + public AzureToken() { + } + + public AzureToken accountName(@javax.annotation.Nonnull String accountName) { + this.accountName = accountName; + return this; + } + + /** + * The account name of the configuration + * @return accountName + */ + @javax.annotation.Nonnull + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nonnull String accountName) { + this.accountName = accountName; + } + + + public AzureToken sasToken(@javax.annotation.Nonnull String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * The token to use for this account + * @return sasToken + */ + @javax.annotation.Nonnull + public String getSasToken() { + return sasToken; + } + + public void setSasToken(@javax.annotation.Nonnull String sasToken) { + this.sasToken = sasToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureToken azureToken = (AzureToken) o; + return Objects.equals(this.accountName, azureToken.accountName) && + Objects.equals(this.sasToken, azureToken.sasToken); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, sasToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureToken {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" sasToken: ").append(toIndentedString(sasToken)).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(Arrays.asList("account_name", "sas_token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("account_name", "sas_token")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AzureToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AzureToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AzureToken is not found in the empty JSON string", AzureToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AzureToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AzureToken` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AzureToken.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("account_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_name").toString())); + } + if (!jsonObj.get("sas_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sas_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sas_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AzureToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AzureToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AzureToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AzureToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AzureToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AzureToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AzureToken + * @throws IOException if the JSON string is invalid with respect to AzureToken + */ + public static AzureToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AzureToken.class); + } + + /** + * Convert an instance of AzureToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ChangePasswordRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ChangePasswordRequest.java new file mode 100644 index 0000000..470c488 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ChangePasswordRequest.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing the necessary data to change a user's password + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ChangePasswordRequest { + public static final String SERIALIZED_NAME_CURRENT_PASSWORD = "current_password"; + @SerializedName(SERIALIZED_NAME_CURRENT_PASSWORD) + @javax.annotation.Nonnull + private String currentPassword; + + public static final String SERIALIZED_NAME_NEW_PASSWORD = "new_password"; + @SerializedName(SERIALIZED_NAME_NEW_PASSWORD) + @javax.annotation.Nonnull + private String newPassword; + + public ChangePasswordRequest() { + } + + public ChangePasswordRequest currentPassword(@javax.annotation.Nonnull String currentPassword) { + this.currentPassword = currentPassword; + return this; + } + + /** + * The user's current password + * @return currentPassword + */ + @javax.annotation.Nonnull + public String getCurrentPassword() { + return currentPassword; + } + + public void setCurrentPassword(@javax.annotation.Nonnull String currentPassword) { + this.currentPassword = currentPassword; + } + + + public ChangePasswordRequest newPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * The new password + * @return newPassword + */ + @javax.annotation.Nonnull + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangePasswordRequest changePasswordRequest = (ChangePasswordRequest) o; + return Objects.equals(this.currentPassword, changePasswordRequest.currentPassword) && + Objects.equals(this.newPassword, changePasswordRequest.newPassword); + } + + @Override + public int hashCode() { + return Objects.hash(currentPassword, newPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangePasswordRequest {\n"); + sb.append(" currentPassword: ").append(toIndentedString(currentPassword)).append("\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).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(Arrays.asList("current_password", "new_password")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("current_password", "new_password")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ChangePasswordRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangePasswordRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChangePasswordRequest is not found in the empty JSON string", ChangePasswordRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChangePasswordRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChangePasswordRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChangePasswordRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("current_password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `current_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("current_password").toString())); + } + if (!jsonObj.get("new_password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `new_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChangePasswordRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChangePasswordRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChangePasswordRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChangePasswordRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChangePasswordRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChangePasswordRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangePasswordRequest + * @throws IOException if the JSON string is invalid with respect to ChangePasswordRequest + */ + public static ChangePasswordRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChangePasswordRequest.class); + } + + /** + * Convert an instance of ChangePasswordRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CloudProvider.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CloudProvider.java new file mode 100644 index 0000000..582618d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CloudProvider.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * A service where data is stored or computations take place + */ +@JsonAdapter(CloudProvider.Adapter.class) +public enum CloudProvider { + + AWS("AWS"), + + AZURE("AZURE"), + + GCP("GCP"); + + private String value; + + CloudProvider(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CloudProvider fromValue(String value) { + for (CloudProvider b : CloudProvider.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 CloudProvider enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CloudProvider read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CloudProvider.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CloudProvider.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CommonPrefix.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CommonPrefix.java new file mode 100644 index 0000000..38b20af --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CommonPrefix.java @@ -0,0 +1,205 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * A folder returned by FileList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CommonPrefix { + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public CommonPrefix() { + } + + public CommonPrefix prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * A prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommonPrefix commonPrefix = (CommonPrefix) o; + return Objects.equals(this.prefix, commonPrefix.prefix); + } + + @Override + public int hashCode() { + return Objects.hash(prefix); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommonPrefix {\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).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(Arrays.asList("Prefix")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommonPrefix + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommonPrefix.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommonPrefix is not found in the empty JSON string", CommonPrefix.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommonPrefix.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommonPrefix` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommonPrefix.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommonPrefix' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommonPrefix.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommonPrefix value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommonPrefix read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommonPrefix given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommonPrefix + * @throws IOException if the JSON string is invalid with respect to CommonPrefix + */ + public static CommonPrefix fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommonPrefix.class); + } + + /** + * Convert an instance of CommonPrefix to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Credential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Credential.java new file mode 100644 index 0000000..e9e5449 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Credential.java @@ -0,0 +1,269 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AWSCredential; +import io.tiledb.cloud.rest_api.v4.model.AzureCredential; +import io.tiledb.cloud.rest_api.v4.model.GCPInteroperabilityCredential; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The credential information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Credential { + public static final String SERIALIZED_NAME_AWS = "aws"; + @SerializedName(SERIALIZED_NAME_AWS) + @javax.annotation.Nullable + private AWSCredential aws; + + public static final String SERIALIZED_NAME_AZURE = "azure"; + @SerializedName(SERIALIZED_NAME_AZURE) + @javax.annotation.Nullable + private AzureCredential azure; + + public static final String SERIALIZED_NAME_GCP = "gcp"; + @SerializedName(SERIALIZED_NAME_GCP) + @javax.annotation.Nullable + private GCPInteroperabilityCredential gcp; + + public Credential() { + } + + public Credential aws(@javax.annotation.Nullable AWSCredential aws) { + this.aws = aws; + return this; + } + + /** + * Get aws + * @return aws + */ + @javax.annotation.Nullable + public AWSCredential getAws() { + return aws; + } + + public void setAws(@javax.annotation.Nullable AWSCredential aws) { + this.aws = aws; + } + + + public Credential azure(@javax.annotation.Nullable AzureCredential azure) { + this.azure = azure; + return this; + } + + /** + * Get azure + * @return azure + */ + @javax.annotation.Nullable + public AzureCredential getAzure() { + return azure; + } + + public void setAzure(@javax.annotation.Nullable AzureCredential azure) { + this.azure = azure; + } + + + public Credential gcp(@javax.annotation.Nullable GCPInteroperabilityCredential gcp) { + this.gcp = gcp; + return this; + } + + /** + * Get gcp + * @return gcp + */ + @javax.annotation.Nullable + public GCPInteroperabilityCredential getGcp() { + return gcp; + } + + public void setGcp(@javax.annotation.Nullable GCPInteroperabilityCredential gcp) { + this.gcp = gcp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Credential credential = (Credential) o; + return Objects.equals(this.aws, credential.aws) && + Objects.equals(this.azure, credential.azure) && + Objects.equals(this.gcp, credential.gcp); + } + + @Override + public int hashCode() { + return Objects.hash(aws, azure, gcp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Credential {\n"); + sb.append(" aws: ").append(toIndentedString(aws)).append("\n"); + sb.append(" azure: ").append(toIndentedString(azure)).append("\n"); + sb.append(" gcp: ").append(toIndentedString(gcp)).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(Arrays.asList("aws", "azure", "gcp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Credential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Credential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Credential is not found in the empty JSON string", Credential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Credential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Credential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `aws` + if (jsonObj.get("aws") != null && !jsonObj.get("aws").isJsonNull()) { + AWSCredential.validateJsonElement(jsonObj.get("aws")); + } + // validate the optional field `azure` + if (jsonObj.get("azure") != null && !jsonObj.get("azure").isJsonNull()) { + AzureCredential.validateJsonElement(jsonObj.get("azure")); + } + // validate the optional field `gcp` + if (jsonObj.get("gcp") != null && !jsonObj.get("gcp").isJsonNull()) { + GCPInteroperabilityCredential.validateJsonElement(jsonObj.get("gcp")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Credential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Credential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Credential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Credential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Credential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Credential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Credential + * @throws IOException if the JSON string is invalid with respect to Credential + */ + public static Credential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Credential.class); + } + + /** + * Convert an instance of Credential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialCreateRequest.java new file mode 100644 index 0000000..43c8c88 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialCreateRequest.java @@ -0,0 +1,386 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredentialRole; +import io.tiledb.cloud.rest_api.v4.model.CloudProvider; +import io.tiledb.cloud.rest_api.v4.model.Credential; +import io.tiledb.cloud.rest_api.v4.model.Token; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for a credential that will be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CredentialCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private CloudProvider provider; + + public static final String SERIALIZED_NAME_PROVIDER_DEFAULT = "provider_default"; + @SerializedName(SERIALIZED_NAME_PROVIDER_DEFAULT) + @javax.annotation.Nullable + private Boolean providerDefault; + + public static final String SERIALIZED_NAME_ALLOWED_IN_TASKS = "allowed_in_tasks"; + @SerializedName(SERIALIZED_NAME_ALLOWED_IN_TASKS) + @javax.annotation.Nullable + private Boolean allowedInTasks; + + public static final String SERIALIZED_NAME_CREDENTIAL = "credential"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL) + @javax.annotation.Nullable + private Credential credential; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private AccessCredentialRole role; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private Token token; + + public CredentialCreateRequest() { + } + + public CredentialCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * credential name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CredentialCreateRequest provider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nonnull + public CloudProvider getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + } + + + public CredentialCreateRequest providerDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + return this; + } + + /** + * True if this is the namespace's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider + * @return providerDefault + */ + @javax.annotation.Nullable + public Boolean getProviderDefault() { + return providerDefault; + } + + public void setProviderDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + } + + + public CredentialCreateRequest allowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + return this; + } + + /** + * Is this credential allowed to be used in tasks + * @return allowedInTasks + */ + @javax.annotation.Nullable + public Boolean getAllowedInTasks() { + return allowedInTasks; + } + + public void setAllowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + } + + + public CredentialCreateRequest credential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + return this; + } + + /** + * Get credential + * @return credential + */ + @javax.annotation.Nullable + public Credential getCredential() { + return credential; + } + + public void setCredential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + } + + + public CredentialCreateRequest role(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public AccessCredentialRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + } + + + public CredentialCreateRequest token(@javax.annotation.Nullable Token token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nullable + public Token getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable Token token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialCreateRequest credentialCreateRequest = (CredentialCreateRequest) o; + return Objects.equals(this.name, credentialCreateRequest.name) && + Objects.equals(this.provider, credentialCreateRequest.provider) && + Objects.equals(this.providerDefault, credentialCreateRequest.providerDefault) && + Objects.equals(this.allowedInTasks, credentialCreateRequest.allowedInTasks) && + Objects.equals(this.credential, credentialCreateRequest.credential) && + Objects.equals(this.role, credentialCreateRequest.role) && + Objects.equals(this.token, credentialCreateRequest.token); + } + + @Override + public int hashCode() { + return Objects.hash(name, provider, providerDefault, allowedInTasks, credential, role, token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerDefault: ").append(toIndentedString(providerDefault)).append("\n"); + sb.append(" allowedInTasks: ").append(toIndentedString(allowedInTasks)).append("\n"); + sb.append(" credential: ").append(toIndentedString(credential)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).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(Arrays.asList("name", "provider", "provider_default", "allowed_in_tasks", "credential", "role", "token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "provider")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialCreateRequest is not found in the empty JSON string", CredentialCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the required field `provider` + CloudProvider.validateJsonElement(jsonObj.get("provider")); + // validate the optional field `credential` + if (jsonObj.get("credential") != null && !jsonObj.get("credential").isJsonNull()) { + Credential.validateJsonElement(jsonObj.get("credential")); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + AccessCredentialRole.validateJsonElement(jsonObj.get("role")); + } + // validate the optional field `token` + if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) { + Token.validateJsonElement(jsonObj.get("token")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialCreateRequest + * @throws IOException if the JSON string is invalid with respect to CredentialCreateRequest + */ + public static CredentialCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialCreateRequest.class); + } + + /** + * Convert an instance of CredentialCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialGetResponse.java new file mode 100644 index 0000000..59b2a9c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredential; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get credential response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CredentialGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private AccessCredential data; + + public CredentialGetResponse() { + } + + public CredentialGetResponse data(@javax.annotation.Nonnull AccessCredential data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public AccessCredential getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull AccessCredential data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialGetResponse credentialGetResponse = (CredentialGetResponse) o; + return Objects.equals(this.data, credentialGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialGetResponse is not found in the empty JSON string", CredentialGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + AccessCredential.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialGetResponse + * @throws IOException if the JSON string is invalid with respect to CredentialGetResponse + */ + public static CredentialGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialGetResponse.class); + } + + /** + * Convert an instance of CredentialGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialType.java new file mode 100644 index 0000000..73be02c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialType.java @@ -0,0 +1,78 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumeration of tileDB Credential types + */ +@JsonAdapter(CredentialType.Adapter.class) +public enum CredentialType { + + WORKSPACE("workspace"), + + TEAMSPACE("teamspace"); + + private String value; + + CredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialType fromValue(String value) { + for (CredentialType b : CredentialType.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 CredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CredentialType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialUpdateRequest.java new file mode 100644 index 0000000..ad45afb --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialUpdateRequest.java @@ -0,0 +1,381 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredentialRole; +import io.tiledb.cloud.rest_api.v4.model.CloudProvider; +import io.tiledb.cloud.rest_api.v4.model.Credential; +import io.tiledb.cloud.rest_api.v4.model.Token; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The credential update object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CredentialUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROVIDER_DEFAULT = "provider_default"; + @SerializedName(SERIALIZED_NAME_PROVIDER_DEFAULT) + @javax.annotation.Nullable + private Boolean providerDefault; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private CloudProvider provider; + + public static final String SERIALIZED_NAME_ALLOWED_IN_TASKS = "allowed_in_tasks"; + @SerializedName(SERIALIZED_NAME_ALLOWED_IN_TASKS) + @javax.annotation.Nullable + private Boolean allowedInTasks; + + public static final String SERIALIZED_NAME_CREDENTIAL = "credential"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL) + @javax.annotation.Nullable + private Credential credential; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private AccessCredentialRole role; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private Token token; + + public CredentialUpdateRequest() { + } + + public CredentialUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * A user-specified name for the key + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public CredentialUpdateRequest providerDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + return this; + } + + /** + * True if this is the user's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider + * @return providerDefault + */ + @javax.annotation.Nullable + public Boolean getProviderDefault() { + return providerDefault; + } + + public void setProviderDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + } + + + public CredentialUpdateRequest provider(@javax.annotation.Nullable CloudProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nullable + public CloudProvider getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable CloudProvider provider) { + this.provider = provider; + } + + + public CredentialUpdateRequest allowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + return this; + } + + /** + * Is this credential allowed to be used in tasks + * @return allowedInTasks + */ + @javax.annotation.Nullable + public Boolean getAllowedInTasks() { + return allowedInTasks; + } + + public void setAllowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + } + + + public CredentialUpdateRequest credential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + return this; + } + + /** + * Get credential + * @return credential + */ + @javax.annotation.Nullable + public Credential getCredential() { + return credential; + } + + public void setCredential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + } + + + public CredentialUpdateRequest role(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public AccessCredentialRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + } + + + public CredentialUpdateRequest token(@javax.annotation.Nullable Token token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nullable + public Token getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable Token token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialUpdateRequest credentialUpdateRequest = (CredentialUpdateRequest) o; + return Objects.equals(this.name, credentialUpdateRequest.name) && + Objects.equals(this.providerDefault, credentialUpdateRequest.providerDefault) && + Objects.equals(this.provider, credentialUpdateRequest.provider) && + Objects.equals(this.allowedInTasks, credentialUpdateRequest.allowedInTasks) && + Objects.equals(this.credential, credentialUpdateRequest.credential) && + Objects.equals(this.role, credentialUpdateRequest.role) && + Objects.equals(this.token, credentialUpdateRequest.token); + } + + @Override + public int hashCode() { + return Objects.hash(name, providerDefault, provider, allowedInTasks, credential, role, token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" providerDefault: ").append(toIndentedString(providerDefault)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" allowedInTasks: ").append(toIndentedString(allowedInTasks)).append("\n"); + sb.append(" credential: ").append(toIndentedString(credential)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).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(Arrays.asList("name", "provider_default", "provider", "allowed_in_tasks", "credential", "role", "token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialUpdateRequest is not found in the empty JSON string", CredentialUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the optional field `provider` + if (jsonObj.get("provider") != null && !jsonObj.get("provider").isJsonNull()) { + CloudProvider.validateJsonElement(jsonObj.get("provider")); + } + // validate the optional field `credential` + if (jsonObj.get("credential") != null && !jsonObj.get("credential").isJsonNull()) { + Credential.validateJsonElement(jsonObj.get("credential")); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + AccessCredentialRole.validateJsonElement(jsonObj.get("role")); + } + // validate the optional field `token` + if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) { + Token.validateJsonElement(jsonObj.get("token")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialUpdateRequest + * @throws IOException if the JSON string is invalid with respect to CredentialUpdateRequest + */ + public static CredentialUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialUpdateRequest.class); + } + + /** + * Convert an instance of CredentialUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsListResponse.java new file mode 100644 index 0000000..09e9d8a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsListResponse.java @@ -0,0 +1,261 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredential; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get credentials list response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CredentialsListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nullable + private PaginationMetadata paginationMetadata; + + public CredentialsListResponse() { + } + + public CredentialsListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public CredentialsListResponse addDataItem(AccessCredential dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of credentials items + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public CredentialsListResponse paginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nullable + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialsListResponse credentialsListResponse = (CredentialsListResponse) o; + return Objects.equals(this.data, credentialsListResponse.data) && + Objects.equals(this.paginationMetadata, credentialsListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialsListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialsListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialsListResponse is not found in the empty JSON string", CredentialsListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialsListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialsListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialsListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AccessCredential.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `pagination_metadata` + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialsListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialsListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialsListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialsListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialsListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialsListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsListResponse + * @throws IOException if the JSON string is invalid with respect to CredentialsListResponse + */ + public static CredentialsListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialsListResponse.class); + } + + /** + * Convert an instance of CredentialsListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsVerifyRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsVerifyRequest.java new file mode 100644 index 0000000..051e2a6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/CredentialsVerifyRequest.java @@ -0,0 +1,444 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AccessCredentialRole; +import io.tiledb.cloud.rest_api.v4.model.CloudProvider; +import io.tiledb.cloud.rest_api.v4.model.Credential; +import io.tiledb.cloud.rest_api.v4.model.Token; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for a credential that will be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class CredentialsVerifyRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private CloudProvider provider; + + public static final String SERIALIZED_NAME_PROVIDER_DEFAULT = "provider_default"; + @SerializedName(SERIALIZED_NAME_PROVIDER_DEFAULT) + @javax.annotation.Nullable + private Boolean providerDefault; + + public static final String SERIALIZED_NAME_ALLOWED_IN_TASKS = "allowed_in_tasks"; + @SerializedName(SERIALIZED_NAME_ALLOWED_IN_TASKS) + @javax.annotation.Nullable + private Boolean allowedInTasks; + + public static final String SERIALIZED_NAME_CREDENTIAL = "credential"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL) + @javax.annotation.Nullable + private Credential credential; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private AccessCredentialRole role; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private Token token; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nullable + private String workspaceId; + + public static final String SERIALIZED_NAME_TEAMSPACE_ID = "teamspace_id"; + @SerializedName(SERIALIZED_NAME_TEAMSPACE_ID) + @javax.annotation.Nullable + private String teamspaceId; + + public CredentialsVerifyRequest() { + } + + public CredentialsVerifyRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * credential name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CredentialsVerifyRequest provider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nonnull + public CloudProvider getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull CloudProvider provider) { + this.provider = provider; + } + + + public CredentialsVerifyRequest providerDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + return this; + } + + /** + * True if this is the namespace's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider + * @return providerDefault + */ + @javax.annotation.Nullable + public Boolean getProviderDefault() { + return providerDefault; + } + + public void setProviderDefault(@javax.annotation.Nullable Boolean providerDefault) { + this.providerDefault = providerDefault; + } + + + public CredentialsVerifyRequest allowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + return this; + } + + /** + * Is this credential allowed to be used in tasks + * @return allowedInTasks + */ + @javax.annotation.Nullable + public Boolean getAllowedInTasks() { + return allowedInTasks; + } + + public void setAllowedInTasks(@javax.annotation.Nullable Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + } + + + public CredentialsVerifyRequest credential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + return this; + } + + /** + * Get credential + * @return credential + */ + @javax.annotation.Nullable + public Credential getCredential() { + return credential; + } + + public void setCredential(@javax.annotation.Nullable Credential credential) { + this.credential = credential; + } + + + public CredentialsVerifyRequest role(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public AccessCredentialRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable AccessCredentialRole role) { + this.role = role; + } + + + public CredentialsVerifyRequest token(@javax.annotation.Nullable Token token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nullable + public Token getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable Token token) { + this.token = token; + } + + + public CredentialsVerifyRequest workspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID. If provided, the given role will be verified in a daisy chain fashion, starting with the role ARN associated with the given workspace. + * @return workspaceId + */ + @javax.annotation.Nullable + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + } + + + public CredentialsVerifyRequest teamspaceId(@javax.annotation.Nullable String teamspaceId) { + this.teamspaceId = teamspaceId; + return this; + } + + /** + * The teamspace's ID. If provided, the given role will be verified in a daisy chain fashion, starting with the role ARN associated with the given teamspace. + * @return teamspaceId + */ + @javax.annotation.Nullable + public String getTeamspaceId() { + return teamspaceId; + } + + public void setTeamspaceId(@javax.annotation.Nullable String teamspaceId) { + this.teamspaceId = teamspaceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialsVerifyRequest credentialsVerifyRequest = (CredentialsVerifyRequest) o; + return Objects.equals(this.name, credentialsVerifyRequest.name) && + Objects.equals(this.provider, credentialsVerifyRequest.provider) && + Objects.equals(this.providerDefault, credentialsVerifyRequest.providerDefault) && + Objects.equals(this.allowedInTasks, credentialsVerifyRequest.allowedInTasks) && + Objects.equals(this.credential, credentialsVerifyRequest.credential) && + Objects.equals(this.role, credentialsVerifyRequest.role) && + Objects.equals(this.token, credentialsVerifyRequest.token) && + Objects.equals(this.workspaceId, credentialsVerifyRequest.workspaceId) && + Objects.equals(this.teamspaceId, credentialsVerifyRequest.teamspaceId); + } + + @Override + public int hashCode() { + return Objects.hash(name, provider, providerDefault, allowedInTasks, credential, role, token, workspaceId, teamspaceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialsVerifyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerDefault: ").append(toIndentedString(providerDefault)).append("\n"); + sb.append(" allowedInTasks: ").append(toIndentedString(allowedInTasks)).append("\n"); + sb.append(" credential: ").append(toIndentedString(credential)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" teamspaceId: ").append(toIndentedString(teamspaceId)).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(Arrays.asList("name", "provider", "provider_default", "allowed_in_tasks", "credential", "role", "token", "workspace_id", "teamspace_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "provider")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsVerifyRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialsVerifyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialsVerifyRequest is not found in the empty JSON string", CredentialsVerifyRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialsVerifyRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialsVerifyRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialsVerifyRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the required field `provider` + CloudProvider.validateJsonElement(jsonObj.get("provider")); + // validate the optional field `credential` + if (jsonObj.get("credential") != null && !jsonObj.get("credential").isJsonNull()) { + Credential.validateJsonElement(jsonObj.get("credential")); + } + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + AccessCredentialRole.validateJsonElement(jsonObj.get("role")); + } + // validate the optional field `token` + if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) { + Token.validateJsonElement(jsonObj.get("token")); + } + if ((jsonObj.get("workspace_id") != null && !jsonObj.get("workspace_id").isJsonNull()) && !jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + if ((jsonObj.get("teamspace_id") != null && !jsonObj.get("teamspace_id").isJsonNull()) && !jsonObj.get("teamspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `teamspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("teamspace_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialsVerifyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialsVerifyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialsVerifyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialsVerifyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialsVerifyRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialsVerifyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsVerifyRequest + * @throws IOException if the JSON string is invalid with respect to CredentialsVerifyRequest + */ + public static CredentialsVerifyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialsVerifyRequest.class); + } + + /** + * Convert an instance of CredentialsVerifyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFile.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFile.java new file mode 100644 index 0000000..ae0b200 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFile.java @@ -0,0 +1,381 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table change file object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class DataChangeFile { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_PARTITION_VALUES = "partitionValues"; + @SerializedName(SERIALIZED_NAME_PARTITION_VALUES) + @javax.annotation.Nonnull + private Map partitionValues = new HashMap<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Integer size; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nonnull + private Integer timestamp; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nonnull + private Integer version; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nullable + private Integer expirationTimestamp; + + public DataChangeFile() { + } + + public DataChangeFile url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * An https url that a client can use to read the file directly. The same file in different responses may have different urls. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public DataChangeFile id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public DataChangeFile partitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + return this; + } + + public DataChangeFile putPartitionValuesItem(String key, Object partitionValuesItem) { + if (this.partitionValues == null) { + this.partitionValues = new HashMap<>(); + } + this.partitionValues.put(key, partitionValuesItem); + return this; + } + + /** + * A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. + * @return partitionValues + */ + @javax.annotation.Nonnull + public Map getPartitionValues() { + return partitionValues; + } + + public void setPartitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + } + + + public DataChangeFile size(@javax.annotation.Nonnull Integer size) { + this.size = size; + return this; + } + + /** + * The size of this file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Integer size) { + this.size = size; + } + + + public DataChangeFile timestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the file in milliseconds from epoch. + * @return timestamp + */ + @javax.annotation.Nonnull + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + } + + + public DataChangeFile version(@javax.annotation.Nonnull Integer version) { + this.version = version; + return this; + } + + /** + * The table version of this file. + * @return version + */ + @javax.annotation.Nonnull + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nonnull Integer version) { + this.version = version; + } + + + public DataChangeFile expirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. + * @return expirationTimestamp + */ + @javax.annotation.Nullable + public Integer getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataChangeFile dataChangeFile = (DataChangeFile) o; + return Objects.equals(this.url, dataChangeFile.url) && + Objects.equals(this.id, dataChangeFile.id) && + Objects.equals(this.partitionValues, dataChangeFile.partitionValues) && + Objects.equals(this.size, dataChangeFile.size) && + Objects.equals(this.timestamp, dataChangeFile.timestamp) && + Objects.equals(this.version, dataChangeFile.version) && + Objects.equals(this.expirationTimestamp, dataChangeFile.expirationTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(url, id, partitionValues, size, timestamp, version, expirationTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataChangeFile {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" partitionValues: ").append(toIndentedString(partitionValues)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).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(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version", "expirationTimestamp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataChangeFile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DataChangeFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DataChangeFile is not found in the empty JSON string", DataChangeFile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DataChangeFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataChangeFile` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DataChangeFile.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DataChangeFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DataChangeFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DataChangeFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DataChangeFile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DataChangeFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataChangeFile + * @throws IOException if the JSON string is invalid with respect to DataChangeFile + */ + public static DataChangeFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DataChangeFile.class); + } + + /** + * Convert an instance of DataChangeFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileAdd.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileAdd.java new file mode 100644 index 0000000..a2324e2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileAdd.java @@ -0,0 +1,410 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table change file object for additions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class DataChangeFileAdd { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_PARTITION_VALUES = "partitionValues"; + @SerializedName(SERIALIZED_NAME_PARTITION_VALUES) + @javax.annotation.Nonnull + private Map partitionValues = new HashMap<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Integer size; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nonnull + private Integer timestamp; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nonnull + private Integer version; + + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + @javax.annotation.Nullable + private String stats; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nullable + private Integer expirationTimestamp; + + public DataChangeFileAdd() { + } + + public DataChangeFileAdd url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * An https url that a client can use to read the file directly. The same file in different responses may have different urls. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public DataChangeFileAdd id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public DataChangeFileAdd partitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + return this; + } + + public DataChangeFileAdd putPartitionValuesItem(String key, Object partitionValuesItem) { + if (this.partitionValues == null) { + this.partitionValues = new HashMap<>(); + } + this.partitionValues.put(key, partitionValuesItem); + return this; + } + + /** + * A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. + * @return partitionValues + */ + @javax.annotation.Nonnull + public Map getPartitionValues() { + return partitionValues; + } + + public void setPartitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + } + + + public DataChangeFileAdd size(@javax.annotation.Nonnull Integer size) { + this.size = size; + return this; + } + + /** + * The size of this file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Integer size) { + this.size = size; + } + + + public DataChangeFileAdd timestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the file in milliseconds from epoch. + * @return timestamp + */ + @javax.annotation.Nonnull + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + } + + + public DataChangeFileAdd version(@javax.annotation.Nonnull Integer version) { + this.version = version; + return this; + } + + /** + * The table version of this file. + * @return version + */ + @javax.annotation.Nonnull + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nonnull Integer version) { + this.version = version; + } + + + public DataChangeFileAdd stats(@javax.annotation.Nullable String stats) { + this.stats = stats; + return this; + } + + /** + * Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. + * @return stats + */ + @javax.annotation.Nullable + public String getStats() { + return stats; + } + + public void setStats(@javax.annotation.Nullable String stats) { + this.stats = stats; + } + + + public DataChangeFileAdd expirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. + * @return expirationTimestamp + */ + @javax.annotation.Nullable + public Integer getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataChangeFileAdd dataChangeFileAdd = (DataChangeFileAdd) o; + return Objects.equals(this.url, dataChangeFileAdd.url) && + Objects.equals(this.id, dataChangeFileAdd.id) && + Objects.equals(this.partitionValues, dataChangeFileAdd.partitionValues) && + Objects.equals(this.size, dataChangeFileAdd.size) && + Objects.equals(this.timestamp, dataChangeFileAdd.timestamp) && + Objects.equals(this.version, dataChangeFileAdd.version) && + Objects.equals(this.stats, dataChangeFileAdd.stats) && + Objects.equals(this.expirationTimestamp, dataChangeFileAdd.expirationTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(url, id, partitionValues, size, timestamp, version, stats, expirationTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataChangeFileAdd {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" partitionValues: ").append(toIndentedString(partitionValues)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).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(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version", "stats", "expirationTimestamp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataChangeFileAdd + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DataChangeFileAdd.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DataChangeFileAdd is not found in the empty JSON string", DataChangeFileAdd.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DataChangeFileAdd.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataChangeFileAdd` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DataChangeFileAdd.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").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("stats") != null && !jsonObj.get("stats").isJsonNull()) && !jsonObj.get("stats").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DataChangeFileAdd.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DataChangeFileAdd' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileAdd.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DataChangeFileAdd value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DataChangeFileAdd read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DataChangeFileAdd given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataChangeFileAdd + * @throws IOException if the JSON string is invalid with respect to DataChangeFileAdd + */ + public static DataChangeFileAdd fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DataChangeFileAdd.class); + } + + /** + * Convert an instance of DataChangeFileAdd to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileRemove.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileRemove.java new file mode 100644 index 0000000..6a7c5b4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/DataChangeFileRemove.java @@ -0,0 +1,381 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table change file object for removals + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class DataChangeFileRemove { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_PARTITION_VALUES = "partitionValues"; + @SerializedName(SERIALIZED_NAME_PARTITION_VALUES) + @javax.annotation.Nonnull + private Map partitionValues = new HashMap<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Integer size; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nonnull + private Integer timestamp; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nonnull + private Integer version; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nullable + private Integer expirationTimestamp; + + public DataChangeFileRemove() { + } + + public DataChangeFileRemove url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * An https url that a client can use to read the file directly. The same file in different responses may have different urls. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public DataChangeFileRemove id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public DataChangeFileRemove partitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + return this; + } + + public DataChangeFileRemove putPartitionValuesItem(String key, Object partitionValuesItem) { + if (this.partitionValues == null) { + this.partitionValues = new HashMap<>(); + } + this.partitionValues.put(key, partitionValuesItem); + return this; + } + + /** + * A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. + * @return partitionValues + */ + @javax.annotation.Nonnull + public Map getPartitionValues() { + return partitionValues; + } + + public void setPartitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + } + + + public DataChangeFileRemove size(@javax.annotation.Nonnull Integer size) { + this.size = size; + return this; + } + + /** + * The size of this file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Integer size) { + this.size = size; + } + + + public DataChangeFileRemove timestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the file in milliseconds from epoch. + * @return timestamp + */ + @javax.annotation.Nonnull + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nonnull Integer timestamp) { + this.timestamp = timestamp; + } + + + public DataChangeFileRemove version(@javax.annotation.Nonnull Integer version) { + this.version = version; + return this; + } + + /** + * The table version of this file. + * @return version + */ + @javax.annotation.Nonnull + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nonnull Integer version) { + this.version = version; + } + + + public DataChangeFileRemove expirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. + * @return expirationTimestamp + */ + @javax.annotation.Nullable + public Integer getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataChangeFileRemove dataChangeFileRemove = (DataChangeFileRemove) o; + return Objects.equals(this.url, dataChangeFileRemove.url) && + Objects.equals(this.id, dataChangeFileRemove.id) && + Objects.equals(this.partitionValues, dataChangeFileRemove.partitionValues) && + Objects.equals(this.size, dataChangeFileRemove.size) && + Objects.equals(this.timestamp, dataChangeFileRemove.timestamp) && + Objects.equals(this.version, dataChangeFileRemove.version) && + Objects.equals(this.expirationTimestamp, dataChangeFileRemove.expirationTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(url, id, partitionValues, size, timestamp, version, expirationTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataChangeFileRemove {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" partitionValues: ").append(toIndentedString(partitionValues)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).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(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version", "expirationTimestamp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataChangeFileRemove + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DataChangeFileRemove.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DataChangeFileRemove is not found in the empty JSON string", DataChangeFileRemove.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DataChangeFileRemove.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataChangeFileRemove` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DataChangeFileRemove.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DataChangeFileRemove.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DataChangeFileRemove' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileRemove.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DataChangeFileRemove value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DataChangeFileRemove read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DataChangeFileRemove given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataChangeFileRemove + * @throws IOException if the JSON string is invalid with respect to DataChangeFileRemove + */ + public static DataChangeFileRemove fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DataChangeFileRemove.class); + } + + /** + * Convert an instance of DataChangeFileRemove to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Error.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Error.java new file mode 100644 index 0000000..f4f8719 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Error.java @@ -0,0 +1,298 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.ValidationError; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing data about a handled error by REST server + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Error { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private Integer code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public static final String SERIALIZED_NAME_REQUEST_ID = "request_id"; + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + @javax.annotation.Nonnull + private String requestId; + + public static final String SERIALIZED_NAME_VALIDATION_ERROR = "validation_error"; + @SerializedName(SERIALIZED_NAME_VALIDATION_ERROR) + @javax.annotation.Nullable + private ValidationError validationError; + + public Error() { + } + + public Error code(@javax.annotation.Nonnull Integer code) { + this.code = code; + return this; + } + + /** + * A hardcoded integer which points to a specific file/line of the code that returned the error + * @return code + */ + @javax.annotation.Nonnull + public Integer getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull Integer code) { + this.code = code; + } + + + public Error message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * A friendly message to be shown to the client + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + public Error requestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + return this; + } + + /** + * The request id to be used for tracing/debugging + * @return requestId + */ + @javax.annotation.Nonnull + public String getRequestId() { + return requestId; + } + + public void setRequestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + } + + + public Error validationError(@javax.annotation.Nullable ValidationError validationError) { + this.validationError = validationError; + return this; + } + + /** + * Get validationError + * @return validationError + */ + @javax.annotation.Nullable + public ValidationError getValidationError() { + return validationError; + } + + public void setValidationError(@javax.annotation.Nullable ValidationError validationError) { + this.validationError = validationError; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && + Objects.equals(this.message, error.message) && + Objects.equals(this.requestId, error.requestId) && + Objects.equals(this.validationError, error.validationError); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, requestId, validationError); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" validationError: ").append(toIndentedString(validationError)).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(Arrays.asList("code", "message", "request_id", "validation_error")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "message", "request_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Error.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Error` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Error.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("request_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `request_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request_id").toString())); + } + // validate the optional field `validation_error` + if (jsonObj.get("validation_error") != null && !jsonObj.get("validation_error").isJsonNull()) { + ValidationError.validateJsonElement(jsonObj.get("validation_error")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Error read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error + * @throws IOException if the JSON string is invalid with respect to Error + */ + public static Error fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error.class); + } + + /** + * Convert an instance of Error to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorResponse.java new file mode 100644 index 0000000..18a16b2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorResponse.java @@ -0,0 +1,238 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing data about a handled error by REST server in delta format + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ErrorResponse { + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @javax.annotation.Nonnull + private Integer errorCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public ErrorResponse() { + } + + public ErrorResponse errorCode(@javax.annotation.Nonnull Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * A hardcoded integer which points to a specific file/line of the code that returned the error + * @return errorCode + */ + @javax.annotation.Nonnull + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(@javax.annotation.Nonnull Integer errorCode) { + this.errorCode = errorCode; + } + + + public ErrorResponse message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * A friendly message to be shown to the client + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.errorCode, errorResponse.errorCode) && + Objects.equals(this.message, errorResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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(Arrays.asList("errorCode", "message")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("errorCode", "message")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorXML.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorXML.java new file mode 100644 index 0000000..3709d32 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ErrorXML.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing data about a handled error by REST server, presented in a format compatible with S3 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ErrorXML { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public static final String SERIALIZED_NAME_REQUEST_ID = "request_id"; + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + @javax.annotation.Nonnull + private String requestId; + + public ErrorXML() { + } + + public ErrorXML code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * A machine-friendly string that describes the error + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public ErrorXML message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * A friendly message to be shown to the client + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + public ErrorXML requestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + return this; + } + + /** + * The request id to be used for tracing/debugging + * @return requestId + */ + @javax.annotation.Nonnull + public String getRequestId() { + return requestId; + } + + public void setRequestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorXML errorXML = (ErrorXML) o; + return Objects.equals(this.code, errorXML.code) && + Objects.equals(this.message, errorXML.message) && + Objects.equals(this.requestId, errorXML.requestId); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, requestId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorXML {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).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(Arrays.asList("code", "message", "request_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "message", "request_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorXML + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorXML.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorXML is not found in the empty JSON string", ErrorXML.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorXML.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorXML` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorXML.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("request_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `request_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorXML.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorXML' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorXML.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorXML value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorXML read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorXML given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorXML + * @throws IOException if the JSON string is invalid with respect to ErrorXML + */ + public static ErrorXML fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorXML.class); + } + + /** + * Convert an instance of ErrorXML to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileInfo.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileInfo.java new file mode 100644 index 0000000..bf3cb13 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileInfo.java @@ -0,0 +1,209 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * FileInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FileInfo { + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public FileInfo() { + } + + public FileInfo size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Size of the file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileInfo fileInfo = (FileInfo) o; + return Objects.equals(this.size, fileInfo.size); + } + + @Override + public int hashCode() { + return Objects.hash(size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileInfo {\n"); + sb.append(" size: ").append(toIndentedString(size)).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(Arrays.asList("size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("size")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FileInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FileInfo is not found in the empty JSON string", FileInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FileInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileInfo + * @throws IOException if the JSON string is invalid with respect to FileInfo + */ + public static FileInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileInfo.class); + } + + /** + * Convert an instance of FileInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileListResponse.java new file mode 100644 index 0000000..b33447f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FileListResponse.java @@ -0,0 +1,473 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.CommonPrefix; +import io.tiledb.cloud.rest_api.v4.model.ModelObject; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The result of a list files operation. Compatible with S3's ListObjectResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FileListResponse { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_DELIMITER = "Delimiter"; + @SerializedName(SERIALIZED_NAME_DELIMITER) + @javax.annotation.Nullable + private String delimiter; + + public static final String SERIALIZED_NAME_MAX_KEYS = "MaxKeys"; + @SerializedName(SERIALIZED_NAME_MAX_KEYS) + @javax.annotation.Nullable + private Integer maxKeys; + + public static final String SERIALIZED_NAME_CONTINUATION_TOKEN = "ContinuationToken"; + @SerializedName(SERIALIZED_NAME_CONTINUATION_TOKEN) + @javax.annotation.Nullable + private String continuationToken; + + public static final String SERIALIZED_NAME_NEXT_CONTINUATION_TOKEN = "NextContinuationToken"; + @SerializedName(SERIALIZED_NAME_NEXT_CONTINUATION_TOKEN) + @javax.annotation.Nullable + private String nextContinuationToken; + + public static final String SERIALIZED_NAME_IS_TRUNCATED = "IsTruncated"; + @SerializedName(SERIALIZED_NAME_IS_TRUNCATED) + @javax.annotation.Nullable + private Boolean isTruncated; + + public static final String SERIALIZED_NAME_COMMON_PREFIXES = "CommonPrefixes"; + @SerializedName(SERIALIZED_NAME_COMMON_PREFIXES) + @javax.annotation.Nullable + private List commonPrefixes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_OBJECTS = "Objects"; + @SerializedName(SERIALIZED_NAME_OBJECTS) + @javax.annotation.Nullable + private List objects = new ArrayList<>(); + + public FileListResponse() { + } + + public FileListResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the bucket (teamspace) with the objects + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FileListResponse prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The prefix under which objects are listed + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public FileListResponse delimiter(@javax.annotation.Nullable String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * The string that delimits the path segments. Only forward slash is supported + * @return delimiter + */ + @javax.annotation.Nullable + public String getDelimiter() { + return delimiter; + } + + public void setDelimiter(@javax.annotation.Nullable String delimiter) { + this.delimiter = delimiter; + } + + + public FileListResponse maxKeys(@javax.annotation.Nullable Integer maxKeys) { + this.maxKeys = maxKeys; + return this; + } + + /** + * The maximum amount of objects to return + * @return maxKeys + */ + @javax.annotation.Nullable + public Integer getMaxKeys() { + return maxKeys; + } + + public void setMaxKeys(@javax.annotation.Nullable Integer maxKeys) { + this.maxKeys = maxKeys; + } + + + public FileListResponse continuationToken(@javax.annotation.Nullable String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * The continuation token that was passed to the operation + * @return continuationToken + */ + @javax.annotation.Nullable + public String getContinuationToken() { + return continuationToken; + } + + public void setContinuationToken(@javax.annotation.Nullable String continuationToken) { + this.continuationToken = continuationToken; + } + + + public FileListResponse nextContinuationToken(@javax.annotation.Nullable String nextContinuationToken) { + this.nextContinuationToken = nextContinuationToken; + return this; + } + + /** + * The continuation token to pass to list the next items + * @return nextContinuationToken + */ + @javax.annotation.Nullable + public String getNextContinuationToken() { + return nextContinuationToken; + } + + public void setNextContinuationToken(@javax.annotation.Nullable String nextContinuationToken) { + this.nextContinuationToken = nextContinuationToken; + } + + + public FileListResponse isTruncated(@javax.annotation.Nullable Boolean isTruncated) { + this.isTruncated = isTruncated; + return this; + } + + /** + * Whether there are no more files to list + * @return isTruncated + */ + @javax.annotation.Nullable + public Boolean getIsTruncated() { + return isTruncated; + } + + public void setIsTruncated(@javax.annotation.Nullable Boolean isTruncated) { + this.isTruncated = isTruncated; + } + + + public FileListResponse commonPrefixes(@javax.annotation.Nullable List commonPrefixes) { + this.commonPrefixes = commonPrefixes; + return this; + } + + public FileListResponse addCommonPrefixesItem(CommonPrefix commonPrefixesItem) { + if (this.commonPrefixes == null) { + this.commonPrefixes = new ArrayList<>(); + } + this.commonPrefixes.add(commonPrefixesItem); + return this; + } + + /** + * The common prefixes (folders) contained under prefix. + * @return commonPrefixes + */ + @javax.annotation.Nullable + public List getCommonPrefixes() { + return commonPrefixes; + } + + public void setCommonPrefixes(@javax.annotation.Nullable List commonPrefixes) { + this.commonPrefixes = commonPrefixes; + } + + + public FileListResponse objects(@javax.annotation.Nullable List objects) { + this.objects = objects; + return this; + } + + public FileListResponse addObjectsItem(ModelObject objectsItem) { + if (this.objects == null) { + this.objects = new ArrayList<>(); + } + this.objects.add(objectsItem); + return this; + } + + /** + * The objects (files) contained under prefix. + * @return objects + */ + @javax.annotation.Nullable + public List getObjects() { + return objects; + } + + public void setObjects(@javax.annotation.Nullable List objects) { + this.objects = objects; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileListResponse fileListResponse = (FileListResponse) o; + return Objects.equals(this.name, fileListResponse.name) && + Objects.equals(this.prefix, fileListResponse.prefix) && + Objects.equals(this.delimiter, fileListResponse.delimiter) && + Objects.equals(this.maxKeys, fileListResponse.maxKeys) && + Objects.equals(this.continuationToken, fileListResponse.continuationToken) && + Objects.equals(this.nextContinuationToken, fileListResponse.nextContinuationToken) && + Objects.equals(this.isTruncated, fileListResponse.isTruncated) && + Objects.equals(this.commonPrefixes, fileListResponse.commonPrefixes) && + Objects.equals(this.objects, fileListResponse.objects); + } + + @Override + public int hashCode() { + return Objects.hash(name, prefix, delimiter, maxKeys, continuationToken, nextContinuationToken, isTruncated, commonPrefixes, objects); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileListResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" delimiter: ").append(toIndentedString(delimiter)).append("\n"); + sb.append(" maxKeys: ").append(toIndentedString(maxKeys)).append("\n"); + sb.append(" continuationToken: ").append(toIndentedString(continuationToken)).append("\n"); + sb.append(" nextContinuationToken: ").append(toIndentedString(nextContinuationToken)).append("\n"); + sb.append(" isTruncated: ").append(toIndentedString(isTruncated)).append("\n"); + sb.append(" commonPrefixes: ").append(toIndentedString(commonPrefixes)).append("\n"); + sb.append(" objects: ").append(toIndentedString(objects)).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(Arrays.asList("Name", "Prefix", "Delimiter", "MaxKeys", "ContinuationToken", "NextContinuationToken", "IsTruncated", "CommonPrefixes", "Objects")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FileListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FileListResponse is not found in the empty JSON string", FileListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("Delimiter") != null && !jsonObj.get("Delimiter").isJsonNull()) && !jsonObj.get("Delimiter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Delimiter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Delimiter").toString())); + } + if ((jsonObj.get("ContinuationToken") != null && !jsonObj.get("ContinuationToken").isJsonNull()) && !jsonObj.get("ContinuationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ContinuationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ContinuationToken").toString())); + } + if ((jsonObj.get("NextContinuationToken") != null && !jsonObj.get("NextContinuationToken").isJsonNull()) && !jsonObj.get("NextContinuationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NextContinuationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NextContinuationToken").toString())); + } + if (jsonObj.get("CommonPrefixes") != null && !jsonObj.get("CommonPrefixes").isJsonNull()) { + JsonArray jsonArraycommonPrefixes = jsonObj.getAsJsonArray("CommonPrefixes"); + if (jsonArraycommonPrefixes != null) { + // ensure the json data is an array + if (!jsonObj.get("CommonPrefixes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CommonPrefixes` to be an array in the JSON string but got `%s`", jsonObj.get("CommonPrefixes").toString())); + } + + // validate the optional field `CommonPrefixes` (array) + for (int i = 0; i < jsonArraycommonPrefixes.size(); i++) { + CommonPrefix.validateJsonElement(jsonArraycommonPrefixes.get(i)); + }; + } + } + if (jsonObj.get("Objects") != null && !jsonObj.get("Objects").isJsonNull()) { + JsonArray jsonArrayobjects = jsonObj.getAsJsonArray("Objects"); + if (jsonArrayobjects != null) { + // ensure the json data is an array + if (!jsonObj.get("Objects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Objects` to be an array in the JSON string but got `%s`", jsonObj.get("Objects").toString())); + } + + // validate the optional field `Objects` (array) + for (int i = 0; i < jsonArrayobjects.size(); i++) { + ModelObject.validateJsonElement(jsonArrayobjects.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileListResponse + * @throws IOException if the JSON string is invalid with respect to FileListResponse + */ + public static FileListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileListResponse.class); + } + + /** + * Convert an instance of FileListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Folder.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Folder.java new file mode 100644 index 0000000..8f1bc0e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Folder.java @@ -0,0 +1,497 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Folder + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Folder { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_TEAMSPACE_ID = "teamspace_id"; + @SerializedName(SERIALIZED_NAME_TEAMSPACE_ID) + @javax.annotation.Nonnull + private String teamspaceId; + + public static final String SERIALIZED_NAME_GROUP_ID = "group_id"; + @SerializedName(SERIALIZED_NAME_GROUP_ID) + @javax.annotation.Nullable + private String groupId; + + public static final String SERIALIZED_NAME_ASSET_ID = "asset_id"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + @javax.annotation.Nonnull + private String assetId; + + public static final String SERIALIZED_NAME_PARENT_FOLDER_ID = "parent_folder_id"; + @SerializedName(SERIALIZED_NAME_PARENT_FOLDER_ID) + @javax.annotation.Nullable + private String parentFolderId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private WorkspaceUser createdBy; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public Folder() { + } + + public Folder id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The folder's ID + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public Folder workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public Folder teamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + return this; + } + + /** + * The teamspace's ID + * @return teamspaceId + */ + @javax.annotation.Nonnull + public String getTeamspaceId() { + return teamspaceId; + } + + public void setTeamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + } + + + public Folder groupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + return this; + } + + /** + * The group's ID + * @return groupId + */ + @javax.annotation.Nullable + public String getGroupId() { + return groupId; + } + + public void setGroupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + } + + + public Folder assetId(@javax.annotation.Nonnull String assetId) { + this.assetId = assetId; + return this; + } + + /** + * The asset's ID + * @return assetId + */ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + public void setAssetId(@javax.annotation.Nonnull String assetId) { + this.assetId = assetId; + } + + + public Folder parentFolderId(@javax.annotation.Nullable String parentFolderId) { + this.parentFolderId = parentFolderId; + return this; + } + + /** + * The folder's ID + * @return parentFolderId + */ + @javax.annotation.Nullable + public String getParentFolderId() { + return parentFolderId; + } + + public void setParentFolderId(@javax.annotation.Nullable String parentFolderId) { + this.parentFolderId = parentFolderId; + } + + + public Folder name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the folder. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Folder createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime asset was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Folder updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime asset was updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public Folder createdBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public WorkspaceUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + } + + + public Folder description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the folder. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Folder folder = (Folder) o; + return Objects.equals(this.id, folder.id) && + Objects.equals(this.workspaceId, folder.workspaceId) && + Objects.equals(this.teamspaceId, folder.teamspaceId) && + Objects.equals(this.groupId, folder.groupId) && + Objects.equals(this.assetId, folder.assetId) && + Objects.equals(this.parentFolderId, folder.parentFolderId) && + Objects.equals(this.name, folder.name) && + Objects.equals(this.createdAt, folder.createdAt) && + Objects.equals(this.updatedAt, folder.updatedAt) && + Objects.equals(this.createdBy, folder.createdBy) && + Objects.equals(this.description, folder.description); + } + + @Override + public int hashCode() { + return Objects.hash(id, workspaceId, teamspaceId, groupId, assetId, parentFolderId, name, createdAt, updatedAt, createdBy, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Folder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" teamspaceId: ").append(toIndentedString(teamspaceId)).append("\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" parentFolderId: ").append(toIndentedString(parentFolderId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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(Arrays.asList("id", "workspace_id", "teamspace_id", "group_id", "asset_id", "parent_folder_id", "name", "created_at", "updated_at", "created_by", "description")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "workspace_id", "teamspace_id", "asset_id", "name", "created_at", "created_by")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Folder + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Folder.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Folder is not found in the empty JSON string", Folder.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Folder.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Folder` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Folder.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + if (!jsonObj.get("teamspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `teamspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("teamspace_id").toString())); + } + if ((jsonObj.get("group_id") != null && !jsonObj.get("group_id").isJsonNull()) && !jsonObj.get("group_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `group_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group_id").toString())); + } + if (!jsonObj.get("asset_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `asset_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("asset_id").toString())); + } + if ((jsonObj.get("parent_folder_id") != null && !jsonObj.get("parent_folder_id").isJsonNull()) && !jsonObj.get("parent_folder_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parent_folder_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parent_folder_id").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())); + } + // validate the required field `created_by` + WorkspaceUser.validateJsonElement(jsonObj.get("created_by")); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Folder.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Folder' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Folder.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Folder value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Folder read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Folder given an JSON string + * + * @param jsonString JSON string + * @return An instance of Folder + * @throws IOException if the JSON string is invalid with respect to Folder + */ + public static Folder fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Folder.class); + } + + /** + * Convert an instance of Folder to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderContentsResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderContentsResponse.java new file mode 100644 index 0000000..462d796 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderContentsResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Asset; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting the list of folder contents + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderContentsResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nonnull + private PaginationMetadata paginationMetadata; + + public FolderContentsResponse() { + } + + public FolderContentsResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public FolderContentsResponse addDataItem(Asset dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of assets + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public FolderContentsResponse paginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nonnull + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderContentsResponse folderContentsResponse = (FolderContentsResponse) o; + return Objects.equals(this.data, folderContentsResponse.data) && + Objects.equals(this.paginationMetadata, folderContentsResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderContentsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "pagination_metadata")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderContentsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderContentsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderContentsResponse is not found in the empty JSON string", FolderContentsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderContentsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderContentsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FolderContentsResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Asset.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `pagination_metadata` + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderContentsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderContentsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderContentsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderContentsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderContentsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderContentsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderContentsResponse + * @throws IOException if the JSON string is invalid with respect to FolderContentsResponse + */ + public static FolderContentsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderContentsResponse.class); + } + + /** + * Convert an instance of FolderContentsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateRequestInner.java new file mode 100644 index 0000000..f342ea8 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateRequestInner.java @@ -0,0 +1,205 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for folders that will be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderCreateRequestInner { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public FolderCreateRequestInner() { + } + + public FolderCreateRequestInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Folder description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderCreateRequestInner folderCreateRequestInner = (FolderCreateRequestInner) o; + return Objects.equals(this.description, folderCreateRequestInner.description); + } + + @Override + public int hashCode() { + return Objects.hash(description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderCreateRequestInner {\n"); + sb.append(" description: ").append(toIndentedString(description)).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(Arrays.asList("description")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderCreateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderCreateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderCreateRequestInner is not found in the empty JSON string", FolderCreateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderCreateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderCreateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderCreateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderCreateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderCreateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderCreateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderCreateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderCreateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderCreateRequestInner + * @throws IOException if the JSON string is invalid with respect to FolderCreateRequestInner + */ + public static FolderCreateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderCreateRequestInner.class); + } + + /** + * Convert an instance of FolderCreateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateResponse.java new file mode 100644 index 0000000..8c0e777 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Folder; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for create folder response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Folder data; + + public FolderCreateResponse() { + } + + public FolderCreateResponse data(@javax.annotation.Nonnull Folder data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Folder getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Folder data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderCreateResponse folderCreateResponse = (FolderCreateResponse) o; + return Objects.equals(this.data, folderCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderCreateResponse is not found in the empty JSON string", FolderCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FolderCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Folder.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderCreateResponse + * @throws IOException if the JSON string is invalid with respect to FolderCreateResponse + */ + public static FolderCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderCreateResponse.class); + } + + /** + * Convert an instance of FolderCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderGetResponse.java new file mode 100644 index 0000000..97f4acf --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Folder; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a single folder + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Folder data; + + public FolderGetResponse() { + } + + public FolderGetResponse data(@javax.annotation.Nonnull Folder data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Folder getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Folder data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderGetResponse folderGetResponse = (FolderGetResponse) o; + return Objects.equals(this.data, folderGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderGetResponse is not found in the empty JSON string", FolderGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FolderGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Folder.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderGetResponse + * @throws IOException if the JSON string is invalid with respect to FolderGetResponse + */ + public static FolderGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderGetResponse.class); + } + + /** + * Convert an instance of FolderGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderInfo.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderInfo.java new file mode 100644 index 0000000..7251788 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderInfo.java @@ -0,0 +1,209 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * FolderInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderInfo { + public static final String SERIALIZED_NAME_LENGTH = "length"; + @SerializedName(SERIALIZED_NAME_LENGTH) + @javax.annotation.Nonnull + private Long length; + + public FolderInfo() { + } + + public FolderInfo length(@javax.annotation.Nonnull Long length) { + this.length = length; + return this; + } + + /** + * Number of items in the folder. + * @return length + */ + @javax.annotation.Nonnull + public Long getLength() { + return length; + } + + public void setLength(@javax.annotation.Nonnull Long length) { + this.length = length; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderInfo folderInfo = (FolderInfo) o; + return Objects.equals(this.length, folderInfo.length); + } + + @Override + public int hashCode() { + return Objects.hash(length); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderInfo {\n"); + sb.append(" length: ").append(toIndentedString(length)).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(Arrays.asList("length")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("length")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderInfo is not found in the empty JSON string", FolderInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FolderInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderInfo + * @throws IOException if the JSON string is invalid with respect to FolderInfo + */ + public static FolderInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderInfo.class); + } + + /** + * Convert an instance of FolderInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderUpdateRequest.java new file mode 100644 index 0000000..e71491a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FolderUpdateRequest.java @@ -0,0 +1,234 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a folder + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FolderUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public FolderUpdateRequest() { + } + + public FolderUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The teamspace name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public FolderUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The folder description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderUpdateRequest folderUpdateRequest = (FolderUpdateRequest) o; + return Objects.equals(this.name, folderUpdateRequest.name) && + Objects.equals(this.description, folderUpdateRequest.description); + } + + @Override + public int hashCode() { + return Objects.hash(name, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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(Arrays.asList("name", "description")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FolderUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FolderUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FolderUpdateRequest is not found in the empty JSON string", FolderUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FolderUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FolderUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FolderUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FolderUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FolderUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FolderUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FolderUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FolderUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FolderUpdateRequest + * @throws IOException if the JSON string is invalid with respect to FolderUpdateRequest + */ + public static FolderUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FolderUpdateRequest.class); + } + + /** + * Convert an instance of FolderUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/FoldersContentsModifyInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FoldersContentsModifyInner.java new file mode 100644 index 0000000..2c6fb7b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/FoldersContentsModifyInner.java @@ -0,0 +1,265 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object to add or remove contents under a folder + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class FoldersContentsModifyInner { + public static final String SERIALIZED_NAME_MEMBERS_TO_ADD = "members_to_add"; + @SerializedName(SERIALIZED_NAME_MEMBERS_TO_ADD) + @javax.annotation.Nonnull + private List membersToAdd = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBERS_TO_REMOVE = "members_to_remove"; + @SerializedName(SERIALIZED_NAME_MEMBERS_TO_REMOVE) + @javax.annotation.Nonnull + private List membersToRemove = new ArrayList<>(); + + public FoldersContentsModifyInner() { + } + + public FoldersContentsModifyInner membersToAdd(@javax.annotation.Nonnull List membersToAdd) { + this.membersToAdd = membersToAdd; + return this; + } + + public FoldersContentsModifyInner addMembersToAddItem(String membersToAddItem) { + if (this.membersToAdd == null) { + this.membersToAdd = new ArrayList<>(); + } + this.membersToAdd.add(membersToAddItem); + return this; + } + + /** + * An array of asset ids to add under a folder + * @return membersToAdd + */ + @javax.annotation.Nonnull + public List getMembersToAdd() { + return membersToAdd; + } + + public void setMembersToAdd(@javax.annotation.Nonnull List membersToAdd) { + this.membersToAdd = membersToAdd; + } + + + public FoldersContentsModifyInner membersToRemove(@javax.annotation.Nonnull List membersToRemove) { + this.membersToRemove = membersToRemove; + return this; + } + + public FoldersContentsModifyInner addMembersToRemoveItem(String membersToRemoveItem) { + if (this.membersToRemove == null) { + this.membersToRemove = new ArrayList<>(); + } + this.membersToRemove.add(membersToRemoveItem); + return this; + } + + /** + * An array of asset ids to remove from a folder + * @return membersToRemove + */ + @javax.annotation.Nonnull + public List getMembersToRemove() { + return membersToRemove; + } + + public void setMembersToRemove(@javax.annotation.Nonnull List membersToRemove) { + this.membersToRemove = membersToRemove; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FoldersContentsModifyInner foldersContentsModifyInner = (FoldersContentsModifyInner) o; + return Objects.equals(this.membersToAdd, foldersContentsModifyInner.membersToAdd) && + Objects.equals(this.membersToRemove, foldersContentsModifyInner.membersToRemove); + } + + @Override + public int hashCode() { + return Objects.hash(membersToAdd, membersToRemove); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FoldersContentsModifyInner {\n"); + sb.append(" membersToAdd: ").append(toIndentedString(membersToAdd)).append("\n"); + sb.append(" membersToRemove: ").append(toIndentedString(membersToRemove)).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(Arrays.asList("members_to_add", "members_to_remove")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("members_to_add", "members_to_remove")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FoldersContentsModifyInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FoldersContentsModifyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FoldersContentsModifyInner is not found in the empty JSON string", FoldersContentsModifyInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FoldersContentsModifyInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FoldersContentsModifyInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FoldersContentsModifyInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("members_to_add") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("members_to_add").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members_to_add` to be an array in the JSON string but got `%s`", jsonObj.get("members_to_add").toString())); + } + // ensure the required json array is present + if (jsonObj.get("members_to_remove") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("members_to_remove").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members_to_remove` to be an array in the JSON string but got `%s`", jsonObj.get("members_to_remove").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FoldersContentsModifyInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FoldersContentsModifyInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FoldersContentsModifyInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FoldersContentsModifyInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FoldersContentsModifyInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FoldersContentsModifyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of FoldersContentsModifyInner + * @throws IOException if the JSON string is invalid with respect to FoldersContentsModifyInner + */ + public static FoldersContentsModifyInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FoldersContentsModifyInner.class); + } + + /** + * Convert an instance of FoldersContentsModifyInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Format.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Format.java new file mode 100644 index 0000000..0b2ed02 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Format.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table metadata object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Format { + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private String provider; + + public Format() { + } + + public Format provider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + return this; + } + + /** + * Name of the encoding for data files in this table. Currently the only valid value is parquet. This is to enable possible support for other formats in the future. + * @return provider + */ + @javax.annotation.Nonnull + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Format format = (Format) o; + return Objects.equals(this.provider, format.provider); + } + + @Override + public int hashCode() { + return Objects.hash(provider); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Format {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).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(Arrays.asList("provider")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("provider")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Format + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Format.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Format is not found in the empty JSON string", Format.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Format.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Format` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Format.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provider").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Format.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Format' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Format.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Format value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Format read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Format given an JSON string + * + * @param jsonString JSON string + * @return An instance of Format + * @throws IOException if the JSON string is invalid with respect to Format + */ + public static Format fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Format.class); + } + + /** + * Convert an instance of Format to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPInteroperabilityCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPInteroperabilityCredential.java new file mode 100644 index 0000000..e7670eb --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPInteroperabilityCredential.java @@ -0,0 +1,234 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Credential information to access Google Cloud. using well knows key/secret pair to access storage. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class GCPInteroperabilityCredential { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + @javax.annotation.Nullable + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + @javax.annotation.Nullable + private String secretAccessKey; + + public GCPInteroperabilityCredential() { + } + + public GCPInteroperabilityCredential accessKeyId(@javax.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * The ID of the access key + * @return accessKeyId + */ + @javax.annotation.Nullable + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(@javax.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public GCPInteroperabilityCredential secretAccessKey(@javax.annotation.Nullable String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * The access key's secret. Never returned in responses. + * @return secretAccessKey + */ + @javax.annotation.Nullable + public String getSecretAccessKey() { + return secretAccessKey; + } + + public void setSecretAccessKey(@javax.annotation.Nullable String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GCPInteroperabilityCredential gcPInteroperabilityCredential = (GCPInteroperabilityCredential) o; + return Objects.equals(this.accessKeyId, gcPInteroperabilityCredential.accessKeyId) && + Objects.equals(this.secretAccessKey, gcPInteroperabilityCredential.secretAccessKey); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GCPInteroperabilityCredential {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).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(Arrays.asList("access_key_id", "secret_access_key")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GCPInteroperabilityCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GCPInteroperabilityCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GCPInteroperabilityCredential is not found in the empty JSON string", GCPInteroperabilityCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GCPInteroperabilityCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GCPInteroperabilityCredential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_key_id") != null && !jsonObj.get("access_key_id").isJsonNull()) && !jsonObj.get("access_key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_key_id").toString())); + } + if ((jsonObj.get("secret_access_key") != null && !jsonObj.get("secret_access_key").isJsonNull()) && !jsonObj.get("secret_access_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret_access_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret_access_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GCPInteroperabilityCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GCPInteroperabilityCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GCPInteroperabilityCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GCPInteroperabilityCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GCPInteroperabilityCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GCPInteroperabilityCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of GCPInteroperabilityCredential + * @throws IOException if the JSON string is invalid with respect to GCPInteroperabilityCredential + */ + public static GCPInteroperabilityCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GCPInteroperabilityCredential.class); + } + + /** + * Convert an instance of GCPInteroperabilityCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPServiceAccountKey.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPServiceAccountKey.java new file mode 100644 index 0000000..d65cd39 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GCPServiceAccountKey.java @@ -0,0 +1,270 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The key to a Google Cloud Platform service account. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class GCPServiceAccountKey { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "account_id"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + @javax.annotation.Nonnull + private String accountId; + + public static final String SERIALIZED_NAME_KEY_ID = "key_id"; + @SerializedName(SERIALIZED_NAME_KEY_ID) + @javax.annotation.Nonnull + private String keyId; + + public static final String SERIALIZED_NAME_KEY_TEXT = "key_text"; + @SerializedName(SERIALIZED_NAME_KEY_TEXT) + @javax.annotation.Nonnull + private String keyText; + + public GCPServiceAccountKey() { + } + + public GCPServiceAccountKey accountId(@javax.annotation.Nonnull String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The ID of the service account (i.e., its email address). This is ignored when uploading key information, and is only provided by the server when downloading metadata about an existing key. + * @return accountId + */ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + public void setAccountId(@javax.annotation.Nonnull String accountId) { + this.accountId = accountId; + } + + + public GCPServiceAccountKey keyId(@javax.annotation.Nonnull String keyId) { + this.keyId = keyId; + return this; + } + + /** + * The ID of the particular key. This identifies it among other keys issued for this service account. This is ignored when uploading key information, and is only provided by the server when downloading metadata about an existing key. + * @return keyId + */ + @javax.annotation.Nonnull + public String getKeyId() { + return keyId; + } + + public void setKeyId(@javax.annotation.Nonnull String keyId) { + this.keyId = keyId; + } + + + public GCPServiceAccountKey keyText(@javax.annotation.Nonnull String keyText) { + this.keyText = keyText; + return this; + } + + /** + * The full file provided by Google Cloud. This is usually in the form of a JSON document, but TileDB Cloud treats it as opaque (except to attempt to extract the service account ID and the key ID). + * @return keyText + */ + @javax.annotation.Nonnull + public String getKeyText() { + return keyText; + } + + public void setKeyText(@javax.annotation.Nonnull String keyText) { + this.keyText = keyText; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GCPServiceAccountKey gcPServiceAccountKey = (GCPServiceAccountKey) o; + return Objects.equals(this.accountId, gcPServiceAccountKey.accountId) && + Objects.equals(this.keyId, gcPServiceAccountKey.keyId) && + Objects.equals(this.keyText, gcPServiceAccountKey.keyText); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, keyId, keyText); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GCPServiceAccountKey {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" keyId: ").append(toIndentedString(keyId)).append("\n"); + sb.append(" keyText: ").append(toIndentedString(keyText)).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(Arrays.asList("account_id", "key_id", "key_text")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("account_id", "key_id", "key_text")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GCPServiceAccountKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GCPServiceAccountKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GCPServiceAccountKey is not found in the empty JSON string", GCPServiceAccountKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GCPServiceAccountKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GCPServiceAccountKey` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GCPServiceAccountKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("account_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `account_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account_id").toString())); + } + if (!jsonObj.get("key_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key_id").toString())); + } + if (!jsonObj.get("key_text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key_text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GCPServiceAccountKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GCPServiceAccountKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GCPServiceAccountKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GCPServiceAccountKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GCPServiceAccountKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GCPServiceAccountKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of GCPServiceAccountKey + * @throws IOException if the JSON string is invalid with respect to GCPServiceAccountKey + */ + public static GCPServiceAccountKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GCPServiceAccountKey.class); + } + + /** + * Convert an instance of GCPServiceAccountKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Generalspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Generalspace.java new file mode 100644 index 0000000..e4bccbe --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Generalspace.java @@ -0,0 +1,352 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The generalspace object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Generalspace { + public static final String SERIALIZED_NAME_GENERALSPACE_ID = "generalspace_id"; + @SerializedName(SERIALIZED_NAME_GENERALSPACE_ID) + @javax.annotation.Nonnull + private String generalspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public Generalspace() { + } + + public Generalspace generalspaceId(@javax.annotation.Nonnull String generalspaceId) { + this.generalspaceId = generalspaceId; + return this; + } + + /** + * The generalspace's ID + * @return generalspaceId + */ + @javax.annotation.Nonnull + public String getGeneralspaceId() { + return generalspaceId; + } + + public void setGeneralspaceId(@javax.annotation.Nonnull String generalspaceId) { + this.generalspaceId = generalspaceId; + } + + + public Generalspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The generalspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Generalspace icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The generalspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public Generalspace createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The datetime the generalspace was created (in UTC) + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Generalspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The generalspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Generalspace updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The datetime the generalspace was updated (in UTC) + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Generalspace generalspace = (Generalspace) o; + return Objects.equals(this.generalspaceId, generalspace.generalspaceId) && + Objects.equals(this.name, generalspace.name) && + Objects.equals(this.icon, generalspace.icon) && + Objects.equals(this.createdAt, generalspace.createdAt) && + Objects.equals(this.description, generalspace.description) && + Objects.equals(this.updatedAt, generalspace.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(generalspaceId, name, icon, createdAt, description, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Generalspace {\n"); + sb.append(" generalspaceId: ").append(toIndentedString(generalspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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(Arrays.asList("generalspace_id", "name", "icon", "created_at", "description", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("generalspace_id", "name", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Generalspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Generalspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Generalspace is not found in the empty JSON string", Generalspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Generalspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Generalspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Generalspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("generalspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `generalspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("generalspace_id").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())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Generalspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Generalspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Generalspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Generalspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Generalspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Generalspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of Generalspace + * @throws IOException if the JSON string is invalid with respect to Generalspace + */ + public static Generalspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Generalspace.class); + } + + /** + * Convert an instance of Generalspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceGetResponse.java new file mode 100644 index 0000000..33e9303 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Generalspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a generalspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class GeneralspaceGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Generalspace data; + + public GeneralspaceGetResponse() { + } + + public GeneralspaceGetResponse data(@javax.annotation.Nonnull Generalspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Generalspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Generalspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralspaceGetResponse generalspaceGetResponse = (GeneralspaceGetResponse) o; + return Objects.equals(this.data, generalspaceGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralspaceGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GeneralspaceGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GeneralspaceGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GeneralspaceGetResponse is not found in the empty JSON string", GeneralspaceGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GeneralspaceGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GeneralspaceGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GeneralspaceGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Generalspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GeneralspaceGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GeneralspaceGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GeneralspaceGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GeneralspaceGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GeneralspaceGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GeneralspaceGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GeneralspaceGetResponse + * @throws IOException if the JSON string is invalid with respect to GeneralspaceGetResponse + */ + public static GeneralspaceGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GeneralspaceGetResponse.class); + } + + /** + * Convert an instance of GeneralspaceGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceUpdateRequest.java new file mode 100644 index 0000000..00c7c81 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GeneralspaceUpdateRequest.java @@ -0,0 +1,294 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceVisibility; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a generalspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class GeneralspaceUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_VISIBILITY_LEVEL = "visibility_level"; + @SerializedName(SERIALIZED_NAME_VISIBILITY_LEVEL) + @javax.annotation.Nullable + private TeamspaceVisibility visibilityLevel; + + public GeneralspaceUpdateRequest() { + } + + public GeneralspaceUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The generalspace name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public GeneralspaceUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The generalspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public GeneralspaceUpdateRequest icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The generalspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public GeneralspaceUpdateRequest visibilityLevel(@javax.annotation.Nullable TeamspaceVisibility visibilityLevel) { + this.visibilityLevel = visibilityLevel; + return this; + } + + /** + * Get visibilityLevel + * @return visibilityLevel + */ + @javax.annotation.Nullable + public TeamspaceVisibility getVisibilityLevel() { + return visibilityLevel; + } + + public void setVisibilityLevel(@javax.annotation.Nullable TeamspaceVisibility visibilityLevel) { + this.visibilityLevel = visibilityLevel; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralspaceUpdateRequest generalspaceUpdateRequest = (GeneralspaceUpdateRequest) o; + return Objects.equals(this.name, generalspaceUpdateRequest.name) && + Objects.equals(this.description, generalspaceUpdateRequest.description) && + Objects.equals(this.icon, generalspaceUpdateRequest.icon) && + Objects.equals(this.visibilityLevel, generalspaceUpdateRequest.visibilityLevel); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, icon, visibilityLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneralspaceUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" visibilityLevel: ").append(toIndentedString(visibilityLevel)).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(Arrays.asList("name", "description", "icon", "visibility_level")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GeneralspaceUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GeneralspaceUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GeneralspaceUpdateRequest is not found in the empty JSON string", GeneralspaceUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GeneralspaceUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GeneralspaceUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + // validate the optional field `visibility_level` + if (jsonObj.get("visibility_level") != null && !jsonObj.get("visibility_level").isJsonNull()) { + TeamspaceVisibility.validateJsonElement(jsonObj.get("visibility_level")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GeneralspaceUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GeneralspaceUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GeneralspaceUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GeneralspaceUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GeneralspaceUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GeneralspaceUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GeneralspaceUpdateRequest + * @throws IOException if the JSON string is invalid with respect to GeneralspaceUpdateRequest + */ + public static GeneralspaceUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GeneralspaceUpdateRequest.class); + } + + /** + * Convert an instance of GeneralspaceUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/GroupInfo.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GroupInfo.java new file mode 100644 index 0000000..982a48d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/GroupInfo.java @@ -0,0 +1,209 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * GroupInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class GroupInfo { + public static final String SERIALIZED_NAME_LENGTH = "length"; + @SerializedName(SERIALIZED_NAME_LENGTH) + @javax.annotation.Nonnull + private Long length; + + public GroupInfo() { + } + + public GroupInfo length(@javax.annotation.Nonnull Long length) { + this.length = length; + return this; + } + + /** + * Number of items in the group. + * @return length + */ + @javax.annotation.Nonnull + public Long getLength() { + return length; + } + + public void setLength(@javax.annotation.Nonnull Long length) { + this.length = length; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupInfo groupInfo = (GroupInfo) o; + return Objects.equals(this.length, groupInfo.length); + } + + @Override + public int hashCode() { + return Objects.hash(length); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupInfo {\n"); + sb.append(" length: ").append(toIndentedString(length)).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(Arrays.asList("length")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("length")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupInfo is not found in the empty JSON string", GroupInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GroupInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupInfo + * @throws IOException if the JSON string is invalid with respect to GroupInfo + */ + public static GroupInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupInfo.class); + } + + /** + * Convert an instance of GroupInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Invitation.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Invitation.java new file mode 100644 index 0000000..26e6690 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Invitation.java @@ -0,0 +1,328 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.InvitationWorkspace; +import io.tiledb.cloud.rest_api.v4.model.InvitingUser; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The invitation object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Invitation { + public static final String SERIALIZED_NAME_INVITATION_ID = "invitation_id"; + @SerializedName(SERIALIZED_NAME_INVITATION_ID) + @javax.annotation.Nonnull + private String invitationId; + + public static final String SERIALIZED_NAME_INVITEE_EMAIL = "invitee_email"; + @SerializedName(SERIALIZED_NAME_INVITEE_EMAIL) + @javax.annotation.Nonnull + private String inviteeEmail; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private InvitingUser createdBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_WORKSPACE_INVITATION = "workspace_invitation"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_INVITATION) + @javax.annotation.Nullable + private InvitationWorkspace workspaceInvitation; + + public Invitation() { + } + + public Invitation invitationId(@javax.annotation.Nonnull String invitationId) { + this.invitationId = invitationId; + return this; + } + + /** + * The invitation's ID + * @return invitationId + */ + @javax.annotation.Nonnull + public String getInvitationId() { + return invitationId; + } + + public void setInvitationId(@javax.annotation.Nonnull String invitationId) { + this.invitationId = invitationId; + } + + + public Invitation inviteeEmail(@javax.annotation.Nonnull String inviteeEmail) { + this.inviteeEmail = inviteeEmail; + return this; + } + + /** + * The invited user's email address + * @return inviteeEmail + */ + @javax.annotation.Nonnull + public String getInviteeEmail() { + return inviteeEmail; + } + + public void setInviteeEmail(@javax.annotation.Nonnull String inviteeEmail) { + this.inviteeEmail = inviteeEmail; + } + + + public Invitation createdBy(@javax.annotation.Nonnull InvitingUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public InvitingUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull InvitingUser createdBy) { + this.createdBy = createdBy; + } + + + public Invitation createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The date and time the invitation was created + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Invitation workspaceInvitation(@javax.annotation.Nullable InvitationWorkspace workspaceInvitation) { + this.workspaceInvitation = workspaceInvitation; + return this; + } + + /** + * Get workspaceInvitation + * @return workspaceInvitation + */ + @javax.annotation.Nullable + public InvitationWorkspace getWorkspaceInvitation() { + return workspaceInvitation; + } + + public void setWorkspaceInvitation(@javax.annotation.Nullable InvitationWorkspace workspaceInvitation) { + this.workspaceInvitation = workspaceInvitation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Invitation invitation = (Invitation) o; + return Objects.equals(this.invitationId, invitation.invitationId) && + Objects.equals(this.inviteeEmail, invitation.inviteeEmail) && + Objects.equals(this.createdBy, invitation.createdBy) && + Objects.equals(this.createdAt, invitation.createdAt) && + Objects.equals(this.workspaceInvitation, invitation.workspaceInvitation); + } + + @Override + public int hashCode() { + return Objects.hash(invitationId, inviteeEmail, createdBy, createdAt, workspaceInvitation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Invitation {\n"); + sb.append(" invitationId: ").append(toIndentedString(invitationId)).append("\n"); + sb.append(" inviteeEmail: ").append(toIndentedString(inviteeEmail)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" workspaceInvitation: ").append(toIndentedString(workspaceInvitation)).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(Arrays.asList("invitation_id", "invitee_email", "created_by", "created_at", "workspace_invitation")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("invitation_id", "invitee_email", "created_by", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Invitation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Invitation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Invitation is not found in the empty JSON string", Invitation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Invitation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Invitation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Invitation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("invitation_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invitation_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitation_id").toString())); + } + if (!jsonObj.get("invitee_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invitee_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitee_email").toString())); + } + // validate the required field `created_by` + InvitingUser.validateJsonElement(jsonObj.get("created_by")); + // validate the optional field `workspace_invitation` + if (jsonObj.get("workspace_invitation") != null && !jsonObj.get("workspace_invitation").isJsonNull()) { + InvitationWorkspace.validateJsonElement(jsonObj.get("workspace_invitation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Invitation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Invitation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Invitation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Invitation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Invitation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Invitation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Invitation + * @throws IOException if the JSON string is invalid with respect to Invitation + */ + public static Invitation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Invitation.class); + } + + /** + * Convert an instance of Invitation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRespondRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRespondRequest.java new file mode 100644 index 0000000..4685311 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRespondRequest.java @@ -0,0 +1,295 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request body for responding to an invitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationRespondRequest { + public static final String SERIALIZED_NAME_JWT = "jwt"; + @SerializedName(SERIALIZED_NAME_JWT) + @javax.annotation.Nonnull + private String jwt; + + /** + * The response to the invitation + */ + @JsonAdapter(ResponseEnum.Adapter.class) + public enum ResponseEnum { + ACCEPT("accept"), + + REJECT("reject"); + + private String value; + + ResponseEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseEnum fromValue(String value) { + for (ResponseEnum b : ResponseEnum.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 ResponseEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + @javax.annotation.Nonnull + private ResponseEnum response; + + public InvitationRespondRequest() { + } + + public InvitationRespondRequest jwt(@javax.annotation.Nonnull String jwt) { + this.jwt = jwt; + return this; + } + + /** + * The JWT that authorizes the invitee to respond to the invitation + * @return jwt + */ + @javax.annotation.Nonnull + public String getJwt() { + return jwt; + } + + public void setJwt(@javax.annotation.Nonnull String jwt) { + this.jwt = jwt; + } + + + public InvitationRespondRequest response(@javax.annotation.Nonnull ResponseEnum response) { + this.response = response; + return this; + } + + /** + * The response to the invitation + * @return response + */ + @javax.annotation.Nonnull + public ResponseEnum getResponse() { + return response; + } + + public void setResponse(@javax.annotation.Nonnull ResponseEnum response) { + this.response = response; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationRespondRequest invitationRespondRequest = (InvitationRespondRequest) o; + return Objects.equals(this.jwt, invitationRespondRequest.jwt) && + Objects.equals(this.response, invitationRespondRequest.response); + } + + @Override + public int hashCode() { + return Objects.hash(jwt, response); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationRespondRequest {\n"); + sb.append(" jwt: ").append(toIndentedString(jwt)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).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(Arrays.asList("jwt", "response")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("jwt", "response")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationRespondRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationRespondRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationRespondRequest is not found in the empty JSON string", InvitationRespondRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationRespondRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationRespondRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationRespondRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("jwt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwt").toString())); + } + if (!jsonObj.get("response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); + } + // validate the required field `response` + ResponseEnum.validateJsonElement(jsonObj.get("response")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationRespondRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationRespondRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationRespondRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationRespondRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationRespondRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationRespondRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationRespondRequest + * @throws IOException if the JSON string is invalid with respect to InvitationRespondRequest + */ + public static InvitationRespondRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationRespondRequest.class); + } + + /** + * Convert an instance of InvitationRespondRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveRequest.java new file mode 100644 index 0000000..dc56ec6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request body for retrieving an invitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationRetrieveRequest { + public static final String SERIALIZED_NAME_JWT = "jwt"; + @SerializedName(SERIALIZED_NAME_JWT) + @javax.annotation.Nonnull + private String jwt; + + public InvitationRetrieveRequest() { + } + + public InvitationRetrieveRequest jwt(@javax.annotation.Nonnull String jwt) { + this.jwt = jwt; + return this; + } + + /** + * The JWT that authorizes the invitee to retrieve the invitation + * @return jwt + */ + @javax.annotation.Nonnull + public String getJwt() { + return jwt; + } + + public void setJwt(@javax.annotation.Nonnull String jwt) { + this.jwt = jwt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationRetrieveRequest invitationRetrieveRequest = (InvitationRetrieveRequest) o; + return Objects.equals(this.jwt, invitationRetrieveRequest.jwt); + } + + @Override + public int hashCode() { + return Objects.hash(jwt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationRetrieveRequest {\n"); + sb.append(" jwt: ").append(toIndentedString(jwt)).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(Arrays.asList("jwt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("jwt")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationRetrieveRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationRetrieveRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationRetrieveRequest is not found in the empty JSON string", InvitationRetrieveRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationRetrieveRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationRetrieveRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationRetrieveRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("jwt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationRetrieveRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationRetrieveRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationRetrieveRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationRetrieveRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationRetrieveRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationRetrieveRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationRetrieveRequest + * @throws IOException if the JSON string is invalid with respect to InvitationRetrieveRequest + */ + public static InvitationRetrieveRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationRetrieveRequest.class); + } + + /** + * Convert an instance of InvitationRetrieveRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveResponse.java new file mode 100644 index 0000000..6137388 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationRetrieveResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Invitation; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when retrieving an invitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationRetrieveResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Invitation data; + + public InvitationRetrieveResponse() { + } + + public InvitationRetrieveResponse data(@javax.annotation.Nonnull Invitation data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Invitation getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Invitation data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationRetrieveResponse invitationRetrieveResponse = (InvitationRetrieveResponse) o; + return Objects.equals(this.data, invitationRetrieveResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationRetrieveResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationRetrieveResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationRetrieveResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationRetrieveResponse is not found in the empty JSON string", InvitationRetrieveResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationRetrieveResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationRetrieveResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationRetrieveResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Invitation.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationRetrieveResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationRetrieveResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationRetrieveResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationRetrieveResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationRetrieveResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationRetrieveResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationRetrieveResponse + * @throws IOException if the JSON string is invalid with respect to InvitationRetrieveResponse + */ + public static InvitationRetrieveResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationRetrieveResponse.class); + } + + /** + * Convert an instance of InvitationRetrieveResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationWorkspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationWorkspace.java new file mode 100644 index 0000000..472d88d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationWorkspace.java @@ -0,0 +1,328 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * InvitationWorkspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationWorkspace { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_PROSPECTIVE_ROLE = "prospective_role"; + @SerializedName(SERIALIZED_NAME_PROSPECTIVE_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole prospectiveRole; + + public InvitationWorkspace() { + } + + public InvitationWorkspace workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public InvitationWorkspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The workspace's name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public InvitationWorkspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The workspace's description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public InvitationWorkspace imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public InvitationWorkspace prospectiveRole(@javax.annotation.Nonnull WorkspaceRole prospectiveRole) { + this.prospectiveRole = prospectiveRole; + return this; + } + + /** + * Get prospectiveRole + * @return prospectiveRole + */ + @javax.annotation.Nonnull + public WorkspaceRole getProspectiveRole() { + return prospectiveRole; + } + + public void setProspectiveRole(@javax.annotation.Nonnull WorkspaceRole prospectiveRole) { + this.prospectiveRole = prospectiveRole; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationWorkspace invitationWorkspace = (InvitationWorkspace) o; + return Objects.equals(this.workspaceId, invitationWorkspace.workspaceId) && + Objects.equals(this.name, invitationWorkspace.name) && + Objects.equals(this.description, invitationWorkspace.description) && + Objects.equals(this.imageId, invitationWorkspace.imageId) && + Objects.equals(this.prospectiveRole, invitationWorkspace.prospectiveRole); + } + + @Override + public int hashCode() { + return Objects.hash(workspaceId, name, description, imageId, prospectiveRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationWorkspace {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" prospectiveRole: ").append(toIndentedString(prospectiveRole)).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(Arrays.asList("workspace_id", "name", "description", "image_id", "prospective_role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("workspace_id", "name", "prospective_role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationWorkspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationWorkspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationWorkspace is not found in the empty JSON string", InvitationWorkspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationWorkspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationWorkspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationWorkspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").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())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + // validate the required field `prospective_role` + WorkspaceRole.validateJsonElement(jsonObj.get("prospective_role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationWorkspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationWorkspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationWorkspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationWorkspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationWorkspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationWorkspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationWorkspace + * @throws IOException if the JSON string is invalid with respect to InvitationWorkspace + */ + public static InvitationWorkspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationWorkspace.class); + } + + /** + * Convert an instance of InvitationWorkspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestInner.java new file mode 100644 index 0000000..6ff2dc5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestInner.java @@ -0,0 +1,243 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.InvitationsCreateRequestWorkspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The invitations to create + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationsCreateRequestInner { + public static final String SERIALIZED_NAME_INVITEE_EMAIL = "invitee_email"; + @SerializedName(SERIALIZED_NAME_INVITEE_EMAIL) + @javax.annotation.Nonnull + private String inviteeEmail; + + public static final String SERIALIZED_NAME_WORKSPACE_INVITATION = "workspace_invitation"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_INVITATION) + @javax.annotation.Nullable + private InvitationsCreateRequestWorkspace workspaceInvitation; + + public InvitationsCreateRequestInner() { + } + + public InvitationsCreateRequestInner inviteeEmail(@javax.annotation.Nonnull String inviteeEmail) { + this.inviteeEmail = inviteeEmail; + return this; + } + + /** + * The invited user's email address + * @return inviteeEmail + */ + @javax.annotation.Nonnull + public String getInviteeEmail() { + return inviteeEmail; + } + + public void setInviteeEmail(@javax.annotation.Nonnull String inviteeEmail) { + this.inviteeEmail = inviteeEmail; + } + + + public InvitationsCreateRequestInner workspaceInvitation(@javax.annotation.Nullable InvitationsCreateRequestWorkspace workspaceInvitation) { + this.workspaceInvitation = workspaceInvitation; + return this; + } + + /** + * Get workspaceInvitation + * @return workspaceInvitation + */ + @javax.annotation.Nullable + public InvitationsCreateRequestWorkspace getWorkspaceInvitation() { + return workspaceInvitation; + } + + public void setWorkspaceInvitation(@javax.annotation.Nullable InvitationsCreateRequestWorkspace workspaceInvitation) { + this.workspaceInvitation = workspaceInvitation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationsCreateRequestInner invitationsCreateRequestInner = (InvitationsCreateRequestInner) o; + return Objects.equals(this.inviteeEmail, invitationsCreateRequestInner.inviteeEmail) && + Objects.equals(this.workspaceInvitation, invitationsCreateRequestInner.workspaceInvitation); + } + + @Override + public int hashCode() { + return Objects.hash(inviteeEmail, workspaceInvitation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationsCreateRequestInner {\n"); + sb.append(" inviteeEmail: ").append(toIndentedString(inviteeEmail)).append("\n"); + sb.append(" workspaceInvitation: ").append(toIndentedString(workspaceInvitation)).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(Arrays.asList("invitee_email", "workspace_invitation")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("invitee_email")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationsCreateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationsCreateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationsCreateRequestInner is not found in the empty JSON string", InvitationsCreateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationsCreateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationsCreateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationsCreateRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("invitee_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invitee_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invitee_email").toString())); + } + // validate the optional field `workspace_invitation` + if (jsonObj.get("workspace_invitation") != null && !jsonObj.get("workspace_invitation").isJsonNull()) { + InvitationsCreateRequestWorkspace.validateJsonElement(jsonObj.get("workspace_invitation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationsCreateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationsCreateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationsCreateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationsCreateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationsCreateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationsCreateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationsCreateRequestInner + * @throws IOException if the JSON string is invalid with respect to InvitationsCreateRequestInner + */ + public static InvitationsCreateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationsCreateRequestInner.class); + } + + /** + * Convert an instance of InvitationsCreateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestWorkspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestWorkspace.java new file mode 100644 index 0000000..4a0bdf5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsCreateRequestWorkspace.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * InvitationsCreateRequestWorkspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationsCreateRequestWorkspace { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_PROSPECTIVE_ROLE = "prospective_role"; + @SerializedName(SERIALIZED_NAME_PROSPECTIVE_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole prospectiveRole; + + public InvitationsCreateRequestWorkspace() { + } + + public InvitationsCreateRequestWorkspace workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public InvitationsCreateRequestWorkspace prospectiveRole(@javax.annotation.Nonnull WorkspaceRole prospectiveRole) { + this.prospectiveRole = prospectiveRole; + return this; + } + + /** + * Get prospectiveRole + * @return prospectiveRole + */ + @javax.annotation.Nonnull + public WorkspaceRole getProspectiveRole() { + return prospectiveRole; + } + + public void setProspectiveRole(@javax.annotation.Nonnull WorkspaceRole prospectiveRole) { + this.prospectiveRole = prospectiveRole; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationsCreateRequestWorkspace invitationsCreateRequestWorkspace = (InvitationsCreateRequestWorkspace) o; + return Objects.equals(this.workspaceId, invitationsCreateRequestWorkspace.workspaceId) && + Objects.equals(this.prospectiveRole, invitationsCreateRequestWorkspace.prospectiveRole); + } + + @Override + public int hashCode() { + return Objects.hash(workspaceId, prospectiveRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationsCreateRequestWorkspace {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" prospectiveRole: ").append(toIndentedString(prospectiveRole)).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(Arrays.asList("workspace_id", "prospective_role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("workspace_id", "prospective_role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationsCreateRequestWorkspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationsCreateRequestWorkspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationsCreateRequestWorkspace is not found in the empty JSON string", InvitationsCreateRequestWorkspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationsCreateRequestWorkspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationsCreateRequestWorkspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationsCreateRequestWorkspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + // validate the required field `prospective_role` + WorkspaceRole.validateJsonElement(jsonObj.get("prospective_role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationsCreateRequestWorkspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationsCreateRequestWorkspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationsCreateRequestWorkspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationsCreateRequestWorkspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationsCreateRequestWorkspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationsCreateRequestWorkspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationsCreateRequestWorkspace + * @throws IOException if the JSON string is invalid with respect to InvitationsCreateRequestWorkspace + */ + public static InvitationsCreateRequestWorkspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationsCreateRequestWorkspace.class); + } + + /** + * Convert an instance of InvitationsCreateRequestWorkspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsListResponse.java new file mode 100644 index 0000000..5f4f19b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitationsListResponse.java @@ -0,0 +1,261 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Invitation; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting all invitations + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitationsListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nullable + private PaginationMetadata paginationMetadata; + + public InvitationsListResponse() { + } + + public InvitationsListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public InvitationsListResponse addDataItem(Invitation dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of invitations for the user + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public InvitationsListResponse paginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nullable + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationsListResponse invitationsListResponse = (InvitationsListResponse) o; + return Objects.equals(this.data, invitationsListResponse.data) && + Objects.equals(this.paginationMetadata, invitationsListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationsListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitationsListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationsListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationsListResponse is not found in the empty JSON string", InvitationsListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationsListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationsListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitationsListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Invitation.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `pagination_metadata` + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitationsListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationsListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationsListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitationsListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitationsListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationsListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationsListResponse + * @throws IOException if the JSON string is invalid with respect to InvitationsListResponse + */ + public static InvitationsListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationsListResponse.class); + } + + /** + * Convert an instance of InvitationsListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitingUser.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitingUser.java new file mode 100644 index 0000000..2351243 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/InvitingUser.java @@ -0,0 +1,328 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The user who sent the invitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class InvitingUser { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_WORKSPACE_ROLE = "workspace_role"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole workspaceRole; + + public InvitingUser() { + } + + public InvitingUser userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public InvitingUser displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The user's display name + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public InvitingUser email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The user's email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public InvitingUser imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public InvitingUser workspaceRole(@javax.annotation.Nonnull WorkspaceRole workspaceRole) { + this.workspaceRole = workspaceRole; + return this; + } + + /** + * Get workspaceRole + * @return workspaceRole + */ + @javax.annotation.Nonnull + public WorkspaceRole getWorkspaceRole() { + return workspaceRole; + } + + public void setWorkspaceRole(@javax.annotation.Nonnull WorkspaceRole workspaceRole) { + this.workspaceRole = workspaceRole; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitingUser invitingUser = (InvitingUser) o; + return Objects.equals(this.userId, invitingUser.userId) && + Objects.equals(this.displayName, invitingUser.displayName) && + Objects.equals(this.email, invitingUser.email) && + Objects.equals(this.imageId, invitingUser.imageId) && + Objects.equals(this.workspaceRole, invitingUser.workspaceRole); + } + + @Override + public int hashCode() { + return Objects.hash(userId, displayName, email, imageId, workspaceRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitingUser {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" workspaceRole: ").append(toIndentedString(workspaceRole)).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(Arrays.asList("user_id", "display_name", "email", "image_id", "workspace_role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "display_name", "email", "workspace_role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitingUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitingUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitingUser is not found in the empty JSON string", InvitingUser.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitingUser.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitingUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitingUser.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + if (!jsonObj.get("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + // validate the required field `workspace_role` + WorkspaceRole.validateJsonElement(jsonObj.get("workspace_role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitingUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitingUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitingUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitingUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitingUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitingUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitingUser + * @throws IOException if the JSON string is invalid with respect to InvitingUser + */ + public static InvitingUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitingUser.class); + } + + /** + * Convert an instance of InvitingUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Item.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Item.java new file mode 100644 index 0000000..87af83c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Item.java @@ -0,0 +1,102 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * List of values that Item can take. + */ +@JsonAdapter(Item.Adapter.class) +public enum Item { + + THEME_SELECTION("theme_selection"), + + PROFILE_INFO("profile_info"), + + CLAIM_CREDITS("claim_credits"), + + CLOUD_STORAGE("cloud_storage"), + + ROOT_PATH("root_path"), + + INTRO("intro"), + + BASIC_TOUR("basic_tour"), + + SKIP_USER_ONBOARDING("skip_user_onboarding"), + + ADD_ASSET("add_asset"), + + LAUNCH_NOTEBOOK("launch_notebook"), + + INDICATE_FINISH_USER_ONBOARDING("indicate_finish_user_onboarding"), + + ORGANIZATION_BASIC_TOUR("organization_basic_tour"), + + INDICATE_FINISH_ORG_ONBOARDING("indicate_finish_org_onboarding"), + + SKIP_ORGANIZATION_ONBOARDING("skip_organization_onboarding"); + + private String value; + + Item(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Item fromValue(String value) { + for (Item b : Item.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 Item enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Item read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Item.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Item.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemaTablesResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemaTablesResponse.java new file mode 100644 index 0000000..187c57b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemaTablesResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TableItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Listing of delta share schema tables + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ListShareSchemaTablesResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE_TOKEN = "nextPageToken"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE_TOKEN) + @javax.annotation.Nullable + private String nextPageToken; + + public ListShareSchemaTablesResponse() { + } + + public ListShareSchemaTablesResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ListShareSchemaTablesResponse addItemsItem(TableItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * The items in the list + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + + public ListShareSchemaTablesResponse nextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + /** + * The next page token + * @return nextPageToken + */ + @javax.annotation.Nullable + public String getNextPageToken() { + return nextPageToken; + } + + public void setNextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListShareSchemaTablesResponse listShareSchemaTablesResponse = (ListShareSchemaTablesResponse) o; + return Objects.equals(this.items, listShareSchemaTablesResponse.items) && + Objects.equals(this.nextPageToken, listShareSchemaTablesResponse.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(items, nextPageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListShareSchemaTablesResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" nextPageToken: ").append(toIndentedString(nextPageToken)).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(Arrays.asList("items", "nextPageToken")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListShareSchemaTablesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListShareSchemaTablesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListShareSchemaTablesResponse is not found in the empty JSON string", ListShareSchemaTablesResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListShareSchemaTablesResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListShareSchemaTablesResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListShareSchemaTablesResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + TableItem.validateJsonElement(jsonArrayitems.get(i)); + }; + if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPageToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPageToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListShareSchemaTablesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListShareSchemaTablesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListShareSchemaTablesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListShareSchemaTablesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListShareSchemaTablesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListShareSchemaTablesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListShareSchemaTablesResponse + * @throws IOException if the JSON string is invalid with respect to ListShareSchemaTablesResponse + */ + public static ListShareSchemaTablesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListShareSchemaTablesResponse.class); + } + + /** + * Convert an instance of ListShareSchemaTablesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemasResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemasResponse.java new file mode 100644 index 0000000..9991e79 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListShareSchemasResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Listing of delta shares + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ListShareSchemasResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE_TOKEN = "nextPageToken"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE_TOKEN) + @javax.annotation.Nullable + private String nextPageToken; + + public ListShareSchemasResponse() { + } + + public ListShareSchemasResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ListShareSchemasResponse addItemsItem(SchemaItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * The items in the list + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + + public ListShareSchemasResponse nextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + /** + * The next page token + * @return nextPageToken + */ + @javax.annotation.Nullable + public String getNextPageToken() { + return nextPageToken; + } + + public void setNextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListShareSchemasResponse listShareSchemasResponse = (ListShareSchemasResponse) o; + return Objects.equals(this.items, listShareSchemasResponse.items) && + Objects.equals(this.nextPageToken, listShareSchemasResponse.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(items, nextPageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListShareSchemasResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" nextPageToken: ").append(toIndentedString(nextPageToken)).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(Arrays.asList("items", "nextPageToken")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListShareSchemasResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListShareSchemasResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListShareSchemasResponse is not found in the empty JSON string", ListShareSchemasResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListShareSchemasResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListShareSchemasResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListShareSchemasResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SchemaItem.validateJsonElement(jsonArrayitems.get(i)); + }; + if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPageToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPageToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListShareSchemasResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListShareSchemasResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListShareSchemasResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListShareSchemasResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListShareSchemasResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListShareSchemasResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListShareSchemasResponse + * @throws IOException if the JSON string is invalid with respect to ListShareSchemasResponse + */ + public static ListShareSchemasResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListShareSchemasResponse.class); + } + + /** + * Convert an instance of ListShareSchemasResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListSharesResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListSharesResponse.java new file mode 100644 index 0000000..864125b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListSharesResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.ShareItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Listing of delta shares + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ListSharesResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE_TOKEN = "nextPageToken"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE_TOKEN) + @javax.annotation.Nullable + private String nextPageToken; + + public ListSharesResponse() { + } + + public ListSharesResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ListSharesResponse addItemsItem(ShareItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * The items in the list + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + + public ListSharesResponse nextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + /** + * The next page token + * @return nextPageToken + */ + @javax.annotation.Nullable + public String getNextPageToken() { + return nextPageToken; + } + + public void setNextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSharesResponse listSharesResponse = (ListSharesResponse) o; + return Objects.equals(this.items, listSharesResponse.items) && + Objects.equals(this.nextPageToken, listSharesResponse.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(items, nextPageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSharesResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" nextPageToken: ").append(toIndentedString(nextPageToken)).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(Arrays.asList("items", "nextPageToken")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListSharesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListSharesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListSharesResponse is not found in the empty JSON string", ListSharesResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListSharesResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListSharesResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListSharesResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + ShareItem.validateJsonElement(jsonArrayitems.get(i)); + }; + if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPageToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPageToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListSharesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListSharesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListSharesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListSharesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListSharesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListSharesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListSharesResponse + * @throws IOException if the JSON string is invalid with respect to ListSharesResponse + */ + public static ListSharesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListSharesResponse.class); + } + + /** + * Convert an instance of ListSharesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListTablesResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListTablesResponse.java new file mode 100644 index 0000000..91b0598 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ListTablesResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TableItem; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Listing of delta share schema tables + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ListTablesResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_PAGE_TOKEN = "nextPageToken"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE_TOKEN) + @javax.annotation.Nullable + private String nextPageToken; + + public ListTablesResponse() { + } + + public ListTablesResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ListTablesResponse addItemsItem(TableItem itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * The items in the list + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + + public ListTablesResponse nextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + /** + * The next page token + * @return nextPageToken + */ + @javax.annotation.Nullable + public String getNextPageToken() { + return nextPageToken; + } + + public void setNextPageToken(@javax.annotation.Nullable String nextPageToken) { + this.nextPageToken = nextPageToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTablesResponse listTablesResponse = (ListTablesResponse) o; + return Objects.equals(this.items, listTablesResponse.items) && + Objects.equals(this.nextPageToken, listTablesResponse.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(items, nextPageToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTablesResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" nextPageToken: ").append(toIndentedString(nextPageToken)).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(Arrays.asList("items", "nextPageToken")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListTablesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListTablesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListTablesResponse is not found in the empty JSON string", ListTablesResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListTablesResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListTablesResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTablesResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + TableItem.validateJsonElement(jsonArrayitems.get(i)); + }; + if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPageToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPageToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTablesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTablesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListTablesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTablesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTablesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListTablesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTablesResponse + * @throws IOException if the JSON string is invalid with respect to ListTablesResponse + */ + public static ListTablesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTablesResponse.class); + } + + /** + * Convert an instance of ListTablesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Metadata.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Metadata.java new file mode 100644 index 0000000..8b96c8b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Metadata.java @@ -0,0 +1,514 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Format; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table metadata object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Metadata { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_FORMAT = "format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + @javax.annotation.Nonnull + private Format format; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + @javax.annotation.Nullable + private Schema schema; + + public static final String SERIALIZED_NAME_SCHEMA_STRING = "schemaString"; + @SerializedName(SERIALIZED_NAME_SCHEMA_STRING) + @javax.annotation.Nonnull + private String schemaString; + + public static final String SERIALIZED_NAME_PARTITION_COLUMNS = "partitionColumns"; + @SerializedName(SERIALIZED_NAME_PARTITION_COLUMNS) + @javax.annotation.Nonnull + private List partitionColumns = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONFIGURATION = "configuration"; + @SerializedName(SERIALIZED_NAME_CONFIGURATION) + @javax.annotation.Nullable + private Map _configuration = new HashMap<>(); + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Integer size; + + public static final String SERIALIZED_NAME_NUM_FILES = "numFiles"; + @SerializedName(SERIALIZED_NAME_NUM_FILES) + @javax.annotation.Nullable + private Integer numFiles; + + public Metadata() { + } + + public Metadata id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this table + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public Metadata name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * User-provided identifier for this table + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public Metadata description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * User-provided description for this table + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Metadata format(@javax.annotation.Nonnull Format format) { + this.format = format; + return this; + } + + /** + * Get format + * @return format + */ + @javax.annotation.Nonnull + public Format getFormat() { + return format; + } + + public void setFormat(@javax.annotation.Nonnull Format format) { + this.format = format; + } + + + public Metadata schema(@javax.annotation.Nullable Schema schema) { + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + */ + @javax.annotation.Nullable + public Schema getSchema() { + return schema; + } + + public void setSchema(@javax.annotation.Nullable Schema schema) { + this.schema = schema; + } + + + public Metadata schemaString(@javax.annotation.Nonnull String schemaString) { + this.schemaString = schemaString; + return this; + } + + /** + * Schema of the table. This is a serialized JSON string which can be deserialized to a Schema Object. + * @return schemaString + */ + @javax.annotation.Nonnull + public String getSchemaString() { + return schemaString; + } + + public void setSchemaString(@javax.annotation.Nonnull String schemaString) { + this.schemaString = schemaString; + } + + + public Metadata partitionColumns(@javax.annotation.Nonnull List partitionColumns) { + this.partitionColumns = partitionColumns; + return this; + } + + public Metadata addPartitionColumnsItem(String partitionColumnsItem) { + if (this.partitionColumns == null) { + this.partitionColumns = new ArrayList<>(); + } + this.partitionColumns.add(partitionColumnsItem); + return this; + } + + /** + * An array containing the names of columns by which the data should be partitioned. When a table doesn’t have partition columns, this will be an empty array. + * @return partitionColumns + */ + @javax.annotation.Nonnull + public List getPartitionColumns() { + return partitionColumns; + } + + public void setPartitionColumns(@javax.annotation.Nonnull List partitionColumns) { + this.partitionColumns = partitionColumns; + } + + + public Metadata _configuration(@javax.annotation.Nullable Map _configuration) { + this._configuration = _configuration; + return this; + } + + public Metadata putConfigurationItem(String key, Object _configurationItem) { + if (this._configuration == null) { + this._configuration = new HashMap<>(); + } + this._configuration.put(key, _configurationItem); + return this; + } + + /** + * A map containing configuration options for the table + * @return _configuration + */ + @javax.annotation.Nullable + public Map getConfiguration() { + return _configuration; + } + + public void setConfiguration(@javax.annotation.Nullable Map _configuration) { + this._configuration = _configuration; + } + + + public Metadata version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * The table version the metadata corresponds to, returned when querying table data with a version or timestamp parameter, or cdf query with includeHistoricalMetadata set to true. + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public Metadata size(@javax.annotation.Nullable Integer size) { + this.size = size; + return this; + } + + /** + * The size of the table in bytes, will be returned if available in the delta log. + * @return size + */ + @javax.annotation.Nullable + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Integer size) { + this.size = size; + } + + + public Metadata numFiles(@javax.annotation.Nullable Integer numFiles) { + this.numFiles = numFiles; + return this; + } + + /** + * The number of files in the table, will be returned if available in the delta log. + * @return numFiles + */ + @javax.annotation.Nullable + public Integer getNumFiles() { + return numFiles; + } + + public void setNumFiles(@javax.annotation.Nullable Integer numFiles) { + this.numFiles = numFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Metadata metadata = (Metadata) o; + return Objects.equals(this.id, metadata.id) && + Objects.equals(this.name, metadata.name) && + Objects.equals(this.description, metadata.description) && + Objects.equals(this.format, metadata.format) && + Objects.equals(this.schema, metadata.schema) && + Objects.equals(this.schemaString, metadata.schemaString) && + Objects.equals(this.partitionColumns, metadata.partitionColumns) && + Objects.equals(this._configuration, metadata._configuration) && + Objects.equals(this.version, metadata.version) && + Objects.equals(this.size, metadata.size) && + Objects.equals(this.numFiles, metadata.numFiles); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, format, schema, schemaString, partitionColumns, _configuration, version, size, numFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Metadata {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" schemaString: ").append(toIndentedString(schemaString)).append("\n"); + sb.append(" partitionColumns: ").append(toIndentedString(partitionColumns)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" numFiles: ").append(toIndentedString(numFiles)).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(Arrays.asList("id", "name", "description", "format", "schema", "schemaString", "partitionColumns", "configuration", "version", "size", "numFiles")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "format", "schemaString", "partitionColumns")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Metadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Metadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Metadata is not found in the empty JSON string", Metadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Metadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Metadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Metadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the required field `format` + Format.validateJsonElement(jsonObj.get("format")); + // validate the optional field `schema` + if (jsonObj.get("schema") != null && !jsonObj.get("schema").isJsonNull()) { + Schema.validateJsonElement(jsonObj.get("schema")); + } + if (!jsonObj.get("schemaString").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `schemaString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("schemaString").toString())); + } + // ensure the required json array is present + if (jsonObj.get("partitionColumns") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("partitionColumns").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `partitionColumns` to be an array in the JSON string but got `%s`", jsonObj.get("partitionColumns").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Metadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Metadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Metadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Metadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Metadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Metadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of Metadata + * @throws IOException if the JSON string is invalid with respect to Metadata + */ + public static Metadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Metadata.class); + } + + /** + * Convert an instance of Metadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelFile.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelFile.java new file mode 100644 index 0000000..a9b2c6d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelFile.java @@ -0,0 +1,410 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table file object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ModelFile { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_PARTITION_VALUES = "partitionValues"; + @SerializedName(SERIALIZED_NAME_PARTITION_VALUES) + @javax.annotation.Nonnull + private Map partitionValues = new HashMap<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Integer size; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nullable + private Integer timestamp; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + @javax.annotation.Nullable + private String stats; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nullable + private Integer expirationTimestamp; + + public ModelFile() { + } + + public ModelFile url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * An https url that a client can use to read the file directly. The same file in different responses may have different urls. + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + + public ModelFile id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * A unique string for the file in a table. The same file is guaranteed to have the same id across multiple requests. A client may cache the file content and use this id as a key to decide whether to use the cached file content. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public ModelFile partitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + return this; + } + + public ModelFile putPartitionValuesItem(String key, Object partitionValuesItem) { + if (this.partitionValues == null) { + this.partitionValues = new HashMap<>(); + } + this.partitionValues.put(key, partitionValuesItem); + return this; + } + + /** + * A map from partition column to value for this file. See Partition Value Serialization for how to parse the partition values. When the table doesn't have partition columns, this will be an empty map. + * @return partitionValues + */ + @javax.annotation.Nonnull + public Map getPartitionValues() { + return partitionValues; + } + + public void setPartitionValues(@javax.annotation.Nonnull Map partitionValues) { + this.partitionValues = partitionValues; + } + + + public ModelFile size(@javax.annotation.Nonnull Integer size) { + this.size = size; + return this; + } + + /** + * The size of this file in bytes. + * @return size + */ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Integer size) { + this.size = size; + } + + + public ModelFile timestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * The timestamp of the file in milliseconds from epoch. + * @return timestamp + */ + @javax.annotation.Nullable + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nullable Integer timestamp) { + this.timestamp = timestamp; + } + + + public ModelFile version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * The table version of this file. + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public ModelFile stats(@javax.annotation.Nullable String stats) { + this.stats = stats; + return this; + } + + /** + * Contains statistics (e.g., count, min/max values for columns) about the data in this file. This field may be missing. A file may or may not have stats. This is a serialized JSON string which can be deserialized to a Statistics Struct. A client can decide whether to use stats or drop it. + * @return stats + */ + @javax.annotation.Nullable + public String getStats() { + return stats; + } + + public void setStats(@javax.annotation.Nullable String stats) { + this.stats = stats; + } + + + public ModelFile expirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The unix timestamp corresponding to the expiration of the url, in milliseconds, returned when the server supports the feature. + * @return expirationTimestamp + */ + @javax.annotation.Nullable + public Integer getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nullable Integer expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.url, _file.url) && + Objects.equals(this.id, _file.id) && + Objects.equals(this.partitionValues, _file.partitionValues) && + Objects.equals(this.size, _file.size) && + Objects.equals(this.timestamp, _file.timestamp) && + Objects.equals(this.version, _file.version) && + Objects.equals(this.stats, _file.stats) && + Objects.equals(this.expirationTimestamp, _file.expirationTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(url, id, partitionValues, size, timestamp, version, stats, expirationTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" partitionValues: ").append(toIndentedString(partitionValues)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).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(Arrays.asList("url", "id", "partitionValues", "size", "timestamp", "version", "stats", "expirationTimestamp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url", "id", "partitionValues", "size")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelFile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ModelFile.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").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("stats") != null && !jsonObj.get("stats").isJsonNull()) && !jsonObj.get("stats").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelObject.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelObject.java new file mode 100644 index 0000000..5d8679e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ModelObject.java @@ -0,0 +1,289 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Description of a TileDB file. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ModelObject { + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_LAST_MODIFIED = "LastModified"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED) + @javax.annotation.Nullable + private String lastModified; + + public static final String SERIALIZED_NAME_ETAG = "ETag"; + @SerializedName(SERIALIZED_NAME_ETAG) + @javax.annotation.Nullable + private String etag; + + public static final String SERIALIZED_NAME_SIZE = "Size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Long size; + + public ModelObject() { + } + + public ModelObject key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * The path to the file + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public ModelObject lastModified(@javax.annotation.Nullable String lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * The date the file was last modified + * @return lastModified + */ + @javax.annotation.Nullable + public String getLastModified() { + return lastModified; + } + + public void setLastModified(@javax.annotation.Nullable String lastModified) { + this.lastModified = lastModified; + } + + + public ModelObject etag(@javax.annotation.Nullable String etag) { + this.etag = etag; + return this; + } + + /** + * The file's ETag + * @return etag + */ + @javax.annotation.Nullable + public String getEtag() { + return etag; + } + + public void setEtag(@javax.annotation.Nullable String etag) { + this.etag = etag; + } + + + public ModelObject size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * The file's size + * @return size + */ + @javax.annotation.Nullable + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelObject _object = (ModelObject) o; + return Objects.equals(this.key, _object.key) && + Objects.equals(this.lastModified, _object.lastModified) && + Objects.equals(this.etag, _object.etag) && + Objects.equals(this.size, _object.size); + } + + @Override + public int hashCode() { + return Objects.hash(key, lastModified, etag, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelObject {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" lastModified: ").append(toIndentedString(lastModified)).append("\n"); + sb.append(" etag: ").append(toIndentedString(etag)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).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(Arrays.asList("Key", "LastModified", "ETag", "Size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelObject is not found in the empty JSON string", ModelObject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ModelObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelObject` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("LastModified") != null && !jsonObj.get("LastModified").isJsonNull()) && !jsonObj.get("LastModified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastModified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastModified").toString())); + } + if ((jsonObj.get("ETag") != null && !jsonObj.get("ETag").isJsonNull()) && !jsonObj.get("ETag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ETag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ETag").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelObject + * @throws IOException if the JSON string is invalid with respect to ModelObject + */ + public static ModelObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelObject.class); + } + + /** + * Convert an instance of ModelObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponse.java new file mode 100644 index 0000000..45482ab --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.OnboardingGetItemsResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get items response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class OnboardingGetItemsResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private OnboardingGetItemsResponseData data; + + public OnboardingGetItemsResponse() { + } + + public OnboardingGetItemsResponse data(@javax.annotation.Nonnull OnboardingGetItemsResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public OnboardingGetItemsResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull OnboardingGetItemsResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnboardingGetItemsResponse onboardingGetItemsResponse = (OnboardingGetItemsResponse) o; + return Objects.equals(this.data, onboardingGetItemsResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnboardingGetItemsResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnboardingGetItemsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnboardingGetItemsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnboardingGetItemsResponse is not found in the empty JSON string", OnboardingGetItemsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnboardingGetItemsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingGetItemsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnboardingGetItemsResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + OnboardingGetItemsResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnboardingGetItemsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnboardingGetItemsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnboardingGetItemsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnboardingGetItemsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnboardingGetItemsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnboardingGetItemsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnboardingGetItemsResponse + * @throws IOException if the JSON string is invalid with respect to OnboardingGetItemsResponse + */ + public static OnboardingGetItemsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnboardingGetItemsResponse.class); + } + + /** + * Convert an instance of OnboardingGetItemsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponseData.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponseData.java new file mode 100644 index 0000000..a10c2bd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingGetItemsResponseData.java @@ -0,0 +1,226 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Item; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * user's onboarding items + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class OnboardingGetItemsResponseData { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + @javax.annotation.Nonnull + private List entries = new ArrayList<>(); + + public OnboardingGetItemsResponseData() { + } + + public OnboardingGetItemsResponseData entries(@javax.annotation.Nonnull List entries) { + this.entries = entries; + return this; + } + + public OnboardingGetItemsResponseData addEntriesItem(Item entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of onboarding items + * @return entries + */ + @javax.annotation.Nonnull + public List getEntries() { + return entries; + } + + public void setEntries(@javax.annotation.Nonnull List entries) { + this.entries = entries; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnboardingGetItemsResponseData onboardingGetItemsResponseData = (OnboardingGetItemsResponseData) o; + return Objects.equals(this.entries, onboardingGetItemsResponseData.entries); + } + + @Override + public int hashCode() { + return Objects.hash(entries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnboardingGetItemsResponseData {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).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(Arrays.asList("entries")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("entries")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnboardingGetItemsResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnboardingGetItemsResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnboardingGetItemsResponseData is not found in the empty JSON string", OnboardingGetItemsResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnboardingGetItemsResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingGetItemsResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnboardingGetItemsResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("entries") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `entries` to be an array in the JSON string but got `%s`", jsonObj.get("entries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnboardingGetItemsResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnboardingGetItemsResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnboardingGetItemsResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnboardingGetItemsResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnboardingGetItemsResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnboardingGetItemsResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnboardingGetItemsResponseData + * @throws IOException if the JSON string is invalid with respect to OnboardingGetItemsResponseData + */ + public static OnboardingGetItemsResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnboardingGetItemsResponseData.class); + } + + /** + * Convert an instance of OnboardingGetItemsResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingSetItemsRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingSetItemsRequest.java new file mode 100644 index 0000000..279daac --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/OnboardingSetItemsRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.OnboardingGetItemsResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get items response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class OnboardingSetItemsRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private OnboardingGetItemsResponseData data; + + public OnboardingSetItemsRequest() { + } + + public OnboardingSetItemsRequest data(@javax.annotation.Nonnull OnboardingGetItemsResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public OnboardingGetItemsResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull OnboardingGetItemsResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnboardingSetItemsRequest onboardingSetItemsRequest = (OnboardingSetItemsRequest) o; + return Objects.equals(this.data, onboardingSetItemsRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnboardingSetItemsRequest {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnboardingSetItemsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnboardingSetItemsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnboardingSetItemsRequest is not found in the empty JSON string", OnboardingSetItemsRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnboardingSetItemsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingSetItemsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnboardingSetItemsRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + OnboardingGetItemsResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnboardingSetItemsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnboardingSetItemsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnboardingSetItemsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnboardingSetItemsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnboardingSetItemsRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnboardingSetItemsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnboardingSetItemsRequest + * @throws IOException if the JSON string is invalid with respect to OnboardingSetItemsRequest + */ + public static OnboardingSetItemsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnboardingSetItemsRequest.class); + } + + /** + * Convert an instance of OnboardingSetItemsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/PaginationMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/PaginationMetadata.java new file mode 100644 index 0000000..db060e4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/PaginationMetadata.java @@ -0,0 +1,287 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Pagination metadata object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class PaginationMetadata { + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + @javax.annotation.Nonnull + private Integer page; + + public static final String SERIALIZED_NAME_PER_PAGE = "per_page"; + @SerializedName(SERIALIZED_NAME_PER_PAGE) + @javax.annotation.Nonnull + private Integer perPage; + + public static final String SERIALIZED_NAME_TOTAL_PAGES = "total_pages"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + @javax.annotation.Nonnull + private Integer totalPages; + + public static final String SERIALIZED_NAME_TOTAL_ITEMS = "total_items"; + @SerializedName(SERIALIZED_NAME_TOTAL_ITEMS) + @javax.annotation.Nonnull + private Integer totalItems; + + public PaginationMetadata() { + } + + public PaginationMetadata page(@javax.annotation.Nonnull Integer page) { + this.page = page; + return this; + } + + /** + * pagination offset. Use it to skip the first ((page - 1) * per_page) items + * @return page + */ + @javax.annotation.Nonnull + public Integer getPage() { + return page; + } + + public void setPage(@javax.annotation.Nonnull Integer page) { + this.page = page; + } + + + public PaginationMetadata perPage(@javax.annotation.Nonnull Integer perPage) { + this.perPage = perPage; + return this; + } + + /** + * pagination limit (page size) + * @return perPage + */ + @javax.annotation.Nonnull + public Integer getPerPage() { + return perPage; + } + + public void setPerPage(@javax.annotation.Nonnull Integer perPage) { + this.perPage = perPage; + } + + + public PaginationMetadata totalPages(@javax.annotation.Nonnull Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * number of total pages with current limit + * @return totalPages + */ + @javax.annotation.Nonnull + public Integer getTotalPages() { + return totalPages; + } + + public void setTotalPages(@javax.annotation.Nonnull Integer totalPages) { + this.totalPages = totalPages; + } + + + public PaginationMetadata totalItems(@javax.annotation.Nonnull Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * number of total available items + * @return totalItems + */ + @javax.annotation.Nonnull + public Integer getTotalItems() { + return totalItems; + } + + public void setTotalItems(@javax.annotation.Nonnull Integer totalItems) { + this.totalItems = totalItems; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaginationMetadata paginationMetadata = (PaginationMetadata) o; + return Objects.equals(this.page, paginationMetadata.page) && + Objects.equals(this.perPage, paginationMetadata.perPage) && + Objects.equals(this.totalPages, paginationMetadata.totalPages) && + Objects.equals(this.totalItems, paginationMetadata.totalItems); + } + + @Override + public int hashCode() { + return Objects.hash(page, perPage, totalPages, totalItems); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaginationMetadata {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" perPage: ").append(toIndentedString(perPage)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" totalItems: ").append(toIndentedString(totalItems)).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(Arrays.asList("page", "per_page", "total_pages", "total_items")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("page", "per_page", "total_pages", "total_items")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PaginationMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PaginationMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PaginationMetadata is not found in the empty JSON string", PaginationMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PaginationMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginationMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaginationMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaginationMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaginationMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaginationMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaginationMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaginationMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaginationMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaginationMetadata + * @throws IOException if the JSON string is invalid with respect to PaginationMetadata + */ + public static PaginationMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaginationMetadata.class); + } + + /** + * Convert an instance of PaginationMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Protocol.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Protocol.java new file mode 100644 index 0000000..bcf83a2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Protocol.java @@ -0,0 +1,209 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta sharing protocol object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Protocol { + public static final String SERIALIZED_NAME_MIN_READER_VERSION = "minReaderVersion"; + @SerializedName(SERIALIZED_NAME_MIN_READER_VERSION) + @javax.annotation.Nonnull + private Integer minReaderVersion; + + public Protocol() { + } + + public Protocol minReaderVersion(@javax.annotation.Nonnull Integer minReaderVersion) { + this.minReaderVersion = minReaderVersion; + return this; + } + + /** + * The minimum version of the protocol that a client must implement in order to correctly read a Delta Lake table. Currently it’s always 1. It will be changed in future when we introduce non-forward-compatible changes that require clients to implement. + * @return minReaderVersion + */ + @javax.annotation.Nonnull + public Integer getMinReaderVersion() { + return minReaderVersion; + } + + public void setMinReaderVersion(@javax.annotation.Nonnull Integer minReaderVersion) { + this.minReaderVersion = minReaderVersion; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Protocol protocol = (Protocol) o; + return Objects.equals(this.minReaderVersion, protocol.minReaderVersion); + } + + @Override + public int hashCode() { + return Objects.hash(minReaderVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Protocol {\n"); + sb.append(" minReaderVersion: ").append(toIndentedString(minReaderVersion)).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(Arrays.asList("minReaderVersion")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("minReaderVersion")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Protocol + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Protocol.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Protocol is not found in the empty JSON string", Protocol.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Protocol.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Protocol` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Protocol.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Protocol.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Protocol' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Protocol.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Protocol value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Protocol read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Protocol given an JSON string + * + * @param jsonString JSON string + * @return An instance of Protocol + * @throws IOException if the JSON string is invalid with respect to Protocol + */ + public static Protocol fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Protocol.class); + } + + /** + * Convert an instance of Protocol to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableChangeResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableChangeResponse.java new file mode 100644 index 0000000..511889a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableChangeResponse.java @@ -0,0 +1,456 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFile; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFileAdd; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFileRemove; +import io.tiledb.cloud.rest_api.v4.model.Format; +import io.tiledb.cloud.rest_api.v4.model.Metadata; +import io.tiledb.cloud.rest_api.v4.model.ModelFile; +import io.tiledb.cloud.rest_api.v4.model.Protocol; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import io.tiledb.cloud.rest_api.v4.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class QueryTableChangeResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QueryTableChangeResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryTableChangeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryTableChangeResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterProtocol = gson.getDelegateAdapter(this, TypeToken.get(Protocol.class)); + final TypeAdapter adapterMetadata = gson.getDelegateAdapter(this, TypeToken.get(Metadata.class)); + final TypeAdapter adapterModelFile = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + final TypeAdapter adapterDataChangeFile = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFile.class)); + final TypeAdapter adapterDataChangeFileAdd = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileAdd.class)); + final TypeAdapter adapterDataChangeFileRemove = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileRemove.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryTableChangeResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Protocol` + if (value.getActualInstance() instanceof Protocol) { + JsonElement element = adapterProtocol.toJsonTree((Protocol)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Metadata` + if (value.getActualInstance() instanceof Metadata) { + JsonElement element = adapterMetadata.toJsonTree((Metadata)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ModelFile` + if (value.getActualInstance() instanceof ModelFile) { + JsonElement element = adapterModelFile.toJsonTree((ModelFile)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFile` + if (value.getActualInstance() instanceof DataChangeFile) { + JsonElement element = adapterDataChangeFile.toJsonTree((DataChangeFile)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFileAdd` + if (value.getActualInstance() instanceof DataChangeFileAdd) { + JsonElement element = adapterDataChangeFileAdd.toJsonTree((DataChangeFileAdd)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFileRemove` + if (value.getActualInstance() instanceof DataChangeFileRemove) { + JsonElement element = adapterDataChangeFileRemove.toJsonTree((DataChangeFileRemove)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol"); + } + + @Override + public QueryTableChangeResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Protocol + try { + // validate the JSON object to see if any exception is thrown + Protocol.validateJsonElement(jsonElement); + actualAdapter = adapterProtocol; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Protocol'", e); + } + // deserialize Metadata + try { + // validate the JSON object to see if any exception is thrown + Metadata.validateJsonElement(jsonElement); + actualAdapter = adapterMetadata; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Metadata'", e); + } + // deserialize ModelFile + try { + // validate the JSON object to see if any exception is thrown + ModelFile.validateJsonElement(jsonElement); + actualAdapter = adapterModelFile; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ModelFile failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ModelFile'", e); + } + // deserialize DataChangeFile + try { + // validate the JSON object to see if any exception is thrown + DataChangeFile.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFile; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFile failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFile'", e); + } + // deserialize DataChangeFileAdd + try { + // validate the JSON object to see if any exception is thrown + DataChangeFileAdd.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFileAdd; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFileAdd failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFileAdd'", e); + } + // deserialize DataChangeFileRemove + try { + // validate the JSON object to see if any exception is thrown + DataChangeFileRemove.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFileRemove; + QueryTableChangeResponse ret = new QueryTableChangeResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFileRemove failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFileRemove'", e); + } + + throw new IOException(String.format("Failed deserialization for QueryTableChangeResponse: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public QueryTableChangeResponse() { + super("anyOf", Boolean.FALSE); + } + + public QueryTableChangeResponse(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Protocol", Protocol.class); + schemas.put("Metadata", Metadata.class); + schemas.put("ModelFile", ModelFile.class); + schemas.put("DataChangeFile", DataChangeFile.class); + schemas.put("DataChangeFileAdd", DataChangeFileAdd.class); + schemas.put("DataChangeFileRemove", DataChangeFileRemove.class); + } + + @Override + public Map> getSchemas() { + return QueryTableChangeResponse.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Protocol) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Metadata) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ModelFile) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFile) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFileAdd) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFileRemove) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol"); + } + + /** + * Get the actual instance, which can be the following: + * DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol + * + * @return The actual instance (DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Protocol`. If the actual instance is not `Protocol`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Protocol` + * @throws ClassCastException if the instance is not `Protocol` + */ + public Protocol getProtocol() throws ClassCastException { + return (Protocol)super.getActualInstance(); + } + + /** + * Get the actual instance of `Metadata`. If the actual instance is not `Metadata`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Metadata` + * @throws ClassCastException if the instance is not `Metadata` + */ + public Metadata getMetadata() throws ClassCastException { + return (Metadata)super.getActualInstance(); + } + + /** + * Get the actual instance of `ModelFile`. If the actual instance is not `ModelFile`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ModelFile` + * @throws ClassCastException if the instance is not `ModelFile` + */ + public ModelFile getModelFile() throws ClassCastException { + return (ModelFile)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFile`. If the actual instance is not `DataChangeFile`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFile` + * @throws ClassCastException if the instance is not `DataChangeFile` + */ + public DataChangeFile getDataChangeFile() throws ClassCastException { + return (DataChangeFile)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFileAdd`. If the actual instance is not `DataChangeFileAdd`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFileAdd` + * @throws ClassCastException if the instance is not `DataChangeFileAdd` + */ + public DataChangeFileAdd getDataChangeFileAdd() throws ClassCastException { + return (DataChangeFileAdd)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFileRemove`. If the actual instance is not `DataChangeFileRemove`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFileRemove` + * @throws ClassCastException if the instance is not `DataChangeFileRemove` + */ + public DataChangeFileRemove getDataChangeFileRemove() throws ClassCastException { + return (DataChangeFileRemove)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to QueryTableChangeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Protocol + try { + Protocol.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Metadata + try { + Metadata.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ModelFile + try { + ModelFile.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ModelFile failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFile + try { + DataChangeFile.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFile failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFileAdd + try { + DataChangeFileAdd.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFileAdd failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFileRemove + try { + DataChangeFileRemove.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFileRemove failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for QueryTableChangeResponse with anyOf schemas: DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of QueryTableChangeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryTableChangeResponse + * @throws IOException if the JSON string is invalid with respect to QueryTableChangeResponse + */ + public static QueryTableChangeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryTableChangeResponse.class); + } + + /** + * Convert an instance of QueryTableChangeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableRequest.java new file mode 100644 index 0000000..c50e0ea --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableRequest.java @@ -0,0 +1,370 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share table query request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class QueryTableRequest { + public static final String SERIALIZED_NAME_PREDICATE_HINTS = "predicateHints"; + @SerializedName(SERIALIZED_NAME_PREDICATE_HINTS) + @javax.annotation.Nullable + private String predicateHints; + + public static final String SERIALIZED_NAME_JSON_PREDICATE_HINTS = "jsonPredicateHints"; + @SerializedName(SERIALIZED_NAME_JSON_PREDICATE_HINTS) + @javax.annotation.Nullable + private String jsonPredicateHints; + + public static final String SERIALIZED_NAME_LIMIT_HINT = "limitHint"; + @SerializedName(SERIALIZED_NAME_LIMIT_HINT) + @javax.annotation.Nullable + private String limitHint; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @javax.annotation.Nullable + private String timestamp; + + public static final String SERIALIZED_NAME_STARTING_VERSION = "startingVersion"; + @SerializedName(SERIALIZED_NAME_STARTING_VERSION) + @javax.annotation.Nullable + private Integer startingVersion; + + public static final String SERIALIZED_NAME_ENDING_VERSION = "endingVersion"; + @SerializedName(SERIALIZED_NAME_ENDING_VERSION) + @javax.annotation.Nullable + private Integer endingVersion; + + public QueryTableRequest() { + } + + public QueryTableRequest predicateHints(@javax.annotation.Nullable String predicateHints) { + this.predicateHints = predicateHints; + return this; + } + + /** + * a list of SQL boolean expressions using a restricted subset of SQL, in a JSON array. When it's present, the server will use the provided predicates as a hint to apply the SQL predicates on the returned files. Filtering files based on the SQL predicates is BEST EFFORT. The server may return files that don't satisfy the predicates. If the server fails to parse one of the SQL predicates, or fails to evaluate it, the server may skip it. Predicate expressions are conjunctive (AND-ed together). When it's absent, the server will return all of files in the table. This will be deprecated once all the client and server implementation move to using jsonPredicateHints below. + * @return predicateHints + */ + @javax.annotation.Nullable + public String getPredicateHints() { + return predicateHints; + } + + public void setPredicateHints(@javax.annotation.Nullable String predicateHints) { + this.predicateHints = predicateHints; + } + + + public QueryTableRequest jsonPredicateHints(@javax.annotation.Nullable String jsonPredicateHints) { + this.jsonPredicateHints = jsonPredicateHints; + return this; + } + + /** + * query predicates on partition columns specified using a structured JSON format. When it's present, the server will try to use the predicates to filter table's files, which could boost query performance. As with predicateHints, this filtering is BEST EFFORT. The server may return files that don't satisfy the predicates. If the server encounters any errors during predicate processing (for example, invalid syntax or non existing columns), it will skip filtering and return all the files. When it's absent, the server will return all the files in the table. + * @return jsonPredicateHints + */ + @javax.annotation.Nullable + public String getJsonPredicateHints() { + return jsonPredicateHints; + } + + public void setJsonPredicateHints(@javax.annotation.Nullable String jsonPredicateHints) { + this.jsonPredicateHints = jsonPredicateHints; + } + + + public QueryTableRequest limitHint(@javax.annotation.Nullable String limitHint) { + this.limitHint = limitHint; + return this; + } + + /** + * an optional limit number. It's a hint from the client to tell the server how many rows in the table the client plans to read. The server can use this hint to return only some files by using the file stats. For example, when running SELECT * FROM table LIMIT 1000, the client can set limitHint to 1000. + * @return limitHint + */ + @javax.annotation.Nullable + public String getLimitHint() { + return limitHint; + } + + public void setLimitHint(@javax.annotation.Nullable String limitHint) { + this.limitHint = limitHint; + } + + + public QueryTableRequest version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * an optional version number. If set, will return files as of the specified version of the table. This is only supported on tables with history sharing enabled. + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public QueryTableRequest timestamp(@javax.annotation.Nullable String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * an optional timestamp string in the Timestamp Format,. If set, will return files as of the table version corresponding to the specified timestamp. This is only supported on tables with history sharing enabled. + * @return timestamp + */ + @javax.annotation.Nullable + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(@javax.annotation.Nullable String timestamp) { + this.timestamp = timestamp; + } + + + public QueryTableRequest startingVersion(@javax.annotation.Nullable Integer startingVersion) { + this.startingVersion = startingVersion; + return this; + } + + /** + * an optional version number. If set, will return all data change files since startingVersion, inclusive, including historical metadata if seen in the delta log. + * @return startingVersion + */ + @javax.annotation.Nullable + public Integer getStartingVersion() { + return startingVersion; + } + + public void setStartingVersion(@javax.annotation.Nullable Integer startingVersion) { + this.startingVersion = startingVersion; + } + + + public QueryTableRequest endingVersion(@javax.annotation.Nullable Integer endingVersion) { + this.endingVersion = endingVersion; + return this; + } + + /** + * an optional version number, only used if startingVersion is set. If set, the server can use it as a hint to avoid returning data change files after endingVersion. This is not enforcement. Hence, when sending the endingVersion parameter, the client should still handle the case that it may receive files after endingVersion. + * @return endingVersion + */ + @javax.annotation.Nullable + public Integer getEndingVersion() { + return endingVersion; + } + + public void setEndingVersion(@javax.annotation.Nullable Integer endingVersion) { + this.endingVersion = endingVersion; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryTableRequest queryTableRequest = (QueryTableRequest) o; + return Objects.equals(this.predicateHints, queryTableRequest.predicateHints) && + Objects.equals(this.jsonPredicateHints, queryTableRequest.jsonPredicateHints) && + Objects.equals(this.limitHint, queryTableRequest.limitHint) && + Objects.equals(this.version, queryTableRequest.version) && + Objects.equals(this.timestamp, queryTableRequest.timestamp) && + Objects.equals(this.startingVersion, queryTableRequest.startingVersion) && + Objects.equals(this.endingVersion, queryTableRequest.endingVersion); + } + + @Override + public int hashCode() { + return Objects.hash(predicateHints, jsonPredicateHints, limitHint, version, timestamp, startingVersion, endingVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryTableRequest {\n"); + sb.append(" predicateHints: ").append(toIndentedString(predicateHints)).append("\n"); + sb.append(" jsonPredicateHints: ").append(toIndentedString(jsonPredicateHints)).append("\n"); + sb.append(" limitHint: ").append(toIndentedString(limitHint)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" startingVersion: ").append(toIndentedString(startingVersion)).append("\n"); + sb.append(" endingVersion: ").append(toIndentedString(endingVersion)).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(Arrays.asList("predicateHints", "jsonPredicateHints", "limitHint", "version", "timestamp", "startingVersion", "endingVersion")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to QueryTableRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryTableRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryTableRequest is not found in the empty JSON string", QueryTableRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!QueryTableRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryTableRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("predicateHints") != null && !jsonObj.get("predicateHints").isJsonNull()) && !jsonObj.get("predicateHints").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `predicateHints` to be a primitive type in the JSON string but got `%s`", jsonObj.get("predicateHints").toString())); + } + if ((jsonObj.get("jsonPredicateHints") != null && !jsonObj.get("jsonPredicateHints").isJsonNull()) && !jsonObj.get("jsonPredicateHints").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jsonPredicateHints` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jsonPredicateHints").toString())); + } + if ((jsonObj.get("limitHint") != null && !jsonObj.get("limitHint").isJsonNull()) && !jsonObj.get("limitHint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `limitHint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("limitHint").toString())); + } + if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryTableRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryTableRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryTableRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryTableRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryTableRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryTableRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryTableRequest + * @throws IOException if the JSON string is invalid with respect to QueryTableRequest + */ + public static QueryTableRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryTableRequest.class); + } + + /** + * Convert an instance of QueryTableRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableResponse.java new file mode 100644 index 0000000..6161c15 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/QueryTableResponse.java @@ -0,0 +1,456 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFile; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFileAdd; +import io.tiledb.cloud.rest_api.v4.model.DataChangeFileRemove; +import io.tiledb.cloud.rest_api.v4.model.Format; +import io.tiledb.cloud.rest_api.v4.model.Metadata; +import io.tiledb.cloud.rest_api.v4.model.ModelFile; +import io.tiledb.cloud.rest_api.v4.model.Protocol; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import io.tiledb.cloud.rest_api.v4.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class QueryTableResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QueryTableResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryTableResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryTableResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterProtocol = gson.getDelegateAdapter(this, TypeToken.get(Protocol.class)); + final TypeAdapter adapterMetadata = gson.getDelegateAdapter(this, TypeToken.get(Metadata.class)); + final TypeAdapter adapterModelFile = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + final TypeAdapter adapterDataChangeFile = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFile.class)); + final TypeAdapter adapterDataChangeFileAdd = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileAdd.class)); + final TypeAdapter adapterDataChangeFileRemove = gson.getDelegateAdapter(this, TypeToken.get(DataChangeFileRemove.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryTableResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Protocol` + if (value.getActualInstance() instanceof Protocol) { + JsonElement element = adapterProtocol.toJsonTree((Protocol)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Metadata` + if (value.getActualInstance() instanceof Metadata) { + JsonElement element = adapterMetadata.toJsonTree((Metadata)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ModelFile` + if (value.getActualInstance() instanceof ModelFile) { + JsonElement element = adapterModelFile.toJsonTree((ModelFile)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFile` + if (value.getActualInstance() instanceof DataChangeFile) { + JsonElement element = adapterDataChangeFile.toJsonTree((DataChangeFile)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFileAdd` + if (value.getActualInstance() instanceof DataChangeFileAdd) { + JsonElement element = adapterDataChangeFileAdd.toJsonTree((DataChangeFileAdd)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DataChangeFileRemove` + if (value.getActualInstance() instanceof DataChangeFileRemove) { + JsonElement element = adapterDataChangeFileRemove.toJsonTree((DataChangeFileRemove)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol"); + } + + @Override + public QueryTableResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Protocol + try { + // validate the JSON object to see if any exception is thrown + Protocol.validateJsonElement(jsonElement); + actualAdapter = adapterProtocol; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Protocol'", e); + } + // deserialize Metadata + try { + // validate the JSON object to see if any exception is thrown + Metadata.validateJsonElement(jsonElement); + actualAdapter = adapterMetadata; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Metadata'", e); + } + // deserialize ModelFile + try { + // validate the JSON object to see if any exception is thrown + ModelFile.validateJsonElement(jsonElement); + actualAdapter = adapterModelFile; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ModelFile failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ModelFile'", e); + } + // deserialize DataChangeFile + try { + // validate the JSON object to see if any exception is thrown + DataChangeFile.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFile; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFile failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFile'", e); + } + // deserialize DataChangeFileAdd + try { + // validate the JSON object to see if any exception is thrown + DataChangeFileAdd.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFileAdd; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFileAdd failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFileAdd'", e); + } + // deserialize DataChangeFileRemove + try { + // validate the JSON object to see if any exception is thrown + DataChangeFileRemove.validateJsonElement(jsonElement); + actualAdapter = adapterDataChangeFileRemove; + QueryTableResponse ret = new QueryTableResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DataChangeFileRemove failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DataChangeFileRemove'", e); + } + + throw new IOException(String.format("Failed deserialization for QueryTableResponse: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public QueryTableResponse() { + super("anyOf", Boolean.FALSE); + } + + public QueryTableResponse(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Protocol", Protocol.class); + schemas.put("Metadata", Metadata.class); + schemas.put("ModelFile", ModelFile.class); + schemas.put("DataChangeFile", DataChangeFile.class); + schemas.put("DataChangeFileAdd", DataChangeFileAdd.class); + schemas.put("DataChangeFileRemove", DataChangeFileRemove.class); + } + + @Override + public Map> getSchemas() { + return QueryTableResponse.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Protocol) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Metadata) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ModelFile) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFile) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFileAdd) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DataChangeFileRemove) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol"); + } + + /** + * Get the actual instance, which can be the following: + * DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol + * + * @return The actual instance (DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Protocol`. If the actual instance is not `Protocol`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Protocol` + * @throws ClassCastException if the instance is not `Protocol` + */ + public Protocol getProtocol() throws ClassCastException { + return (Protocol)super.getActualInstance(); + } + + /** + * Get the actual instance of `Metadata`. If the actual instance is not `Metadata`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Metadata` + * @throws ClassCastException if the instance is not `Metadata` + */ + public Metadata getMetadata() throws ClassCastException { + return (Metadata)super.getActualInstance(); + } + + /** + * Get the actual instance of `ModelFile`. If the actual instance is not `ModelFile`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ModelFile` + * @throws ClassCastException if the instance is not `ModelFile` + */ + public ModelFile getModelFile() throws ClassCastException { + return (ModelFile)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFile`. If the actual instance is not `DataChangeFile`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFile` + * @throws ClassCastException if the instance is not `DataChangeFile` + */ + public DataChangeFile getDataChangeFile() throws ClassCastException { + return (DataChangeFile)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFileAdd`. If the actual instance is not `DataChangeFileAdd`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFileAdd` + * @throws ClassCastException if the instance is not `DataChangeFileAdd` + */ + public DataChangeFileAdd getDataChangeFileAdd() throws ClassCastException { + return (DataChangeFileAdd)super.getActualInstance(); + } + + /** + * Get the actual instance of `DataChangeFileRemove`. If the actual instance is not `DataChangeFileRemove`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DataChangeFileRemove` + * @throws ClassCastException if the instance is not `DataChangeFileRemove` + */ + public DataChangeFileRemove getDataChangeFileRemove() throws ClassCastException { + return (DataChangeFileRemove)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to QueryTableResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Protocol + try { + Protocol.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Metadata + try { + Metadata.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ModelFile + try { + ModelFile.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ModelFile failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFile + try { + DataChangeFile.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFile failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFileAdd + try { + DataChangeFileAdd.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFileAdd failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DataChangeFileRemove + try { + DataChangeFileRemove.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DataChangeFileRemove failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for QueryTableResponse with anyOf schemas: DataChangeFile, DataChangeFileAdd, DataChangeFileRemove, Metadata, ModelFile, Protocol. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of QueryTableResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryTableResponse + * @throws IOException if the JSON string is invalid with respect to QueryTableResponse + */ + public static QueryTableResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryTableResponse.class); + } + + /** + * Convert an instance of QueryTableResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestEmailConfirmationRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestEmailConfirmationRequest.java new file mode 100644 index 0000000..a0c8e87 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestEmailConfirmationRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing the necessary data to request an email address confirmation email. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class RequestEmailConfirmationRequest { + public static final String SERIALIZED_NAME_USERNAME_OR_EMAIL = "username_or_email"; + @SerializedName(SERIALIZED_NAME_USERNAME_OR_EMAIL) + @javax.annotation.Nonnull + private String usernameOrEmail; + + public RequestEmailConfirmationRequest() { + } + + public RequestEmailConfirmationRequest usernameOrEmail(@javax.annotation.Nonnull String usernameOrEmail) { + this.usernameOrEmail = usernameOrEmail; + return this; + } + + /** + * username or email of the user that will receive the email with the required token + * @return usernameOrEmail + */ + @javax.annotation.Nonnull + public String getUsernameOrEmail() { + return usernameOrEmail; + } + + public void setUsernameOrEmail(@javax.annotation.Nonnull String usernameOrEmail) { + this.usernameOrEmail = usernameOrEmail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestEmailConfirmationRequest requestEmailConfirmationRequest = (RequestEmailConfirmationRequest) o; + return Objects.equals(this.usernameOrEmail, requestEmailConfirmationRequest.usernameOrEmail); + } + + @Override + public int hashCode() { + return Objects.hash(usernameOrEmail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestEmailConfirmationRequest {\n"); + sb.append(" usernameOrEmail: ").append(toIndentedString(usernameOrEmail)).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(Arrays.asList("username_or_email")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("username_or_email")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestEmailConfirmationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestEmailConfirmationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestEmailConfirmationRequest is not found in the empty JSON string", RequestEmailConfirmationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestEmailConfirmationRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestEmailConfirmationRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestEmailConfirmationRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username_or_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username_or_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username_or_email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestEmailConfirmationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestEmailConfirmationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestEmailConfirmationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestEmailConfirmationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestEmailConfirmationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestEmailConfirmationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestEmailConfirmationRequest + * @throws IOException if the JSON string is invalid with respect to RequestEmailConfirmationRequest + */ + public static RequestEmailConfirmationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestEmailConfirmationRequest.class); + } + + /** + * Convert an instance of RequestEmailConfirmationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestPasswordResetRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestPasswordResetRequest.java new file mode 100644 index 0000000..ce1cd4a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RequestPasswordResetRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing the necessary data to request a password reset link. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class RequestPasswordResetRequest { + public static final String SERIALIZED_NAME_USERNAME_OR_EMAIL = "username_or_email"; + @SerializedName(SERIALIZED_NAME_USERNAME_OR_EMAIL) + @javax.annotation.Nonnull + private String usernameOrEmail; + + public RequestPasswordResetRequest() { + } + + public RequestPasswordResetRequest usernameOrEmail(@javax.annotation.Nonnull String usernameOrEmail) { + this.usernameOrEmail = usernameOrEmail; + return this; + } + + /** + * username or email of the user that will receive the email with the password reset link + * @return usernameOrEmail + */ + @javax.annotation.Nonnull + public String getUsernameOrEmail() { + return usernameOrEmail; + } + + public void setUsernameOrEmail(@javax.annotation.Nonnull String usernameOrEmail) { + this.usernameOrEmail = usernameOrEmail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestPasswordResetRequest requestPasswordResetRequest = (RequestPasswordResetRequest) o; + return Objects.equals(this.usernameOrEmail, requestPasswordResetRequest.usernameOrEmail); + } + + @Override + public int hashCode() { + return Objects.hash(usernameOrEmail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestPasswordResetRequest {\n"); + sb.append(" usernameOrEmail: ").append(toIndentedString(usernameOrEmail)).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(Arrays.asList("username_or_email")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("username_or_email")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestPasswordResetRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestPasswordResetRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestPasswordResetRequest is not found in the empty JSON string", RequestPasswordResetRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestPasswordResetRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestPasswordResetRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestPasswordResetRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username_or_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username_or_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username_or_email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestPasswordResetRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestPasswordResetRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestPasswordResetRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestPasswordResetRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestPasswordResetRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestPasswordResetRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestPasswordResetRequest + * @throws IOException if the JSON string is invalid with respect to RequestPasswordResetRequest + */ + public static RequestPasswordResetRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestPasswordResetRequest.class); + } + + /** + * Convert an instance of RequestPasswordResetRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ResetPasswordRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ResetPasswordRequest.java new file mode 100644 index 0000000..f3a6cd7 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ResetPasswordRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing the necessary data to reset a user's password + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ResetPasswordRequest { + public static final String SERIALIZED_NAME_NEW_PASSWORD = "new_password"; + @SerializedName(SERIALIZED_NAME_NEW_PASSWORD) + @javax.annotation.Nonnull + private String newPassword; + + public ResetPasswordRequest() { + } + + public ResetPasswordRequest newPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * the new password + * @return newPassword + */ + @javax.annotation.Nonnull + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordRequest resetPasswordRequest = (ResetPasswordRequest) o; + return Objects.equals(this.newPassword, resetPasswordRequest.newPassword); + } + + @Override + public int hashCode() { + return Objects.hash(newPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordRequest {\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).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(Arrays.asList("new_password")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("new_password")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ResetPasswordRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordRequest is not found in the empty JSON string", ResetPasswordRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ResetPasswordRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResetPasswordRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("new_password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `new_password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ResetPasswordRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ResetPasswordRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordRequest + * @throws IOException if the JSON string is invalid with respect to ResetPasswordRequest + */ + public static ResetPasswordRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordRequest.class); + } + + /** + * Convert an instance of ResetPasswordRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/RestCapabilities.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RestCapabilities.java new file mode 100644 index 0000000..49b532e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/RestCapabilities.java @@ -0,0 +1,240 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TileDBVersion; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Model representing REST capabilities + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class RestCapabilities { + public static final String SERIALIZED_NAME_DEPLOYED_TILE_D_B_VERSION = "deployedTileDBVersion"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_TILE_D_B_VERSION) + @javax.annotation.Nonnull + private TileDBVersion deployedTileDBVersion; + + public static final String SERIALIZED_NAME_MINIMUM_SUPPORTED_TILE_D_B_CLIENT_VERSION = "minimumSupportedTileDBClientVersion"; + @SerializedName(SERIALIZED_NAME_MINIMUM_SUPPORTED_TILE_D_B_CLIENT_VERSION) + @javax.annotation.Nonnull + private TileDBVersion minimumSupportedTileDBClientVersion; + + public RestCapabilities() { + } + + public RestCapabilities deployedTileDBVersion(@javax.annotation.Nonnull TileDBVersion deployedTileDBVersion) { + this.deployedTileDBVersion = deployedTileDBVersion; + return this; + } + + /** + * Get deployedTileDBVersion + * @return deployedTileDBVersion + */ + @javax.annotation.Nonnull + public TileDBVersion getDeployedTileDBVersion() { + return deployedTileDBVersion; + } + + public void setDeployedTileDBVersion(@javax.annotation.Nonnull TileDBVersion deployedTileDBVersion) { + this.deployedTileDBVersion = deployedTileDBVersion; + } + + + public RestCapabilities minimumSupportedTileDBClientVersion(@javax.annotation.Nonnull TileDBVersion minimumSupportedTileDBClientVersion) { + this.minimumSupportedTileDBClientVersion = minimumSupportedTileDBClientVersion; + return this; + } + + /** + * Get minimumSupportedTileDBClientVersion + * @return minimumSupportedTileDBClientVersion + */ + @javax.annotation.Nonnull + public TileDBVersion getMinimumSupportedTileDBClientVersion() { + return minimumSupportedTileDBClientVersion; + } + + public void setMinimumSupportedTileDBClientVersion(@javax.annotation.Nonnull TileDBVersion minimumSupportedTileDBClientVersion) { + this.minimumSupportedTileDBClientVersion = minimumSupportedTileDBClientVersion; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestCapabilities restCapabilities = (RestCapabilities) o; + return Objects.equals(this.deployedTileDBVersion, restCapabilities.deployedTileDBVersion) && + Objects.equals(this.minimumSupportedTileDBClientVersion, restCapabilities.minimumSupportedTileDBClientVersion); + } + + @Override + public int hashCode() { + return Objects.hash(deployedTileDBVersion, minimumSupportedTileDBClientVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestCapabilities {\n"); + sb.append(" deployedTileDBVersion: ").append(toIndentedString(deployedTileDBVersion)).append("\n"); + sb.append(" minimumSupportedTileDBClientVersion: ").append(toIndentedString(minimumSupportedTileDBClientVersion)).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(Arrays.asList("deployedTileDBVersion", "minimumSupportedTileDBClientVersion")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("deployedTileDBVersion", "minimumSupportedTileDBClientVersion")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RestCapabilities + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RestCapabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RestCapabilities is not found in the empty JSON string", RestCapabilities.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RestCapabilities.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RestCapabilities` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestCapabilities.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `deployedTileDBVersion` + TileDBVersion.validateJsonElement(jsonObj.get("deployedTileDBVersion")); + // validate the required field `minimumSupportedTileDBClientVersion` + TileDBVersion.validateJsonElement(jsonObj.get("minimumSupportedTileDBClientVersion")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestCapabilities.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestCapabilities' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestCapabilities.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RestCapabilities value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestCapabilities read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RestCapabilities given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestCapabilities + * @throws IOException if the JSON string is invalid with respect to RestCapabilities + */ + public static RestCapabilities fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestCapabilities.class); + } + + /** + * Convert an instance of RestCapabilities to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Schema.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Schema.java new file mode 100644 index 0000000..f0f3bb9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Schema.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaField; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * A struct is used to represent both the top-level schema of the table as well as struct columns that contain nested columns. A struct is encoded as a JSON object with the following fields + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Schema { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nonnull + private List fields = new ArrayList<>(); + + public Schema() { + } + + public Schema type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Always the string struct + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public Schema fields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + return this; + } + + public Schema addFieldsItem(SchemaField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * User-provided identifier for this table + * @return fields + */ + @javax.annotation.Nonnull + public List getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Schema schema = (Schema) o; + return Objects.equals(this.type, schema.type) && + Objects.equals(this.fields, schema.fields); + } + + @Override + public int hashCode() { + return Objects.hash(type, fields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Schema {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).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(Arrays.asList("type", "fields")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "fields")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Schema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Schema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Schema is not found in the empty JSON string", Schema.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Schema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Schema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Schema.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + // validate the required field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + SchemaField.validateJsonElement(jsonArrayfields.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Schema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Schema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Schema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Schema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Schema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Schema given an JSON string + * + * @param jsonString JSON string + * @return An instance of Schema + * @throws IOException if the JSON string is invalid with respect to Schema + */ + public static Schema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Schema.class); + } + + /** + * Convert an instance of Schema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaField.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaField.java new file mode 100644 index 0000000..9dc2a75 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaField.java @@ -0,0 +1,303 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldType; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * A struct field represents a top-level or nested column. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaField { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private SchemaFieldType type; + + public static final String SERIALIZED_NAME_NULLABLE = "nullable"; + @SerializedName(SERIALIZED_NAME_NULLABLE) + @javax.annotation.Nonnull + private Boolean nullable; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map metadata = new HashMap<>(); + + public SchemaField() { + } + + public SchemaField name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of this (possibly nested) column + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SchemaField type(@javax.annotation.Nonnull SchemaFieldType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public SchemaFieldType getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull SchemaFieldType type) { + this.type = type; + } + + + public SchemaField nullable(@javax.annotation.Nonnull Boolean nullable) { + this.nullable = nullable; + return this; + } + + /** + * A JSON map containing information about this column. For example, the comment key means its value is the column comment. + * @return nullable + */ + @javax.annotation.Nonnull + public Boolean getNullable() { + return nullable; + } + + public void setNullable(@javax.annotation.Nonnull Boolean nullable) { + this.nullable = nullable; + } + + + public SchemaField metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SchemaField putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A JSON map containing information about this column. For example, the comment key means its value is the column comment. + * @return metadata + */ + @javax.annotation.Nullable + public Map getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaField schemaField = (SchemaField) o; + return Objects.equals(this.name, schemaField.name) && + Objects.equals(this.type, schemaField.type) && + Objects.equals(this.nullable, schemaField.nullable) && + Objects.equals(this.metadata, schemaField.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, nullable, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).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(Arrays.asList("name", "type", "nullable", "metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "type", "nullable")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaField + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SchemaField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SchemaField is not found in the empty JSON string", SchemaField.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SchemaField.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchemaField` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SchemaField.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the required field `type` + SchemaFieldType.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaField' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchemaField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchemaField read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchemaField given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaField + * @throws IOException if the JSON string is invalid with respect to SchemaField + */ + public static SchemaField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaField.class); + } + + /** + * Convert an instance of SchemaField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArray.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArray.java new file mode 100644 index 0000000..9eaf173 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArray.java @@ -0,0 +1,267 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldArrayElementType; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * An array stores a variable length collection of items of some type. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaFieldArray { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_ELEMENT_TYPE = "elementType"; + @SerializedName(SERIALIZED_NAME_ELEMENT_TYPE) + @javax.annotation.Nonnull + private SchemaFieldArrayElementType elementType; + + public static final String SERIALIZED_NAME_CONTAINS_NULL = "containsNull"; + @SerializedName(SERIALIZED_NAME_CONTAINS_NULL) + @javax.annotation.Nonnull + private Boolean containsNull; + + public SchemaFieldArray() { + } + + public SchemaFieldArray type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Always the string array + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SchemaFieldArray elementType(@javax.annotation.Nonnull SchemaFieldArrayElementType elementType) { + this.elementType = elementType; + return this; + } + + /** + * Get elementType + * @return elementType + */ + @javax.annotation.Nonnull + public SchemaFieldArrayElementType getElementType() { + return elementType; + } + + public void setElementType(@javax.annotation.Nonnull SchemaFieldArrayElementType elementType) { + this.elementType = elementType; + } + + + public SchemaFieldArray containsNull(@javax.annotation.Nonnull Boolean containsNull) { + this.containsNull = containsNull; + return this; + } + + /** + * Boolean denoting whether this array can contain one or more null values + * @return containsNull + */ + @javax.annotation.Nonnull + public Boolean getContainsNull() { + return containsNull; + } + + public void setContainsNull(@javax.annotation.Nonnull Boolean containsNull) { + this.containsNull = containsNull; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaFieldArray schemaFieldArray = (SchemaFieldArray) o; + return Objects.equals(this.type, schemaFieldArray.type) && + Objects.equals(this.elementType, schemaFieldArray.elementType) && + Objects.equals(this.containsNull, schemaFieldArray.containsNull); + } + + @Override + public int hashCode() { + return Objects.hash(type, elementType, containsNull); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaFieldArray {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" elementType: ").append(toIndentedString(elementType)).append("\n"); + sb.append(" containsNull: ").append(toIndentedString(containsNull)).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(Arrays.asList("type", "elementType", "containsNull")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "elementType", "containsNull")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaFieldArray + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SchemaFieldArray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SchemaFieldArray is not found in the empty JSON string", SchemaFieldArray.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SchemaFieldArray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchemaFieldArray` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SchemaFieldArray.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `elementType` + SchemaFieldArrayElementType.validateJsonElement(jsonObj.get("elementType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaFieldArray.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaFieldArray' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldArray.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaFieldArray value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchemaFieldArray read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchemaFieldArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaFieldArray + * @throws IOException if the JSON string is invalid with respect to SchemaFieldArray + */ + public static SchemaFieldArray fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaFieldArray.class); + } + + /** + * Convert an instance of SchemaFieldArray to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArrayElementType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArrayElementType.java new file mode 100644 index 0000000..dfebc04 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldArrayElementType.java @@ -0,0 +1,320 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldArray; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldDataType; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldMap; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import io.tiledb.cloud.rest_api.v4.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaFieldArrayElementType extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SchemaFieldArrayElementType.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaFieldArrayElementType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaFieldArrayElementType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterSchemaFieldDataType = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldDataType.class)); + final TypeAdapter adapterSchemaFieldArray = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldArray.class)); + final TypeAdapter adapterSchemaFieldMap = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldMap.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaFieldArrayElementType value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `SchemaFieldDataType` + if (value.getActualInstance() instanceof SchemaFieldDataType) { + JsonElement element = adapterSchemaFieldDataType.toJsonTree((SchemaFieldDataType)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SchemaFieldArray` + if (value.getActualInstance() instanceof SchemaFieldArray) { + JsonElement element = adapterSchemaFieldArray.toJsonTree((SchemaFieldArray)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SchemaFieldMap` + if (value.getActualInstance() instanceof SchemaFieldMap) { + JsonElement element = adapterSchemaFieldMap.toJsonTree((SchemaFieldMap)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap"); + } + + @Override + public SchemaFieldArrayElementType read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize SchemaFieldDataType + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldDataType.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldDataType; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldDataType'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldDataType failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldDataType'", e); + } + // deserialize SchemaFieldArray + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldArray.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldArray; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldArray'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldArray failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldArray'", e); + } + // deserialize SchemaFieldMap + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldMap.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldMap; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldMap'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldMap failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldMap'", e); + } + + if (match == 1) { + SchemaFieldArrayElementType ret = new SchemaFieldArrayElementType(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for SchemaFieldArrayElementType: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SchemaFieldArrayElementType() { + super("oneOf", Boolean.FALSE); + } + + public SchemaFieldArrayElementType(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SchemaFieldDataType", SchemaFieldDataType.class); + schemas.put("SchemaFieldArray", SchemaFieldArray.class); + schemas.put("SchemaFieldMap", SchemaFieldMap.class); + } + + @Override + public Map> getSchemas() { + return SchemaFieldArrayElementType.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof SchemaFieldDataType) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SchemaFieldArray) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SchemaFieldMap) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap"); + } + + /** + * Get the actual instance, which can be the following: + * SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap + * + * @return The actual instance (SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldDataType`. If the actual instance is not `SchemaFieldDataType`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldDataType` + * @throws ClassCastException if the instance is not `SchemaFieldDataType` + */ + public SchemaFieldDataType getSchemaFieldDataType() throws ClassCastException { + return (SchemaFieldDataType)super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldArray`. If the actual instance is not `SchemaFieldArray`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldArray` + * @throws ClassCastException if the instance is not `SchemaFieldArray` + */ + public SchemaFieldArray getSchemaFieldArray() throws ClassCastException { + return (SchemaFieldArray)super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldMap`. If the actual instance is not `SchemaFieldMap`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldMap` + * @throws ClassCastException if the instance is not `SchemaFieldMap` + */ + public SchemaFieldMap getSchemaFieldMap() throws ClassCastException { + return (SchemaFieldMap)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaFieldArrayElementType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with SchemaFieldDataType + try { + SchemaFieldDataType.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldDataType failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SchemaFieldArray + try { + SchemaFieldArray.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldArray failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SchemaFieldMap + try { + SchemaFieldMap.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldMap failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for SchemaFieldArrayElementType with oneOf schemas: SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SchemaFieldArrayElementType given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaFieldArrayElementType + * @throws IOException if the JSON string is invalid with respect to SchemaFieldArrayElementType + */ + public static SchemaFieldArrayElementType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaFieldArrayElementType.class); + } + + /** + * Convert an instance of SchemaFieldArrayElementType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldDataType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldDataType.java new file mode 100644 index 0000000..7315431 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldDataType.java @@ -0,0 +1,102 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * A enum represents a field type + */ +@JsonAdapter(SchemaFieldDataType.Adapter.class) +public enum SchemaFieldDataType { + + STRING("string"), + + LONG("long"), + + INTEGER("integer"), + + SHORT("short"), + + BYTE("byte"), + + FLOAT("float"), + + DOUBLE("double"), + + BOOLEAN("boolean"), + + BINARY("binary"), + + DATE("date"), + + TIMESTAMP("timestamp"), + + DECIMAL("decimal"), + + ARRAY("array"), + + STRUCT("struct"); + + private String value; + + SchemaFieldDataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SchemaFieldDataType fromValue(String value) { + for (SchemaFieldDataType b : SchemaFieldDataType.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 SchemaFieldDataType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SchemaFieldDataType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SchemaFieldDataType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SchemaFieldDataType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldMap.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldMap.java new file mode 100644 index 0000000..c9dcaed --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldMap.java @@ -0,0 +1,296 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * A map stores an arbitrary length collection of key-value pairs with a single keyType and a single valueType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaFieldMap { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_KEY_TYPE = "keyType"; + @SerializedName(SERIALIZED_NAME_KEY_TYPE) + @javax.annotation.Nonnull + private String keyType; + + public static final String SERIALIZED_NAME_VALUE_TYPE = "valueType"; + @SerializedName(SERIALIZED_NAME_VALUE_TYPE) + @javax.annotation.Nonnull + private String valueType; + + public static final String SERIALIZED_NAME_VALUE_CONTAINS_NULL = "valueContainsNull"; + @SerializedName(SERIALIZED_NAME_VALUE_CONTAINS_NULL) + @javax.annotation.Nonnull + private Boolean valueContainsNull; + + public SchemaFieldMap() { + } + + public SchemaFieldMap type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Always the string map + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SchemaFieldMap keyType(@javax.annotation.Nonnull String keyType) { + this.keyType = keyType; + return this; + } + + /** + * The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition + * @return keyType + */ + @javax.annotation.Nonnull + public String getKeyType() { + return keyType; + } + + public void setKeyType(@javax.annotation.Nonnull String keyType) { + this.keyType = keyType; + } + + + public SchemaFieldMap valueType(@javax.annotation.Nonnull String valueType) { + this.valueType = valueType; + return this; + } + + /** + * The type of element used for the key of this map, represented as a string containing the name of a primitive type, a struct definition, an array definition or a map definition + * @return valueType + */ + @javax.annotation.Nonnull + public String getValueType() { + return valueType; + } + + public void setValueType(@javax.annotation.Nonnull String valueType) { + this.valueType = valueType; + } + + + public SchemaFieldMap valueContainsNull(@javax.annotation.Nonnull Boolean valueContainsNull) { + this.valueContainsNull = valueContainsNull; + return this; + } + + /** + * Indicates if map values have null values. + * @return valueContainsNull + */ + @javax.annotation.Nonnull + public Boolean getValueContainsNull() { + return valueContainsNull; + } + + public void setValueContainsNull(@javax.annotation.Nonnull Boolean valueContainsNull) { + this.valueContainsNull = valueContainsNull; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaFieldMap schemaFieldMap = (SchemaFieldMap) o; + return Objects.equals(this.type, schemaFieldMap.type) && + Objects.equals(this.keyType, schemaFieldMap.keyType) && + Objects.equals(this.valueType, schemaFieldMap.valueType) && + Objects.equals(this.valueContainsNull, schemaFieldMap.valueContainsNull); + } + + @Override + public int hashCode() { + return Objects.hash(type, keyType, valueType, valueContainsNull); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaFieldMap {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" keyType: ").append(toIndentedString(keyType)).append("\n"); + sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); + sb.append(" valueContainsNull: ").append(toIndentedString(valueContainsNull)).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(Arrays.asList("type", "keyType", "valueType", "valueContainsNull")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "keyType", "valueType", "valueContainsNull")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaFieldMap + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SchemaFieldMap.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SchemaFieldMap is not found in the empty JSON string", SchemaFieldMap.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SchemaFieldMap.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchemaFieldMap` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SchemaFieldMap.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("keyType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keyType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyType").toString())); + } + if (!jsonObj.get("valueType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `valueType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("valueType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaFieldMap.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaFieldMap' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldMap.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaFieldMap value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchemaFieldMap read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchemaFieldMap given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaFieldMap + * @throws IOException if the JSON string is invalid with respect to SchemaFieldMap + */ + public static SchemaFieldMap fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaFieldMap.class); + } + + /** + * Convert an instance of SchemaFieldMap to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldType.java new file mode 100644 index 0000000..169a7ad --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaFieldType.java @@ -0,0 +1,321 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldArray; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldArrayElementType; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldDataType; +import io.tiledb.cloud.rest_api.v4.model.SchemaFieldMap; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import io.tiledb.cloud.rest_api.v4.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaFieldType extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SchemaFieldType.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaFieldType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaFieldType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterSchemaFieldDataType = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldDataType.class)); + final TypeAdapter adapterSchemaFieldArray = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldArray.class)); + final TypeAdapter adapterSchemaFieldMap = gson.getDelegateAdapter(this, TypeToken.get(SchemaFieldMap.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaFieldType value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `SchemaFieldDataType` + if (value.getActualInstance() instanceof SchemaFieldDataType) { + JsonElement element = adapterSchemaFieldDataType.toJsonTree((SchemaFieldDataType)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SchemaFieldArray` + if (value.getActualInstance() instanceof SchemaFieldArray) { + JsonElement element = adapterSchemaFieldArray.toJsonTree((SchemaFieldArray)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SchemaFieldMap` + if (value.getActualInstance() instanceof SchemaFieldMap) { + JsonElement element = adapterSchemaFieldMap.toJsonTree((SchemaFieldMap)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap"); + } + + @Override + public SchemaFieldType read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize SchemaFieldDataType + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldDataType.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldDataType; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldDataType'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldDataType failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldDataType'", e); + } + // deserialize SchemaFieldArray + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldArray.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldArray; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldArray'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldArray failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldArray'", e); + } + // deserialize SchemaFieldMap + try { + // validate the JSON object to see if any exception is thrown + SchemaFieldMap.validateJsonElement(jsonElement); + actualAdapter = adapterSchemaFieldMap; + match++; + log.log(Level.FINER, "Input data matches schema 'SchemaFieldMap'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SchemaFieldMap failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SchemaFieldMap'", e); + } + + if (match == 1) { + SchemaFieldType ret = new SchemaFieldType(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for SchemaFieldType: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SchemaFieldType() { + super("oneOf", Boolean.FALSE); + } + + public SchemaFieldType(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SchemaFieldDataType", SchemaFieldDataType.class); + schemas.put("SchemaFieldArray", SchemaFieldArray.class); + schemas.put("SchemaFieldMap", SchemaFieldMap.class); + } + + @Override + public Map> getSchemas() { + return SchemaFieldType.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof SchemaFieldDataType) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SchemaFieldArray) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SchemaFieldMap) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap"); + } + + /** + * Get the actual instance, which can be the following: + * SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap + * + * @return The actual instance (SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldDataType`. If the actual instance is not `SchemaFieldDataType`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldDataType` + * @throws ClassCastException if the instance is not `SchemaFieldDataType` + */ + public SchemaFieldDataType getSchemaFieldDataType() throws ClassCastException { + return (SchemaFieldDataType)super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldArray`. If the actual instance is not `SchemaFieldArray`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldArray` + * @throws ClassCastException if the instance is not `SchemaFieldArray` + */ + public SchemaFieldArray getSchemaFieldArray() throws ClassCastException { + return (SchemaFieldArray)super.getActualInstance(); + } + + /** + * Get the actual instance of `SchemaFieldMap`. If the actual instance is not `SchemaFieldMap`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SchemaFieldMap` + * @throws ClassCastException if the instance is not `SchemaFieldMap` + */ + public SchemaFieldMap getSchemaFieldMap() throws ClassCastException { + return (SchemaFieldMap)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaFieldType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with SchemaFieldDataType + try { + SchemaFieldDataType.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldDataType failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SchemaFieldArray + try { + SchemaFieldArray.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldArray failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SchemaFieldMap + try { + SchemaFieldMap.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SchemaFieldMap failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for SchemaFieldType with oneOf schemas: SchemaFieldArray, SchemaFieldDataType, SchemaFieldMap. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of SchemaFieldType given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaFieldType + * @throws IOException if the JSON string is invalid with respect to SchemaFieldType + */ + public static SchemaFieldType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaFieldType.class); + } + + /** + * Convert an instance of SchemaFieldType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaItem.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaItem.java new file mode 100644 index 0000000..187d516 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/SchemaItem.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share schema table item + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class SchemaItem { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SHARE = "share"; + @SerializedName(SERIALIZED_NAME_SHARE) + @javax.annotation.Nonnull + private String share; + + public SchemaItem() { + } + + public SchemaItem name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * name of schema + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SchemaItem share(@javax.annotation.Nonnull String share) { + this.share = share; + return this; + } + + /** + * name of share + * @return share + */ + @javax.annotation.Nonnull + public String getShare() { + return share; + } + + public void setShare(@javax.annotation.Nonnull String share) { + this.share = share; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaItem schemaItem = (SchemaItem) o; + return Objects.equals(this.name, schemaItem.name) && + Objects.equals(this.share, schemaItem.share); + } + + @Override + public int hashCode() { + return Objects.hash(name, share); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaItem {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" share: ").append(toIndentedString(share)).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(Arrays.asList("name", "share")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "share")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SchemaItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SchemaItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SchemaItem is not found in the empty JSON string", SchemaItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SchemaItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SchemaItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SchemaItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if (!jsonObj.get("share").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `share` to be a primitive type in the JSON string but got `%s`", jsonObj.get("share").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SchemaItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SchemaItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SchemaItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SchemaItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SchemaItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SchemaItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of SchemaItem + * @throws IOException if the JSON string is invalid with respect to SchemaItem + */ + public static SchemaItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SchemaItem.class); + } + + /** + * Convert an instance of SchemaItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareItem.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareItem.java new file mode 100644 index 0000000..6f59740 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareItem.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share item + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ShareItem { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ShareItem() { + } + + public ShareItem name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * name of share + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ShareItem id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * optional ID of share + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShareItem shareItem = (ShareItem) o; + return Objects.equals(this.name, shareItem.name) && + Objects.equals(this.id, shareItem.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShareItem {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name", "id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ShareItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ShareItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ShareItem is not found in the empty JSON string", ShareItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ShareItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShareItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShareItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShareItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShareItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShareItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShareItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ShareItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ShareItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShareItem + * @throws IOException if the JSON string is invalid with respect to ShareItem + */ + public static ShareItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShareItem.class); + } + + /** + * Convert an instance of ShareItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareResponse.java new file mode 100644 index 0000000..588a3d0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ShareResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.ShareItem; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share details + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ShareResponse { + public static final String SERIALIZED_NAME_SHARE = "share"; + @SerializedName(SERIALIZED_NAME_SHARE) + @javax.annotation.Nonnull + private ShareItem share; + + public ShareResponse() { + } + + public ShareResponse share(@javax.annotation.Nonnull ShareItem share) { + this.share = share; + return this; + } + + /** + * Get share + * @return share + */ + @javax.annotation.Nonnull + public ShareItem getShare() { + return share; + } + + public void setShare(@javax.annotation.Nonnull ShareItem share) { + this.share = share; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShareResponse shareResponse = (ShareResponse) o; + return Objects.equals(this.share, shareResponse.share); + } + + @Override + public int hashCode() { + return Objects.hash(share); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShareResponse {\n"); + sb.append(" share: ").append(toIndentedString(share)).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(Arrays.asList("share")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("share")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ShareResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ShareResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ShareResponse is not found in the empty JSON string", ShareResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ShareResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShareResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShareResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `share` + ShareItem.validateJsonElement(jsonObj.get("share")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShareResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShareResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShareResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShareResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ShareResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ShareResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShareResponse + * @throws IOException if the JSON string is invalid with respect to ShareResponse + */ + public static ShareResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShareResponse.class); + } + + /** + * Convert an instance of ShareResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSetting.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSetting.java new file mode 100644 index 0000000..736f41e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSetting.java @@ -0,0 +1,380 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The path at which a given asset will be stored, and the credentials used to access that asset. Storage location contains a pair of storage path and storage credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSetting { + public static final String SERIALIZED_NAME_STORAGE_SETTING_ID = "storage_setting_id"; + @SerializedName(SERIALIZED_NAME_STORAGE_SETTING_ID) + @javax.annotation.Nonnull + private String storageSettingId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "is_default"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nonnull + private Boolean isDefault; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private String path; + + public static final String SERIALIZED_NAME_CREDENTIALS_NAME = "credentials_name"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS_NAME) + @javax.annotation.Nonnull + private String credentialsName; + + public static final String SERIALIZED_NAME_INVALID = "invalid"; + @SerializedName(SERIALIZED_NAME_INVALID) + @javax.annotation.Nonnull + private Boolean invalid; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + @javax.annotation.Nullable + private String reason; + + public StorageSetting() { + } + + public StorageSetting storageSettingId(@javax.annotation.Nonnull String storageSettingId) { + this.storageSettingId = storageSettingId; + return this; + } + + /** + * The storage setting's ID + * @return storageSettingId + */ + @javax.annotation.Nonnull + public String getStorageSettingId() { + return storageSettingId; + } + + public void setStorageSettingId(@javax.annotation.Nonnull String storageSettingId) { + this.storageSettingId = storageSettingId; + } + + + public StorageSetting name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * storage location name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public StorageSetting isDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * True if this is the workspace's or teamspace's default storage setting + * @return isDefault + */ + @javax.annotation.Nonnull + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + } + + + public StorageSetting path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The path to store an asset. + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + + public StorageSetting credentialsName(@javax.annotation.Nonnull String credentialsName) { + this.credentialsName = credentialsName; + return this; + } + + /** + * The name of the credentials used to access this storage path + * @return credentialsName + */ + @javax.annotation.Nonnull + public String getCredentialsName() { + return credentialsName; + } + + public void setCredentialsName(@javax.annotation.Nonnull String credentialsName) { + this.credentialsName = credentialsName; + } + + + public StorageSetting invalid(@javax.annotation.Nonnull Boolean invalid) { + this.invalid = invalid; + return this; + } + + /** + * True if the storage settings pair is not valid + * @return invalid + */ + @javax.annotation.Nonnull + public Boolean getInvalid() { + return invalid; + } + + public void setInvalid(@javax.annotation.Nonnull Boolean invalid) { + this.invalid = invalid; + } + + + public StorageSetting reason(@javax.annotation.Nullable String reason) { + this.reason = reason; + return this; + } + + /** + * The reason why the storage setting pair is not valid + * @return reason + */ + @javax.annotation.Nullable + public String getReason() { + return reason; + } + + public void setReason(@javax.annotation.Nullable String reason) { + this.reason = reason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSetting storageSetting = (StorageSetting) o; + return Objects.equals(this.storageSettingId, storageSetting.storageSettingId) && + Objects.equals(this.name, storageSetting.name) && + Objects.equals(this.isDefault, storageSetting.isDefault) && + Objects.equals(this.path, storageSetting.path) && + Objects.equals(this.credentialsName, storageSetting.credentialsName) && + Objects.equals(this.invalid, storageSetting.invalid) && + Objects.equals(this.reason, storageSetting.reason); + } + + @Override + public int hashCode() { + return Objects.hash(storageSettingId, name, isDefault, path, credentialsName, invalid, reason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSetting {\n"); + sb.append(" storageSettingId: ").append(toIndentedString(storageSettingId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" credentialsName: ").append(toIndentedString(credentialsName)).append("\n"); + sb.append(" invalid: ").append(toIndentedString(invalid)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).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(Arrays.asList("storage_setting_id", "name", "is_default", "path", "credentials_name", "invalid", "reason")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("storage_setting_id", "name", "is_default", "path", "credentials_name", "invalid")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSetting + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSetting.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSetting is not found in the empty JSON string", StorageSetting.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSetting.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSetting` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSetting.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("storage_setting_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_setting_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_setting_id").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())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if (!jsonObj.get("credentials_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentials_name").toString())); + } + if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) && !jsonObj.get("reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSetting.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSetting' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSetting.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSetting value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSetting read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSetting given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSetting + * @throws IOException if the JSON string is invalid with respect to StorageSetting + */ + public static StorageSetting fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSetting.class); + } + + /** + * Convert an instance of StorageSetting to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingGetResponse.java new file mode 100644 index 0000000..55f6f13 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.StorageSetting; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get storage setting response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private StorageSetting data; + + public StorageSettingGetResponse() { + } + + public StorageSettingGetResponse data(@javax.annotation.Nonnull StorageSetting data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public StorageSetting getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull StorageSetting data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingGetResponse storageSettingGetResponse = (StorageSettingGetResponse) o; + return Objects.equals(this.data, storageSettingGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingGetResponse is not found in the empty JSON string", StorageSettingGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSettingGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + StorageSetting.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingGetResponse + * @throws IOException if the JSON string is invalid with respect to StorageSettingGetResponse + */ + public static StorageSettingGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingGetResponse.class); + } + + /** + * Convert an instance of StorageSettingGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingUpdateRequest.java new file mode 100644 index 0000000..71272fa --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingUpdateRequest.java @@ -0,0 +1,289 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "is_default"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nullable + private String path; + + public static final String SERIALIZED_NAME_CREDENTIALS_NAME = "credentials_name"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS_NAME) + @javax.annotation.Nullable + private String credentialsName; + + public StorageSettingUpdateRequest() { + } + + public StorageSettingUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * storage location name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public StorageSettingUpdateRequest isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * True if this is the workspace's or teamspace's default storage setting + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + + public StorageSettingUpdateRequest path(@javax.annotation.Nullable String path) { + this.path = path; + return this; + } + + /** + * The path to store an asset. + * @return path + */ + @javax.annotation.Nullable + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nullable String path) { + this.path = path; + } + + + public StorageSettingUpdateRequest credentialsName(@javax.annotation.Nullable String credentialsName) { + this.credentialsName = credentialsName; + return this; + } + + /** + * The name of the credentials used to access this storage path + * @return credentialsName + */ + @javax.annotation.Nullable + public String getCredentialsName() { + return credentialsName; + } + + public void setCredentialsName(@javax.annotation.Nullable String credentialsName) { + this.credentialsName = credentialsName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingUpdateRequest storageSettingUpdateRequest = (StorageSettingUpdateRequest) o; + return Objects.equals(this.name, storageSettingUpdateRequest.name) && + Objects.equals(this.isDefault, storageSettingUpdateRequest.isDefault) && + Objects.equals(this.path, storageSettingUpdateRequest.path) && + Objects.equals(this.credentialsName, storageSettingUpdateRequest.credentialsName); + } + + @Override + public int hashCode() { + return Objects.hash(name, isDefault, path, credentialsName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" credentialsName: ").append(toIndentedString(credentialsName)).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(Arrays.asList("name", "is_default", "path", "credentials_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingUpdateRequest is not found in the empty JSON string", StorageSettingUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if ((jsonObj.get("credentials_name") != null && !jsonObj.get("credentials_name").isJsonNull()) && !jsonObj.get("credentials_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentials_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingUpdateRequest + * @throws IOException if the JSON string is invalid with respect to StorageSettingUpdateRequest + */ + public static StorageSettingUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingUpdateRequest.class); + } + + /** + * Convert an instance of StorageSettingUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateRequest.java new file mode 100644 index 0000000..b2f3149 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateRequest.java @@ -0,0 +1,296 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingsCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "is_default"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nonnull + private Boolean isDefault; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private String path; + + public static final String SERIALIZED_NAME_CREDENTIALS_NAME = "credentials_name"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS_NAME) + @javax.annotation.Nonnull + private String credentialsName; + + public StorageSettingsCreateRequest() { + } + + public StorageSettingsCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * storage location name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public StorageSettingsCreateRequest isDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * True if this is the workspace's or teamspace's default storage setting + * @return isDefault + */ + @javax.annotation.Nonnull + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + } + + + public StorageSettingsCreateRequest path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * URI containing the VFS path of where assets will be stored. Local file paths must start with `file://`. + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + + public StorageSettingsCreateRequest credentialsName(@javax.annotation.Nonnull String credentialsName) { + this.credentialsName = credentialsName; + return this; + } + + /** + * The name of the credentials used to access this storage path + * @return credentialsName + */ + @javax.annotation.Nonnull + public String getCredentialsName() { + return credentialsName; + } + + public void setCredentialsName(@javax.annotation.Nonnull String credentialsName) { + this.credentialsName = credentialsName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingsCreateRequest storageSettingsCreateRequest = (StorageSettingsCreateRequest) o; + return Objects.equals(this.name, storageSettingsCreateRequest.name) && + Objects.equals(this.isDefault, storageSettingsCreateRequest.isDefault) && + Objects.equals(this.path, storageSettingsCreateRequest.path) && + Objects.equals(this.credentialsName, storageSettingsCreateRequest.credentialsName); + } + + @Override + public int hashCode() { + return Objects.hash(name, isDefault, path, credentialsName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingsCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" credentialsName: ").append(toIndentedString(credentialsName)).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(Arrays.asList("name", "is_default", "path", "credentials_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "is_default", "path", "credentials_name")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingsCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingsCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingsCreateRequest is not found in the empty JSON string", StorageSettingsCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingsCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingsCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSettingsCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if (!jsonObj.get("credentials_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentials_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingsCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingsCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingsCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingsCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingsCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingsCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingsCreateRequest + * @throws IOException if the JSON string is invalid with respect to StorageSettingsCreateRequest + */ + public static StorageSettingsCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingsCreateRequest.class); + } + + /** + * Convert an instance of StorageSettingsCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateResponse.java new file mode 100644 index 0000000..0fc965d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.StorageSetting; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for create workspace response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingsCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private StorageSetting data; + + public StorageSettingsCreateResponse() { + } + + public StorageSettingsCreateResponse data(@javax.annotation.Nonnull StorageSetting data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public StorageSetting getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull StorageSetting data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingsCreateResponse storageSettingsCreateResponse = (StorageSettingsCreateResponse) o; + return Objects.equals(this.data, storageSettingsCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingsCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingsCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingsCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingsCreateResponse is not found in the empty JSON string", StorageSettingsCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingsCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingsCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSettingsCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + StorageSetting.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingsCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingsCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingsCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingsCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingsCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingsCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingsCreateResponse + * @throws IOException if the JSON string is invalid with respect to StorageSettingsCreateResponse + */ + public static StorageSettingsCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingsCreateResponse.class); + } + + /** + * Convert an instance of StorageSettingsCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsForTeamspaceCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsForTeamspaceCreateRequest.java new file mode 100644 index 0000000..60ee9c3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsForTeamspaceCreateRequest.java @@ -0,0 +1,267 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The path at which a given asset will be stored, and the credentials used to access that asset. Storage setting contains a pair of storage path and storage credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingsForTeamspaceCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "is_default"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nonnull + private Boolean isDefault; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + @javax.annotation.Nonnull + private String path; + + public StorageSettingsForTeamspaceCreateRequest() { + } + + public StorageSettingsForTeamspaceCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * storage location name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public StorageSettingsForTeamspaceCreateRequest isDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * True if this is the workspace's or teamspace's default storage setting + * @return isDefault + */ + @javax.annotation.Nonnull + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nonnull Boolean isDefault) { + this.isDefault = isDefault; + } + + + public StorageSettingsForTeamspaceCreateRequest path(@javax.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The path to store an asset. + * @return path + */ + @javax.annotation.Nonnull + public String getPath() { + return path; + } + + public void setPath(@javax.annotation.Nonnull String path) { + this.path = path; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingsForTeamspaceCreateRequest storageSettingsForTeamspaceCreateRequest = (StorageSettingsForTeamspaceCreateRequest) o; + return Objects.equals(this.name, storageSettingsForTeamspaceCreateRequest.name) && + Objects.equals(this.isDefault, storageSettingsForTeamspaceCreateRequest.isDefault) && + Objects.equals(this.path, storageSettingsForTeamspaceCreateRequest.path); + } + + @Override + public int hashCode() { + return Objects.hash(name, isDefault, path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingsForTeamspaceCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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(Arrays.asList("name", "is_default", "path")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "is_default", "path")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingsForTeamspaceCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingsForTeamspaceCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingsForTeamspaceCreateRequest is not found in the empty JSON string", StorageSettingsForTeamspaceCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingsForTeamspaceCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingsForTeamspaceCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSettingsForTeamspaceCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingsForTeamspaceCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingsForTeamspaceCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingsForTeamspaceCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingsForTeamspaceCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingsForTeamspaceCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingsForTeamspaceCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingsForTeamspaceCreateRequest + * @throws IOException if the JSON string is invalid with respect to StorageSettingsForTeamspaceCreateRequest + */ + public static StorageSettingsForTeamspaceCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingsForTeamspaceCreateRequest.class); + } + + /** + * Convert an instance of StorageSettingsForTeamspaceCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsListResponse.java new file mode 100644 index 0000000..204197e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/StorageSettingsListResponse.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import io.tiledb.cloud.rest_api.v4.model.StorageSetting; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get storage settings list response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class StorageSettingsListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nonnull + private PaginationMetadata paginationMetadata; + + public StorageSettingsListResponse() { + } + + public StorageSettingsListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public StorageSettingsListResponse addDataItem(StorageSetting dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of storage settings items + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public StorageSettingsListResponse paginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nonnull + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nonnull PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StorageSettingsListResponse storageSettingsListResponse = (StorageSettingsListResponse) o; + return Objects.equals(this.data, storageSettingsListResponse.data) && + Objects.equals(this.paginationMetadata, storageSettingsListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StorageSettingsListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "pagination_metadata")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageSettingsListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageSettingsListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StorageSettingsListResponse is not found in the empty JSON string", StorageSettingsListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageSettingsListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageSettingsListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StorageSettingsListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + StorageSetting.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `pagination_metadata` + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StorageSettingsListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StorageSettingsListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StorageSettingsListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StorageSettingsListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StorageSettingsListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StorageSettingsListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageSettingsListResponse + * @throws IOException if the JSON string is invalid with respect to StorageSettingsListResponse + */ + public static StorageSettingsListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StorageSettingsListResponse.class); + } + + /** + * Convert an instance of StorageSettingsListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableItem.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableItem.java new file mode 100644 index 0000000..023cc4b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableItem.java @@ -0,0 +1,328 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Delta share schema table item + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TableItem { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SCHEMA = "schema"; + @SerializedName(SERIALIZED_NAME_SCHEMA) + @javax.annotation.Nonnull + private String schema; + + public static final String SERIALIZED_NAME_SHARE = "share"; + @SerializedName(SERIALIZED_NAME_SHARE) + @javax.annotation.Nonnull + private String share; + + public static final String SERIALIZED_NAME_SHARE_ID = "shareId"; + @SerializedName(SERIALIZED_NAME_SHARE_ID) + @javax.annotation.Nullable + private String shareId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public TableItem() { + } + + public TableItem name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * name of table + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public TableItem schema(@javax.annotation.Nonnull String schema) { + this.schema = schema; + return this; + } + + /** + * name of schema + * @return schema + */ + @javax.annotation.Nonnull + public String getSchema() { + return schema; + } + + public void setSchema(@javax.annotation.Nonnull String schema) { + this.schema = schema; + } + + + public TableItem share(@javax.annotation.Nonnull String share) { + this.share = share; + return this; + } + + /** + * name of share + * @return share + */ + @javax.annotation.Nonnull + public String getShare() { + return share; + } + + public void setShare(@javax.annotation.Nonnull String share) { + this.share = share; + } + + + public TableItem shareId(@javax.annotation.Nullable String shareId) { + this.shareId = shareId; + return this; + } + + /** + * optional ID of share + * @return shareId + */ + @javax.annotation.Nullable + public String getShareId() { + return shareId; + } + + public void setShareId(@javax.annotation.Nullable String shareId) { + this.shareId = shareId; + } + + + public TableItem id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * optional ID of table + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TableItem tableItem = (TableItem) o; + return Objects.equals(this.name, tableItem.name) && + Objects.equals(this.schema, tableItem.schema) && + Objects.equals(this.share, tableItem.share) && + Objects.equals(this.shareId, tableItem.shareId) && + Objects.equals(this.id, tableItem.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, schema, share, shareId, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TableItem {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" share: ").append(toIndentedString(share)).append("\n"); + sb.append(" shareId: ").append(toIndentedString(shareId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("name", "schema", "share", "shareId", "id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "schema", "share")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TableItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TableItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TableItem is not found in the empty JSON string", TableItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TableItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TableItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TableItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if (!jsonObj.get("schema").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `schema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("schema").toString())); + } + if (!jsonObj.get("share").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `share` to be a primitive type in the JSON string but got `%s`", jsonObj.get("share").toString())); + } + if ((jsonObj.get("shareId") != null && !jsonObj.get("shareId").isJsonNull()) && !jsonObj.get("shareId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shareId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shareId").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TableItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TableItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TableItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TableItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TableItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TableItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of TableItem + * @throws IOException if the JSON string is invalid with respect to TableItem + */ + public static TableItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TableItem.class); + } + + /** + * Convert an instance of TableItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableMetadataResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableMetadataResponse.java new file mode 100644 index 0000000..fd0ab33 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TableMetadataResponse.java @@ -0,0 +1,272 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Format; +import io.tiledb.cloud.rest_api.v4.model.Metadata; +import io.tiledb.cloud.rest_api.v4.model.Protocol; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import io.tiledb.cloud.rest_api.v4.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TableMetadataResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TableMetadataResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TableMetadataResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TableMetadataResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterProtocol = gson.getDelegateAdapter(this, TypeToken.get(Protocol.class)); + final TypeAdapter adapterMetadata = gson.getDelegateAdapter(this, TypeToken.get(Metadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TableMetadataResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Protocol` + if (value.getActualInstance() instanceof Protocol) { + JsonElement element = adapterProtocol.toJsonTree((Protocol)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Metadata` + if (value.getActualInstance() instanceof Metadata) { + JsonElement element = adapterMetadata.toJsonTree((Metadata)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Metadata, Protocol"); + } + + @Override + public TableMetadataResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Protocol + try { + // validate the JSON object to see if any exception is thrown + Protocol.validateJsonElement(jsonElement); + actualAdapter = adapterProtocol; + TableMetadataResponse ret = new TableMetadataResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Protocol'", e); + } + // deserialize Metadata + try { + // validate the JSON object to see if any exception is thrown + Metadata.validateJsonElement(jsonElement); + actualAdapter = adapterMetadata; + TableMetadataResponse ret = new TableMetadataResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Metadata'", e); + } + + throw new IOException(String.format("Failed deserialization for TableMetadataResponse: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public TableMetadataResponse() { + super("anyOf", Boolean.FALSE); + } + + public TableMetadataResponse(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Protocol", Protocol.class); + schemas.put("Metadata", Metadata.class); + } + + @Override + public Map> getSchemas() { + return TableMetadataResponse.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Metadata, Protocol + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Protocol) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Metadata) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Metadata, Protocol"); + } + + /** + * Get the actual instance, which can be the following: + * Metadata, Protocol + * + * @return The actual instance (Metadata, Protocol) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Protocol`. If the actual instance is not `Protocol`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Protocol` + * @throws ClassCastException if the instance is not `Protocol` + */ + public Protocol getProtocol() throws ClassCastException { + return (Protocol)super.getActualInstance(); + } + + /** + * Get the actual instance of `Metadata`. If the actual instance is not `Metadata`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Metadata` + * @throws ClassCastException if the instance is not `Metadata` + */ + public Metadata getMetadata() throws ClassCastException { + return (Metadata)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TableMetadataResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Protocol + try { + Protocol.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Protocol failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Metadata + try { + Metadata.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Metadata failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for TableMetadataResponse with anyOf schemas: Metadata, Protocol. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of TableMetadataResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TableMetadataResponse + * @throws IOException if the JSON string is invalid with respect to TableMetadataResponse + */ + public static TableMetadataResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TableMetadataResponse.class); + } + + /** + * Convert an instance of TableMetadataResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Teamspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Teamspace.java new file mode 100644 index 0000000..10c17c7 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Teamspace.java @@ -0,0 +1,469 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceType; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUser; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceVisibility; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The teamspace object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Teamspace { + public static final String SERIALIZED_NAME_TEAMSPACE_ID = "teamspace_id"; + @SerializedName(SERIALIZED_NAME_TEAMSPACE_ID) + @javax.annotation.Nonnull + private String teamspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SPACE_TYPE = "space_type"; + @SerializedName(SERIALIZED_NAME_SPACE_TYPE) + @javax.annotation.Nonnull + private TeamspaceType spaceType; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private TeamspaceUser createdBy; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_SELF = "self"; + @SerializedName(SERIALIZED_NAME_SELF) + @javax.annotation.Nullable + private TeamspaceUser self; + + public static final String SERIALIZED_NAME_VISIBILITY = "visibility"; + @SerializedName(SERIALIZED_NAME_VISIBILITY) + @javax.annotation.Nonnull + private TeamspaceVisibility visibility; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public Teamspace() { + } + + public Teamspace teamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + return this; + } + + /** + * The teamspace's ID + * @return teamspaceId + */ + @javax.annotation.Nonnull + public String getTeamspaceId() { + return teamspaceId; + } + + public void setTeamspaceId(@javax.annotation.Nonnull String teamspaceId) { + this.teamspaceId = teamspaceId; + } + + + public Teamspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The teamspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Teamspace spaceType(@javax.annotation.Nonnull TeamspaceType spaceType) { + this.spaceType = spaceType; + return this; + } + + /** + * Get spaceType + * @return spaceType + */ + @javax.annotation.Nonnull + public TeamspaceType getSpaceType() { + return spaceType; + } + + public void setSpaceType(@javax.annotation.Nonnull TeamspaceType spaceType) { + this.spaceType = spaceType; + } + + + public Teamspace icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public Teamspace createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The datetime the teamspace was created (in UTC) + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Teamspace createdBy(@javax.annotation.Nonnull TeamspaceUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public TeamspaceUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull TeamspaceUser createdBy) { + this.createdBy = createdBy; + } + + + public Teamspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The teamspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Teamspace self(@javax.annotation.Nullable TeamspaceUser self) { + this.self = self; + return this; + } + + /** + * Get self + * @return self + */ + @javax.annotation.Nullable + public TeamspaceUser getSelf() { + return self; + } + + public void setSelf(@javax.annotation.Nullable TeamspaceUser self) { + this.self = self; + } + + + public Teamspace visibility(@javax.annotation.Nonnull TeamspaceVisibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get visibility + * @return visibility + */ + @javax.annotation.Nonnull + public TeamspaceVisibility getVisibility() { + return visibility; + } + + public void setVisibility(@javax.annotation.Nonnull TeamspaceVisibility visibility) { + this.visibility = visibility; + } + + + public Teamspace updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The datetime the teamspace was updated (in UTC) + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Teamspace teamspace = (Teamspace) o; + return Objects.equals(this.teamspaceId, teamspace.teamspaceId) && + Objects.equals(this.name, teamspace.name) && + Objects.equals(this.spaceType, teamspace.spaceType) && + Objects.equals(this.icon, teamspace.icon) && + Objects.equals(this.createdAt, teamspace.createdAt) && + Objects.equals(this.createdBy, teamspace.createdBy) && + Objects.equals(this.description, teamspace.description) && + Objects.equals(this.self, teamspace.self) && + Objects.equals(this.visibility, teamspace.visibility) && + Objects.equals(this.updatedAt, teamspace.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(teamspaceId, name, spaceType, icon, createdAt, createdBy, description, self, visibility, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Teamspace {\n"); + sb.append(" teamspaceId: ").append(toIndentedString(teamspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" spaceType: ").append(toIndentedString(spaceType)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); + sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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(Arrays.asList("teamspace_id", "name", "space_type", "icon", "created_at", "created_by", "description", "self", "visibility", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("teamspace_id", "name", "space_type", "created_at", "created_by", "visibility")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Teamspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Teamspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Teamspace is not found in the empty JSON string", Teamspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Teamspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Teamspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Teamspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("teamspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `teamspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("teamspace_id").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())); + } + // validate the required field `space_type` + TeamspaceType.validateJsonElement(jsonObj.get("space_type")); + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + // validate the required field `created_by` + TeamspaceUser.validateJsonElement(jsonObj.get("created_by")); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field `self` + if (jsonObj.get("self") != null && !jsonObj.get("self").isJsonNull()) { + TeamspaceUser.validateJsonElement(jsonObj.get("self")); + } + // validate the required field `visibility` + TeamspaceVisibility.validateJsonElement(jsonObj.get("visibility")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Teamspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Teamspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Teamspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Teamspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Teamspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Teamspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of Teamspace + * @throws IOException if the JSON string is invalid with respect to Teamspace + */ + public static Teamspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Teamspace.class); + } + + /** + * Convert an instance of Teamspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceDefaultCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceDefaultCredential.java new file mode 100644 index 0000000..d96deac --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceDefaultCredential.java @@ -0,0 +1,236 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.CredentialCreateRequest; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * default credential object for a teamspace. Gives the option to use an existing credential from parent workspace or create a new credential on teamspace level + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceDefaultCredential { + public static final String SERIALIZED_NAME_NEW_CREDENTIAL = "new_credential"; + @SerializedName(SERIALIZED_NAME_NEW_CREDENTIAL) + @javax.annotation.Nullable + private CredentialCreateRequest newCredential; + + public static final String SERIALIZED_NAME_EXISTING_CREDENTIAL_NAME = "existing_credential_name"; + @SerializedName(SERIALIZED_NAME_EXISTING_CREDENTIAL_NAME) + @javax.annotation.Nullable + private String existingCredentialName; + + public TeamspaceDefaultCredential() { + } + + public TeamspaceDefaultCredential newCredential(@javax.annotation.Nullable CredentialCreateRequest newCredential) { + this.newCredential = newCredential; + return this; + } + + /** + * Get newCredential + * @return newCredential + */ + @javax.annotation.Nullable + public CredentialCreateRequest getNewCredential() { + return newCredential; + } + + public void setNewCredential(@javax.annotation.Nullable CredentialCreateRequest newCredential) { + this.newCredential = newCredential; + } + + + public TeamspaceDefaultCredential existingCredentialName(@javax.annotation.Nullable String existingCredentialName) { + this.existingCredentialName = existingCredentialName; + return this; + } + + /** + * Existing workspace credential name + * @return existingCredentialName + */ + @javax.annotation.Nullable + public String getExistingCredentialName() { + return existingCredentialName; + } + + public void setExistingCredentialName(@javax.annotation.Nullable String existingCredentialName) { + this.existingCredentialName = existingCredentialName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceDefaultCredential teamspaceDefaultCredential = (TeamspaceDefaultCredential) o; + return Objects.equals(this.newCredential, teamspaceDefaultCredential.newCredential) && + Objects.equals(this.existingCredentialName, teamspaceDefaultCredential.existingCredentialName); + } + + @Override + public int hashCode() { + return Objects.hash(newCredential, existingCredentialName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceDefaultCredential {\n"); + sb.append(" newCredential: ").append(toIndentedString(newCredential)).append("\n"); + sb.append(" existingCredentialName: ").append(toIndentedString(existingCredentialName)).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(Arrays.asList("new_credential", "existing_credential_name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceDefaultCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceDefaultCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceDefaultCredential is not found in the empty JSON string", TeamspaceDefaultCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceDefaultCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceDefaultCredential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `new_credential` + if (jsonObj.get("new_credential") != null && !jsonObj.get("new_credential").isJsonNull()) { + CredentialCreateRequest.validateJsonElement(jsonObj.get("new_credential")); + } + if ((jsonObj.get("existing_credential_name") != null && !jsonObj.get("existing_credential_name").isJsonNull()) && !jsonObj.get("existing_credential_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `existing_credential_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("existing_credential_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceDefaultCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceDefaultCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceDefaultCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceDefaultCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceDefaultCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceDefaultCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceDefaultCredential + * @throws IOException if the JSON string is invalid with respect to TeamspaceDefaultCredential + */ + public static TeamspaceDefaultCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceDefaultCredential.class); + } + + /** + * Convert an instance of TeamspaceDefaultCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceGetResponse.java new file mode 100644 index 0000000..7712d87 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Teamspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a single teamspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Teamspace data; + + public TeamspaceGetResponse() { + } + + public TeamspaceGetResponse data(@javax.annotation.Nonnull Teamspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Teamspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Teamspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceGetResponse teamspaceGetResponse = (TeamspaceGetResponse) o; + return Objects.equals(this.data, teamspaceGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceGetResponse is not found in the empty JSON string", TeamspaceGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Teamspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceGetResponse + * @throws IOException if the JSON string is invalid with respect to TeamspaceGetResponse + */ + public static TeamspaceGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceGetResponse.class); + } + + /** + * Convert an instance of TeamspaceGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceRole.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceRole.java new file mode 100644 index 0000000..9d8f66d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceRole.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The enumeration of roles a user can have within a teamspace + */ +@JsonAdapter(TeamspaceRole.Adapter.class) +public enum TeamspaceRole { + + OWNER("owner"), + + EDITOR("editor"), + + VIEWER("viewer"); + + private String value; + + TeamspaceRole(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TeamspaceRole fromValue(String value) { + for (TeamspaceRole b : TeamspaceRole.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 TeamspaceRole enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TeamspaceRole read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TeamspaceRole.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TeamspaceRole.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceType.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceType.java new file mode 100644 index 0000000..3308740 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceType.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The enumeration of space types of a teamspace + */ +@JsonAdapter(TeamspaceType.Adapter.class) +public enum TeamspaceType { + + TEAMSPACE("teamspace"), + + USERSPACE("userspace"), + + GENERALSPACE("generalspace"); + + private String value; + + TeamspaceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TeamspaceType fromValue(String value) { + for (TeamspaceType b : TeamspaceType.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 TeamspaceType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TeamspaceType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TeamspaceType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TeamspaceType.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUpdateRequest.java new file mode 100644 index 0000000..dae64e7 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUpdateRequest.java @@ -0,0 +1,294 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceVisibility; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a teamspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_VISIBILITY_LEVEL = "visibility_level"; + @SerializedName(SERIALIZED_NAME_VISIBILITY_LEVEL) + @javax.annotation.Nullable + private TeamspaceVisibility visibilityLevel; + + public TeamspaceUpdateRequest() { + } + + public TeamspaceUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The teamspace name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TeamspaceUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The teamspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public TeamspaceUpdateRequest icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public TeamspaceUpdateRequest visibilityLevel(@javax.annotation.Nullable TeamspaceVisibility visibilityLevel) { + this.visibilityLevel = visibilityLevel; + return this; + } + + /** + * Get visibilityLevel + * @return visibilityLevel + */ + @javax.annotation.Nullable + public TeamspaceVisibility getVisibilityLevel() { + return visibilityLevel; + } + + public void setVisibilityLevel(@javax.annotation.Nullable TeamspaceVisibility visibilityLevel) { + this.visibilityLevel = visibilityLevel; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUpdateRequest teamspaceUpdateRequest = (TeamspaceUpdateRequest) o; + return Objects.equals(this.name, teamspaceUpdateRequest.name) && + Objects.equals(this.description, teamspaceUpdateRequest.description) && + Objects.equals(this.icon, teamspaceUpdateRequest.icon) && + Objects.equals(this.visibilityLevel, teamspaceUpdateRequest.visibilityLevel); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, icon, visibilityLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" visibilityLevel: ").append(toIndentedString(visibilityLevel)).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(Arrays.asList("name", "description", "icon", "visibility_level")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUpdateRequest is not found in the empty JSON string", TeamspaceUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + // validate the optional field `visibility_level` + if (jsonObj.get("visibility_level") != null && !jsonObj.get("visibility_level").isJsonNull()) { + TeamspaceVisibility.validateJsonElement(jsonObj.get("visibility_level")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUpdateRequest + * @throws IOException if the JSON string is invalid with respect to TeamspaceUpdateRequest + */ + public static TeamspaceUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUpdateRequest.class); + } + + /** + * Convert an instance of TeamspaceUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUser.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUser.java new file mode 100644 index 0000000..8dc54d4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUser.java @@ -0,0 +1,439 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceRole; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The teamspace user object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUser { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private TeamspaceRole role; + + public static final String SERIALIZED_NAME_ADDED_BY = "added_by"; + @SerializedName(SERIALIZED_NAME_ADDED_BY) + @javax.annotation.Nonnull + private String addedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DELETED_AT = "deleted_at"; + @SerializedName(SERIALIZED_NAME_DELETED_AT) + @javax.annotation.Nullable + private OffsetDateTime deletedAt; + + public TeamspaceUser() { + } + + public TeamspaceUser userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public TeamspaceUser username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The user's username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public TeamspaceUser displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The user's display name + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public TeamspaceUser email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The user's email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public TeamspaceUser imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public TeamspaceUser role(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public TeamspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + } + + + public TeamspaceUser addedBy(@javax.annotation.Nonnull String addedBy) { + this.addedBy = addedBy; + return this; + } + + /** + * The user's ID + * @return addedBy + */ + @javax.annotation.Nonnull + public String getAddedBy() { + return addedBy; + } + + public void setAddedBy(@javax.annotation.Nonnull String addedBy) { + this.addedBy = addedBy; + } + + + public TeamspaceUser createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The datetime the teamspace user was created (in UTC) + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public TeamspaceUser deletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * The datetime the teamspace user was deleted (in UTC) + * @return deletedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUser teamspaceUser = (TeamspaceUser) o; + return Objects.equals(this.userId, teamspaceUser.userId) && + Objects.equals(this.username, teamspaceUser.username) && + Objects.equals(this.displayName, teamspaceUser.displayName) && + Objects.equals(this.email, teamspaceUser.email) && + Objects.equals(this.imageId, teamspaceUser.imageId) && + Objects.equals(this.role, teamspaceUser.role) && + Objects.equals(this.addedBy, teamspaceUser.addedBy) && + Objects.equals(this.createdAt, teamspaceUser.createdAt) && + Objects.equals(this.deletedAt, teamspaceUser.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(userId, username, displayName, email, imageId, role, addedBy, createdAt, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUser {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" addedBy: ").append(toIndentedString(addedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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(Arrays.asList("user_id", "username", "display_name", "email", "image_id", "role", "added_by", "created_at", "deleted_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "username", "display_name", "email", "role", "added_by", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUser is not found in the empty JSON string", TeamspaceUser.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUser.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUser.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + // validate the required field `role` + TeamspaceRole.validateJsonElement(jsonObj.get("role")); + if (!jsonObj.get("added_by").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `added_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("added_by").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUser + * @throws IOException if the JSON string is invalid with respect to TeamspaceUser + */ + public static TeamspaceUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUser.class); + } + + /** + * Convert an instance of TeamspaceUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserGetResponse.java new file mode 100644 index 0000000..01d8458 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUser; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a single teamspace user + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUserGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private TeamspaceUser data; + + public TeamspaceUserGetResponse() { + } + + public TeamspaceUserGetResponse data(@javax.annotation.Nonnull TeamspaceUser data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public TeamspaceUser getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull TeamspaceUser data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUserGetResponse teamspaceUserGetResponse = (TeamspaceUserGetResponse) o; + return Objects.equals(this.data, teamspaceUserGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUserGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUserGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUserGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUserGetResponse is not found in the empty JSON string", TeamspaceUserGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUserGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUserGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUserGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + TeamspaceUser.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUserGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUserGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUserGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUserGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUserGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUserGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUserGetResponse + * @throws IOException if the JSON string is invalid with respect to TeamspaceUserGetResponse + */ + public static TeamspaceUserGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUserGetResponse.class); + } + + /** + * Convert an instance of TeamspaceUserGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserUpdateRequest.java new file mode 100644 index 0000000..4b48f24 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUserUpdateRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a single teamspace user + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUserUpdateRequest { + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private TeamspaceRole role; + + public TeamspaceUserUpdateRequest() { + } + + public TeamspaceUserUpdateRequest role(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public TeamspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUserUpdateRequest teamspaceUserUpdateRequest = (TeamspaceUserUpdateRequest) o; + return Objects.equals(this.role, teamspaceUserUpdateRequest.role); + } + + @Override + public int hashCode() { + return Objects.hash(role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUserUpdateRequest {\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUserUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUserUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUserUpdateRequest is not found in the empty JSON string", TeamspaceUserUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUserUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUserUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUserUpdateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `role` + TeamspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUserUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUserUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUserUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUserUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUserUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUserUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUserUpdateRequest + * @throws IOException if the JSON string is invalid with respect to TeamspaceUserUpdateRequest + */ + public static TeamspaceUserUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUserUpdateRequest.class); + } + + /** + * Convert an instance of TeamspaceUserUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersBulkUpdateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersBulkUpdateRequestInner.java new file mode 100644 index 0000000..933b9c6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersBulkUpdateRequestInner.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The teamspace user update object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUsersBulkUpdateRequestInner { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private TeamspaceRole role; + + public TeamspaceUsersBulkUpdateRequestInner() { + } + + public TeamspaceUsersBulkUpdateRequestInner userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public TeamspaceUsersBulkUpdateRequestInner role(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public TeamspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUsersBulkUpdateRequestInner teamspaceUsersBulkUpdateRequestInner = (TeamspaceUsersBulkUpdateRequestInner) o; + return Objects.equals(this.userId, teamspaceUsersBulkUpdateRequestInner.userId) && + Objects.equals(this.role, teamspaceUsersBulkUpdateRequestInner.role); + } + + @Override + public int hashCode() { + return Objects.hash(userId, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUsersBulkUpdateRequestInner {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("user_id", "role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUsersBulkUpdateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUsersBulkUpdateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUsersBulkUpdateRequestInner is not found in the empty JSON string", TeamspaceUsersBulkUpdateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUsersBulkUpdateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUsersBulkUpdateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUsersBulkUpdateRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + // validate the required field `role` + TeamspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUsersBulkUpdateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUsersBulkUpdateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUsersBulkUpdateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUsersBulkUpdateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUsersBulkUpdateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUsersBulkUpdateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUsersBulkUpdateRequestInner + * @throws IOException if the JSON string is invalid with respect to TeamspaceUsersBulkUpdateRequestInner + */ + public static TeamspaceUsersBulkUpdateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUsersBulkUpdateRequestInner.class); + } + + /** + * Convert an instance of TeamspaceUsersBulkUpdateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateRequestInner.java new file mode 100644 index 0000000..eb9327d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateRequestInner.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The teamspace user that should be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUsersCreateRequestInner { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private TeamspaceRole role; + + public TeamspaceUsersCreateRequestInner() { + } + + public TeamspaceUsersCreateRequestInner userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public TeamspaceUsersCreateRequestInner role(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public TeamspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull TeamspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUsersCreateRequestInner teamspaceUsersCreateRequestInner = (TeamspaceUsersCreateRequestInner) o; + return Objects.equals(this.userId, teamspaceUsersCreateRequestInner.userId) && + Objects.equals(this.role, teamspaceUsersCreateRequestInner.role); + } + + @Override + public int hashCode() { + return Objects.hash(userId, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUsersCreateRequestInner {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("user_id", "role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUsersCreateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUsersCreateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUsersCreateRequestInner is not found in the empty JSON string", TeamspaceUsersCreateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUsersCreateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUsersCreateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUsersCreateRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + // validate the required field `role` + TeamspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUsersCreateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUsersCreateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUsersCreateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUsersCreateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUsersCreateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUsersCreateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUsersCreateRequestInner + * @throws IOException if the JSON string is invalid with respect to TeamspaceUsersCreateRequestInner + */ + public static TeamspaceUsersCreateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUsersCreateRequestInner.class); + } + + /** + * Convert an instance of TeamspaceUsersCreateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateResponse.java new file mode 100644 index 0000000..f433b22 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersCreateResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when creating multiple teamspace users + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUsersCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public TeamspaceUsersCreateResponse() { + } + + public TeamspaceUsersCreateResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public TeamspaceUsersCreateResponse addDataItem(TeamspaceUser dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of teamspace users that were created + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUsersCreateResponse teamspaceUsersCreateResponse = (TeamspaceUsersCreateResponse) o; + return Objects.equals(this.data, teamspaceUsersCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUsersCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUsersCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUsersCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUsersCreateResponse is not found in the empty JSON string", TeamspaceUsersCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUsersCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUsersCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUsersCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + TeamspaceUser.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUsersCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUsersCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUsersCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUsersCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUsersCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUsersCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUsersCreateResponse + * @throws IOException if the JSON string is invalid with respect to TeamspaceUsersCreateResponse + */ + public static TeamspaceUsersCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUsersCreateResponse.class); + } + + /** + * Convert an instance of TeamspaceUsersCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersJoinResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersJoinResponse.java new file mode 100644 index 0000000..896221c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersJoinResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUser; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when joining a teamspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUsersJoinResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private TeamspaceUser data; + + public TeamspaceUsersJoinResponse() { + } + + public TeamspaceUsersJoinResponse data(@javax.annotation.Nonnull TeamspaceUser data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public TeamspaceUser getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull TeamspaceUser data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUsersJoinResponse teamspaceUsersJoinResponse = (TeamspaceUsersJoinResponse) o; + return Objects.equals(this.data, teamspaceUsersJoinResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUsersJoinResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUsersJoinResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUsersJoinResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUsersJoinResponse is not found in the empty JSON string", TeamspaceUsersJoinResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUsersJoinResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUsersJoinResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUsersJoinResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + TeamspaceUser.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUsersJoinResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUsersJoinResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUsersJoinResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUsersJoinResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUsersJoinResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUsersJoinResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUsersJoinResponse + * @throws IOException if the JSON string is invalid with respect to TeamspaceUsersJoinResponse + */ + public static TeamspaceUsersJoinResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUsersJoinResponse.class); + } + + /** + * Convert an instance of TeamspaceUsersJoinResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersListResponse.java new file mode 100644 index 0000000..aea2ae7 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceUsersListResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceUser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting multiple teamspace users + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspaceUsersListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public TeamspaceUsersListResponse() { + } + + public TeamspaceUsersListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public TeamspaceUsersListResponse addDataItem(TeamspaceUser dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of teamspace users + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspaceUsersListResponse teamspaceUsersListResponse = (TeamspaceUsersListResponse) o; + return Objects.equals(this.data, teamspaceUsersListResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspaceUsersListResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspaceUsersListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspaceUsersListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspaceUsersListResponse is not found in the empty JSON string", TeamspaceUsersListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspaceUsersListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspaceUsersListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspaceUsersListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + TeamspaceUser.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspaceUsersListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspaceUsersListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspaceUsersListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspaceUsersListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspaceUsersListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspaceUsersListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspaceUsersListResponse + * @throws IOException if the JSON string is invalid with respect to TeamspaceUsersListResponse + */ + public static TeamspaceUsersListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspaceUsersListResponse.class); + } + + /** + * Convert an instance of TeamspaceUsersListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceVisibility.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceVisibility.java new file mode 100644 index 0000000..75dc948 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspaceVisibility.java @@ -0,0 +1,78 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The enumeration of visibility levels for a teamspace + */ +@JsonAdapter(TeamspaceVisibility.Adapter.class) +public enum TeamspaceVisibility { + + PRIVATE("private"), + + PUBLIC("public"); + + private String value; + + TeamspaceVisibility(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TeamspaceVisibility fromValue(String value) { + for (TeamspaceVisibility b : TeamspaceVisibility.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 TeamspaceVisibility enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TeamspaceVisibility read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TeamspaceVisibility.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TeamspaceVisibility.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateRequest.java new file mode 100644 index 0000000..51a370e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateRequest.java @@ -0,0 +1,361 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingsForTeamspaceCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceDefaultCredential; +import io.tiledb.cloud.rest_api.v4.model.TeamspaceVisibility; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for creating a teamspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspacesCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_VISIBILITY = "visibility"; + @SerializedName(SERIALIZED_NAME_VISIBILITY) + @javax.annotation.Nonnull + private TeamspaceVisibility visibility; + + public static final String SERIALIZED_NAME_DEFAULT_CREDENTIAL = "default_credential"; + @SerializedName(SERIALIZED_NAME_DEFAULT_CREDENTIAL) + @javax.annotation.Nullable + private TeamspaceDefaultCredential defaultCredential; + + public static final String SERIALIZED_NAME_DEFAULT_STORAGE_SETTING = "default_storage_setting"; + @SerializedName(SERIALIZED_NAME_DEFAULT_STORAGE_SETTING) + @javax.annotation.Nullable + private StorageSettingsForTeamspaceCreateRequest defaultStorageSetting; + + public TeamspacesCreateRequest() { + } + + public TeamspacesCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The teamspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public TeamspacesCreateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The teamspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public TeamspacesCreateRequest icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The teamspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public TeamspacesCreateRequest visibility(@javax.annotation.Nonnull TeamspaceVisibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get visibility + * @return visibility + */ + @javax.annotation.Nonnull + public TeamspaceVisibility getVisibility() { + return visibility; + } + + public void setVisibility(@javax.annotation.Nonnull TeamspaceVisibility visibility) { + this.visibility = visibility; + } + + + public TeamspacesCreateRequest defaultCredential(@javax.annotation.Nullable TeamspaceDefaultCredential defaultCredential) { + this.defaultCredential = defaultCredential; + return this; + } + + /** + * Get defaultCredential + * @return defaultCredential + */ + @javax.annotation.Nullable + public TeamspaceDefaultCredential getDefaultCredential() { + return defaultCredential; + } + + public void setDefaultCredential(@javax.annotation.Nullable TeamspaceDefaultCredential defaultCredential) { + this.defaultCredential = defaultCredential; + } + + + public TeamspacesCreateRequest defaultStorageSetting(@javax.annotation.Nullable StorageSettingsForTeamspaceCreateRequest defaultStorageSetting) { + this.defaultStorageSetting = defaultStorageSetting; + return this; + } + + /** + * Get defaultStorageSetting + * @return defaultStorageSetting + */ + @javax.annotation.Nullable + public StorageSettingsForTeamspaceCreateRequest getDefaultStorageSetting() { + return defaultStorageSetting; + } + + public void setDefaultStorageSetting(@javax.annotation.Nullable StorageSettingsForTeamspaceCreateRequest defaultStorageSetting) { + this.defaultStorageSetting = defaultStorageSetting; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspacesCreateRequest teamspacesCreateRequest = (TeamspacesCreateRequest) o; + return Objects.equals(this.name, teamspacesCreateRequest.name) && + Objects.equals(this.description, teamspacesCreateRequest.description) && + Objects.equals(this.icon, teamspacesCreateRequest.icon) && + Objects.equals(this.visibility, teamspacesCreateRequest.visibility) && + Objects.equals(this.defaultCredential, teamspacesCreateRequest.defaultCredential) && + Objects.equals(this.defaultStorageSetting, teamspacesCreateRequest.defaultStorageSetting); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, icon, visibility, defaultCredential, defaultStorageSetting); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspacesCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n"); + sb.append(" defaultCredential: ").append(toIndentedString(defaultCredential)).append("\n"); + sb.append(" defaultStorageSetting: ").append(toIndentedString(defaultStorageSetting)).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(Arrays.asList("name", "description", "icon", "visibility", "default_credential", "default_storage_setting")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "visibility")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspacesCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspacesCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspacesCreateRequest is not found in the empty JSON string", TeamspacesCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspacesCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspacesCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspacesCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + // validate the required field `visibility` + TeamspaceVisibility.validateJsonElement(jsonObj.get("visibility")); + // validate the optional field `default_credential` + if (jsonObj.get("default_credential") != null && !jsonObj.get("default_credential").isJsonNull()) { + TeamspaceDefaultCredential.validateJsonElement(jsonObj.get("default_credential")); + } + // validate the optional field `default_storage_setting` + if (jsonObj.get("default_storage_setting") != null && !jsonObj.get("default_storage_setting").isJsonNull()) { + StorageSettingsForTeamspaceCreateRequest.validateJsonElement(jsonObj.get("default_storage_setting")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspacesCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspacesCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspacesCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspacesCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspacesCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspacesCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspacesCreateRequest + * @throws IOException if the JSON string is invalid with respect to TeamspacesCreateRequest + */ + public static TeamspacesCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspacesCreateRequest.class); + } + + /** + * Convert an instance of TeamspacesCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateResponse.java new file mode 100644 index 0000000..837ef77 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Teamspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when creating one or more teamspaces + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspacesCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Teamspace data; + + public TeamspacesCreateResponse() { + } + + public TeamspacesCreateResponse data(@javax.annotation.Nonnull Teamspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Teamspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Teamspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspacesCreateResponse teamspacesCreateResponse = (TeamspacesCreateResponse) o; + return Objects.equals(this.data, teamspacesCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspacesCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspacesCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspacesCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspacesCreateResponse is not found in the empty JSON string", TeamspacesCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspacesCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspacesCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspacesCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Teamspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspacesCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspacesCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspacesCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspacesCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspacesCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspacesCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspacesCreateResponse + * @throws IOException if the JSON string is invalid with respect to TeamspacesCreateResponse + */ + public static TeamspacesCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspacesCreateResponse.class); + } + + /** + * Convert an instance of TeamspacesCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesListResponse.java new file mode 100644 index 0000000..ac39e51 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TeamspacesListResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Teamspace; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting multiple teamspaces + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TeamspacesListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public TeamspacesListResponse() { + } + + public TeamspacesListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public TeamspacesListResponse addDataItem(Teamspace dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of teamspaces + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamspacesListResponse teamspacesListResponse = (TeamspacesListResponse) o; + return Objects.equals(this.data, teamspacesListResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamspacesListResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TeamspacesListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TeamspacesListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TeamspacesListResponse is not found in the empty JSON string", TeamspacesListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TeamspacesListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TeamspacesListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TeamspacesListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Teamspace.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TeamspacesListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TeamspacesListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TeamspacesListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TeamspacesListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TeamspacesListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TeamspacesListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TeamspacesListResponse + * @throws IOException if the JSON string is invalid with respect to TeamspacesListResponse + */ + public static TeamspacesListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TeamspacesListResponse.class); + } + + /** + * Convert an instance of TeamspacesListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TileDBVersion.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TileDBVersion.java new file mode 100644 index 0000000..45322c3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TileDBVersion.java @@ -0,0 +1,261 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Model representing TileDB version + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TileDBVersion { + public static final String SERIALIZED_NAME_MAJOR = "major"; + @SerializedName(SERIALIZED_NAME_MAJOR) + @javax.annotation.Nonnull + private Integer major; + + public static final String SERIALIZED_NAME_MINOR = "minor"; + @SerializedName(SERIALIZED_NAME_MINOR) + @javax.annotation.Nonnull + private Integer minor; + + public static final String SERIALIZED_NAME_PATCH = "patch"; + @SerializedName(SERIALIZED_NAME_PATCH) + @javax.annotation.Nonnull + private Integer patch; + + public TileDBVersion() { + } + + public TileDBVersion major(@javax.annotation.Nonnull Integer major) { + this.major = major; + return this; + } + + /** + * TileDB core major version + * @return major + */ + @javax.annotation.Nonnull + public Integer getMajor() { + return major; + } + + public void setMajor(@javax.annotation.Nonnull Integer major) { + this.major = major; + } + + + public TileDBVersion minor(@javax.annotation.Nonnull Integer minor) { + this.minor = minor; + return this; + } + + /** + * TileDB core minor version + * @return minor + */ + @javax.annotation.Nonnull + public Integer getMinor() { + return minor; + } + + public void setMinor(@javax.annotation.Nonnull Integer minor) { + this.minor = minor; + } + + + public TileDBVersion patch(@javax.annotation.Nonnull Integer patch) { + this.patch = patch; + return this; + } + + /** + * TileDB core patch version + * @return patch + */ + @javax.annotation.Nonnull + public Integer getPatch() { + return patch; + } + + public void setPatch(@javax.annotation.Nonnull Integer patch) { + this.patch = patch; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TileDBVersion tileDBVersion = (TileDBVersion) o; + return Objects.equals(this.major, tileDBVersion.major) && + Objects.equals(this.minor, tileDBVersion.minor) && + Objects.equals(this.patch, tileDBVersion.patch); + } + + @Override + public int hashCode() { + return Objects.hash(major, minor, patch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TileDBVersion {\n"); + sb.append(" major: ").append(toIndentedString(major)).append("\n"); + sb.append(" minor: ").append(toIndentedString(minor)).append("\n"); + sb.append(" patch: ").append(toIndentedString(patch)).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(Arrays.asList("major", "minor", "patch")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("major", "minor", "patch")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TileDBVersion + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TileDBVersion.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TileDBVersion is not found in the empty JSON string", TileDBVersion.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TileDBVersion.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TileDBVersion` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TileDBVersion.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TileDBVersion.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TileDBVersion' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TileDBVersion.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TileDBVersion value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TileDBVersion read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TileDBVersion given an JSON string + * + * @param jsonString JSON string + * @return An instance of TileDBVersion + * @throws IOException if the JSON string is invalid with respect to TileDBVersion + */ + public static TileDBVersion fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TileDBVersion.class); + } + + /** + * Convert an instance of TileDBVersion to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Token.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Token.java new file mode 100644 index 0000000..a3416da --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Token.java @@ -0,0 +1,238 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.AzureToken; +import io.tiledb.cloud.rest_api.v4.model.GCPServiceAccountKey; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The token information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Token { + public static final String SERIALIZED_NAME_AZURE = "azure"; + @SerializedName(SERIALIZED_NAME_AZURE) + @javax.annotation.Nullable + private AzureToken azure; + + public static final String SERIALIZED_NAME_GCP = "gcp"; + @SerializedName(SERIALIZED_NAME_GCP) + @javax.annotation.Nullable + private GCPServiceAccountKey gcp; + + public Token() { + } + + public Token azure(@javax.annotation.Nullable AzureToken azure) { + this.azure = azure; + return this; + } + + /** + * Get azure + * @return azure + */ + @javax.annotation.Nullable + public AzureToken getAzure() { + return azure; + } + + public void setAzure(@javax.annotation.Nullable AzureToken azure) { + this.azure = azure; + } + + + public Token gcp(@javax.annotation.Nullable GCPServiceAccountKey gcp) { + this.gcp = gcp; + return this; + } + + /** + * Get gcp + * @return gcp + */ + @javax.annotation.Nullable + public GCPServiceAccountKey getGcp() { + return gcp; + } + + public void setGcp(@javax.annotation.Nullable GCPServiceAccountKey gcp) { + this.gcp = gcp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Token token = (Token) o; + return Objects.equals(this.azure, token.azure) && + Objects.equals(this.gcp, token.gcp); + } + + @Override + public int hashCode() { + return Objects.hash(azure, gcp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Token {\n"); + sb.append(" azure: ").append(toIndentedString(azure)).append("\n"); + sb.append(" gcp: ").append(toIndentedString(gcp)).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(Arrays.asList("azure", "gcp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Token + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Token.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Token is not found in the empty JSON string", Token.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Token.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Token` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `azure` + if (jsonObj.get("azure") != null && !jsonObj.get("azure").isJsonNull()) { + AzureToken.validateJsonElement(jsonObj.get("azure")); + } + // validate the optional field `gcp` + if (jsonObj.get("gcp") != null && !jsonObj.get("gcp").isJsonNull()) { + GCPServiceAccountKey.validateJsonElement(jsonObj.get("gcp")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Token.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Token' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Token.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Token value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Token read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Token given an JSON string + * + * @param jsonString JSON string + * @return An instance of Token + * @throws IOException if the JSON string is invalid with respect to Token + */ + public static Token fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Token.class); + } + + /** + * Convert an instance of Token to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateRequest.java new file mode 100644 index 0000000..d5b7165 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateRequest.java @@ -0,0 +1,297 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.TokenScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for creating a token + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TokenCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private TokenScope scope; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nullable + private String workspaceId; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nullable + private OffsetDateTime expiresAt; + + public TokenCreateRequest() { + } + + public TokenCreateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * A human-readable name for the token. The name must be provided if the token is an API token (i.e. if `workspace_id` is provided). + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TokenCreateRequest scope(@javax.annotation.Nonnull TokenScope scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nonnull + public TokenScope getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull TokenScope scope) { + this.scope = scope; + } + + + public TokenCreateRequest workspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace ID or Name that the token will be scoped for. This must be provided if the token is meant to be an API token (instead of a session token). + * @return workspaceId + */ + @javax.annotation.Nullable + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nullable String workspaceId) { + this.workspaceId = workspaceId; + } + + + public TokenCreateRequest expiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The expiration date and time of the token. If no expiration date is provided, the server will set the default expiration date. + * @return expiresAt + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TokenCreateRequest tokenCreateRequest = (TokenCreateRequest) o; + return Objects.equals(this.name, tokenCreateRequest.name) && + Objects.equals(this.scope, tokenCreateRequest.scope) && + Objects.equals(this.workspaceId, tokenCreateRequest.workspaceId) && + Objects.equals(this.expiresAt, tokenCreateRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(name, scope, workspaceId, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TokenCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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(Arrays.asList("name", "scope", "workspace_id", "expires_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("scope")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TokenCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TokenCreateRequest is not found in the empty JSON string", TokenCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TokenCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TokenCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TokenCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + // validate the required field `scope` + TokenScope.validateJsonElement(jsonObj.get("scope")); + if ((jsonObj.get("workspace_id") != null && !jsonObj.get("workspace_id").isJsonNull()) && !jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TokenCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TokenCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TokenCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TokenCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TokenCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TokenCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenCreateRequest + * @throws IOException if the JSON string is invalid with respect to TokenCreateRequest + */ + public static TokenCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TokenCreateRequest.class); + } + + /** + * Convert an instance of TokenCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateResponse.java new file mode 100644 index 0000000..26c2233 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.APIToken; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when creating a token + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TokenCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private APIToken data; + + public TokenCreateResponse() { + } + + public TokenCreateResponse data(@javax.annotation.Nonnull APIToken data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public APIToken getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull APIToken data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TokenCreateResponse tokenCreateResponse = (TokenCreateResponse) o; + return Objects.equals(this.data, tokenCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TokenCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TokenCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TokenCreateResponse is not found in the empty JSON string", TokenCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TokenCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TokenCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TokenCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + APIToken.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TokenCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TokenCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TokenCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TokenCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TokenCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TokenCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenCreateResponse + * @throws IOException if the JSON string is invalid with respect to TokenCreateResponse + */ + public static TokenCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TokenCreateResponse.class); + } + + /** + * Convert an instance of TokenCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenListResponse.java new file mode 100644 index 0000000..3982626 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenListResponse.java @@ -0,0 +1,261 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.APIToken; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting all tokens + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class TokenListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nullable + private PaginationMetadata paginationMetadata; + + public TokenListResponse() { + } + + public TokenListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public TokenListResponse addDataItem(APIToken dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of tokens + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public TokenListResponse paginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nullable + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TokenListResponse tokenListResponse = (TokenListResponse) o; + return Objects.equals(this.data, tokenListResponse.data) && + Objects.equals(this.paginationMetadata, tokenListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TokenListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TokenListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TokenListResponse is not found in the empty JSON string", TokenListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TokenListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TokenListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TokenListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + APIToken.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `pagination_metadata` + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TokenListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TokenListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TokenListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TokenListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TokenListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TokenListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenListResponse + * @throws IOException if the JSON string is invalid with respect to TokenListResponse + */ + public static TokenListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TokenListResponse.class); + } + + /** + * Convert an instance of TokenListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenScope.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenScope.java new file mode 100644 index 0000000..d415aea --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/TokenScope.java @@ -0,0 +1,104 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The scopes a token can have + */ +@JsonAdapter(TokenScope.Adapter.class) +public enum TokenScope { + + STAR("*"), + + PASSWORD_RESET("password_reset"), + + CONFIRM_EMAIL("confirm_email"), + + USER_READ("user:read"), + + USER_READ_WRITE("user:read-write"), + + USER_ADMIN("user:admin"), + + ARRAY_READ("array:read"), + + ARRAY_READ_WRITE("array:read-write"), + + ARRAY_ADMIN("array:admin"), + + ORGANIZATION_READ("organization:read"), + + ORGANIZATION_READ_WRITE("organization:read-write"), + + ORGANIZATION_ADMIN("organization:admin"), + + GROUP_READ("group:read"), + + GROUP_READ_WRITE("group:read-write"), + + GROUP_ADMIN("group:admin"); + + private String value; + + TokenScope(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenScope fromValue(String value) { + for (TokenScope b : TokenScope.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 TokenScope enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenScope read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenScope.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenScope.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/User.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/User.java new file mode 100644 index 0000000..eaaefca --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/User.java @@ -0,0 +1,491 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.UserRole; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for a registered user + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class User { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_IS_VALID_EMAIL = "is_valid_email"; + @SerializedName(SERIALIZED_NAME_IS_VALID_EMAIL) + @javax.annotation.Nullable + private Boolean isValidEmail; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private UserRole role; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + @SerializedName(SERIALIZED_NAME_TIMEZONE) + @javax.annotation.Nonnull + private String timezone; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_DELETED_AT = "deleted_at"; + @SerializedName(SERIALIZED_NAME_DELETED_AT) + @javax.annotation.Nullable + private OffsetDateTime deletedAt; + + public User() { + } + + public User id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The user's ID + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public User displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * display name of the user + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public User imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public User email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * user email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public User isValidEmail(@javax.annotation.Nullable Boolean isValidEmail) { + this.isValidEmail = isValidEmail; + return this; + } + + /** + * if a user has validated their email + * @return isValidEmail + */ + @javax.annotation.Nullable + public Boolean getIsValidEmail() { + return isValidEmail; + } + + public void setIsValidEmail(@javax.annotation.Nullable Boolean isValidEmail) { + this.isValidEmail = isValidEmail; + } + + + public User role(@javax.annotation.Nonnull UserRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public UserRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull UserRole role) { + this.role = role; + } + + + public User username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * user email + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public User timezone(@javax.annotation.Nonnull String timezone) { + this.timezone = timezone; + return this; + } + + /** + * user timezone + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(@javax.annotation.Nonnull String timezone) { + this.timezone = timezone; + } + + + public User createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime the user was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public User updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime the user was updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public User deletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Datetime the user was deleted in UTC + * @return deletedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.displayName, user.displayName) && + Objects.equals(this.imageId, user.imageId) && + Objects.equals(this.email, user.email) && + Objects.equals(this.isValidEmail, user.isValidEmail) && + Objects.equals(this.role, user.role) && + Objects.equals(this.username, user.username) && + Objects.equals(this.timezone, user.timezone) && + Objects.equals(this.createdAt, user.createdAt) && + Objects.equals(this.updatedAt, user.updatedAt) && + Objects.equals(this.deletedAt, user.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, displayName, imageId, email, isValidEmail, role, username, timezone, createdAt, updatedAt, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" isValidEmail: ").append(toIndentedString(isValidEmail)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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(Arrays.asList("id", "display_name", "image_id", "email", "is_valid_email", "role", "username", "timezone", "created_at", "updated_at", "deleted_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "display_name", "email", "role", "username", "timezone", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : User.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the required field `role` + UserRole.validateJsonElement(jsonObj.get("role")); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserAnswer.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserAnswer.java new file mode 100644 index 0000000..abeaffc --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserAnswer.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The academy questionnaire user's answer + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserAnswer { + public static final String SERIALIZED_NAME_QUESTION_ID = "question_id"; + @SerializedName(SERIALIZED_NAME_QUESTION_ID) + @javax.annotation.Nonnull + private String questionId; + + public static final String SERIALIZED_NAME_ANSWER_ID = "answer_id"; + @SerializedName(SERIALIZED_NAME_ANSWER_ID) + @javax.annotation.Nonnull + private String answerId; + + public UserAnswer() { + } + + public UserAnswer questionId(@javax.annotation.Nonnull String questionId) { + this.questionId = questionId; + return this; + } + + /** + * ID of the question in the questionnaire + * @return questionId + */ + @javax.annotation.Nonnull + public String getQuestionId() { + return questionId; + } + + public void setQuestionId(@javax.annotation.Nonnull String questionId) { + this.questionId = questionId; + } + + + public UserAnswer answerId(@javax.annotation.Nonnull String answerId) { + this.answerId = answerId; + return this; + } + + /** + * ID of the answer in the questionnaire + * @return answerId + */ + @javax.annotation.Nonnull + public String getAnswerId() { + return answerId; + } + + public void setAnswerId(@javax.annotation.Nonnull String answerId) { + this.answerId = answerId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserAnswer userAnswer = (UserAnswer) o; + return Objects.equals(this.questionId, userAnswer.questionId) && + Objects.equals(this.answerId, userAnswer.answerId); + } + + @Override + public int hashCode() { + return Objects.hash(questionId, answerId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserAnswer {\n"); + sb.append(" questionId: ").append(toIndentedString(questionId)).append("\n"); + sb.append(" answerId: ").append(toIndentedString(answerId)).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(Arrays.asList("question_id", "answer_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("question_id", "answer_id")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserAnswer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserAnswer.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserAnswer is not found in the empty JSON string", UserAnswer.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserAnswer.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAnswer` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserAnswer.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("question_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `question_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("question_id").toString())); + } + if (!jsonObj.get("answer_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `answer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("answer_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserAnswer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserAnswer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserAnswer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserAnswer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserAnswer read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserAnswer given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserAnswer + * @throws IOException if the JSON string is invalid with respect to UserAnswer + */ + public static UserAnswer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserAnswer.class); + } + + /** + * Convert an instance of UserAnswer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateRequest.java new file mode 100644 index 0000000..f676c49 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateRequest.java @@ -0,0 +1,357 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for a user that will be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserCreateRequest { + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nullable + private String displayName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + @SerializedName(SERIALIZED_NAME_TIMEZONE) + @javax.annotation.Nullable + private String timezone; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + @javax.annotation.Nullable + private String image; + + public UserCreateRequest() { + } + + public UserCreateRequest displayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + return this; + } + + /** + * display name of the user shown everywhere + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + } + + + public UserCreateRequest email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * user email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public UserCreateRequest username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * username that can be logged in with + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public UserCreateRequest password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * password for the user + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public UserCreateRequest timezone(@javax.annotation.Nullable String timezone) { + this.timezone = timezone; + return this; + } + + /** + * user timezone + * @return timezone + */ + @javax.annotation.Nullable + public String getTimezone() { + return timezone; + } + + public void setTimezone(@javax.annotation.Nullable String timezone) { + this.timezone = timezone; + } + + + public UserCreateRequest image(@javax.annotation.Nullable String image) { + this.image = image; + return this; + } + + /** + * Image data in the form data:image/png;base64,iVBORw0KGgoAAAA + * @return image + */ + @javax.annotation.Nullable + public String getImage() { + return image; + } + + public void setImage(@javax.annotation.Nullable String image) { + this.image = image; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreateRequest userCreateRequest = (UserCreateRequest) o; + return Objects.equals(this.displayName, userCreateRequest.displayName) && + Objects.equals(this.email, userCreateRequest.email) && + Objects.equals(this.username, userCreateRequest.username) && + Objects.equals(this.password, userCreateRequest.password) && + Objects.equals(this.timezone, userCreateRequest.timezone) && + Objects.equals(this.image, userCreateRequest.image); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, username, password, timezone, image); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreateRequest {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).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(Arrays.asList("display_name", "email", "username", "password", "timezone", "image")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("email", "username", "password")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateRequest is not found in the empty JSON string", UserCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("display_name") != null && !jsonObj.get("display_name").isJsonNull()) && !jsonObj.get("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); + } + if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateRequest + * @throws IOException if the JSON string is invalid with respect to UserCreateRequest + */ + public static UserCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreateRequest.class); + } + + /** + * Convert an instance of UserCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateResponse.java new file mode 100644 index 0000000..b3363c0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.User; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for create user response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private User data; + + public UserCreateResponse() { + } + + public UserCreateResponse data(@javax.annotation.Nonnull User data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public User getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull User data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreateResponse userCreateResponse = (UserCreateResponse) o; + return Objects.equals(this.data, userCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateResponse is not found in the empty JSON string", UserCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + User.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateResponse + * @throws IOException if the JSON string is invalid with respect to UserCreateResponse + */ + public static UserCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreateResponse.class); + } + + /** + * Convert an instance of UserCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserGetResponse.java new file mode 100644 index 0000000..9ea67d9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.User; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get user response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private User data; + + public UserGetResponse() { + } + + public UserGetResponse data(@javax.annotation.Nonnull User data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public User getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull User data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserGetResponse userGetResponse = (UserGetResponse) o; + return Objects.equals(this.data, userGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserGetResponse is not found in the empty JSON string", UserGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + User.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserGetResponse + * @throws IOException if the JSON string is invalid with respect to UserGetResponse + */ + public static UserGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserGetResponse.class); + } + + /** + * Convert an instance of UserGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserRole.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserRole.java new file mode 100644 index 0000000..9686f4c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserRole.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumeration of possible roles a user can have within a deployment + */ +@JsonAdapter(UserRole.Adapter.class) +public enum UserRole { + + OWNER("owner"), + + ADMIN("admin"), + + MEMBER("member"); + + private String value; + + UserRole(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserRole fromValue(String value) { + for (UserRole b : UserRole.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 UserRole enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserRole read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserRole.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserRole.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponse.java new file mode 100644 index 0000000..f90c30d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.UserSelfResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get self user response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserSelfResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UserSelfResponseData data; + + public UserSelfResponse() { + } + + public UserSelfResponse data(@javax.annotation.Nonnull UserSelfResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UserSelfResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UserSelfResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSelfResponse userSelfResponse = (UserSelfResponse) o; + return Objects.equals(this.data, userSelfResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSelfResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserSelfResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserSelfResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserSelfResponse is not found in the empty JSON string", UserSelfResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserSelfResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserSelfResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserSelfResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UserSelfResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserSelfResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserSelfResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserSelfResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserSelfResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserSelfResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserSelfResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserSelfResponse + * @throws IOException if the JSON string is invalid with respect to UserSelfResponse + */ + public static UserSelfResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserSelfResponse.class); + } + + /** + * Convert an instance of UserSelfResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponseData.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponseData.java new file mode 100644 index 0000000..dd727e9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfResponseData.java @@ -0,0 +1,259 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.User; +import io.tiledb.cloud.rest_api.v4.model.UserSelfWorkspace; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * UserSelfResponseData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserSelfResponseData { + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + @javax.annotation.Nonnull + private User user; + + public static final String SERIALIZED_NAME_WORKSPACES = "workspaces"; + @SerializedName(SERIALIZED_NAME_WORKSPACES) + @javax.annotation.Nonnull + private List workspaces = new ArrayList<>(); + + public UserSelfResponseData() { + } + + public UserSelfResponseData user(@javax.annotation.Nonnull User user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + */ + @javax.annotation.Nonnull + public User getUser() { + return user; + } + + public void setUser(@javax.annotation.Nonnull User user) { + this.user = user; + } + + + public UserSelfResponseData workspaces(@javax.annotation.Nonnull List workspaces) { + this.workspaces = workspaces; + return this; + } + + public UserSelfResponseData addWorkspacesItem(UserSelfWorkspace workspacesItem) { + if (this.workspaces == null) { + this.workspaces = new ArrayList<>(); + } + this.workspaces.add(workspacesItem); + return this; + } + + /** + * Get workspaces + * @return workspaces + */ + @javax.annotation.Nonnull + public List getWorkspaces() { + return workspaces; + } + + public void setWorkspaces(@javax.annotation.Nonnull List workspaces) { + this.workspaces = workspaces; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSelfResponseData userSelfResponseData = (UserSelfResponseData) o; + return Objects.equals(this.user, userSelfResponseData.user) && + Objects.equals(this.workspaces, userSelfResponseData.workspaces); + } + + @Override + public int hashCode() { + return Objects.hash(user, workspaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSelfResponseData {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" workspaces: ").append(toIndentedString(workspaces)).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(Arrays.asList("user", "workspaces")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user", "workspaces")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserSelfResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserSelfResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserSelfResponseData is not found in the empty JSON string", UserSelfResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserSelfResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserSelfResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserSelfResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `user` + User.validateJsonElement(jsonObj.get("user")); + // ensure the json data is an array + if (!jsonObj.get("workspaces").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `workspaces` to be an array in the JSON string but got `%s`", jsonObj.get("workspaces").toString())); + } + + JsonArray jsonArrayworkspaces = jsonObj.getAsJsonArray("workspaces"); + // validate the required field `workspaces` (array) + for (int i = 0; i < jsonArrayworkspaces.size(); i++) { + UserSelfWorkspace.validateJsonElement(jsonArrayworkspaces.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserSelfResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserSelfResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserSelfResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserSelfResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserSelfResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserSelfResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserSelfResponseData + * @throws IOException if the JSON string is invalid with respect to UserSelfResponseData + */ + public static UserSelfResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserSelfResponseData.class); + } + + /** + * Convert an instance of UserSelfResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfWorkspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfWorkspace.java new file mode 100644 index 0000000..7367426 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserSelfWorkspace.java @@ -0,0 +1,409 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * list of workspaces a user is a part of + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserSelfWorkspace { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private WorkspaceUser createdBy; + + public static final String SERIALIZED_NAME_SELF = "self"; + @SerializedName(SERIALIZED_NAME_SELF) + @javax.annotation.Nonnull + private WorkspaceUser self; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public UserSelfWorkspace() { + } + + public UserSelfWorkspace workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public UserSelfWorkspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * workspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public UserSelfWorkspace createdBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public WorkspaceUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + } + + + public UserSelfWorkspace self(@javax.annotation.Nonnull WorkspaceUser self) { + this.self = self; + return this; + } + + /** + * Get self + * @return self + */ + @javax.annotation.Nonnull + public WorkspaceUser getSelf() { + return self; + } + + public void setSelf(@javax.annotation.Nonnull WorkspaceUser self) { + this.self = self; + } + + + public UserSelfWorkspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Workspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UserSelfWorkspace createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime workspace was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public UserSelfWorkspace updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime workspace was updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + public UserSelfWorkspace imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSelfWorkspace userSelfWorkspace = (UserSelfWorkspace) o; + return Objects.equals(this.workspaceId, userSelfWorkspace.workspaceId) && + Objects.equals(this.name, userSelfWorkspace.name) && + Objects.equals(this.createdBy, userSelfWorkspace.createdBy) && + Objects.equals(this.self, userSelfWorkspace.self) && + Objects.equals(this.description, userSelfWorkspace.description) && + Objects.equals(this.createdAt, userSelfWorkspace.createdAt) && + Objects.equals(this.updatedAt, userSelfWorkspace.updatedAt) && + Objects.equals(this.imageId, userSelfWorkspace.imageId); + } + + @Override + public int hashCode() { + return Objects.hash(workspaceId, name, createdBy, self, description, createdAt, updatedAt, imageId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSelfWorkspace {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).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(Arrays.asList("workspace_id", "name", "created_by", "self", "description", "created_at", "updated_at", "image_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("workspace_id", "name", "created_by", "self", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserSelfWorkspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserSelfWorkspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserSelfWorkspace is not found in the empty JSON string", UserSelfWorkspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserSelfWorkspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserSelfWorkspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserSelfWorkspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").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())); + } + // validate the required field `created_by` + WorkspaceUser.validateJsonElement(jsonObj.get("created_by")); + // validate the required field `self` + WorkspaceUser.validateJsonElement(jsonObj.get("self")); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserSelfWorkspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserSelfWorkspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserSelfWorkspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserSelfWorkspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserSelfWorkspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserSelfWorkspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserSelfWorkspace + * @throws IOException if the JSON string is invalid with respect to UserSelfWorkspace + */ + public static UserSelfWorkspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserSelfWorkspace.class); + } + + /** + * Convert an instance of UserSelfWorkspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserUpdateRequest.java new file mode 100644 index 0000000..3459b77 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserUpdateRequest.java @@ -0,0 +1,292 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for updates made to a user + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserUpdateRequest { + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nullable + private String displayName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + @SerializedName(SERIALIZED_NAME_TIMEZONE) + @javax.annotation.Nullable + private String timezone; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + @javax.annotation.Nullable + private String image; + + public UserUpdateRequest() { + } + + public UserUpdateRequest displayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + return this; + } + + /** + * display name of the user shown everywhere + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + } + + + public UserUpdateRequest email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * user email + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public UserUpdateRequest timezone(@javax.annotation.Nullable String timezone) { + this.timezone = timezone; + return this; + } + + /** + * user timezone + * @return timezone + */ + @javax.annotation.Nullable + public String getTimezone() { + return timezone; + } + + public void setTimezone(@javax.annotation.Nullable String timezone) { + this.timezone = timezone; + } + + + public UserUpdateRequest image(@javax.annotation.Nullable String image) { + this.image = image; + return this; + } + + /** + * Image data in the form data:image/png;base64,iVBORw0KGgoAAAA + * @return image + */ + @javax.annotation.Nullable + public String getImage() { + return image; + } + + public void setImage(@javax.annotation.Nullable String image) { + this.image = image; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUpdateRequest userUpdateRequest = (UserUpdateRequest) o; + return Objects.equals(this.displayName, userUpdateRequest.displayName) && + Objects.equals(this.email, userUpdateRequest.email) && + Objects.equals(this.timezone, userUpdateRequest.timezone) && + Objects.equals(this.image, userUpdateRequest.image); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, timezone, image); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUpdateRequest {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).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(Arrays.asList("display_name", "email", "timezone", "image")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserUpdateRequest is not found in the empty JSON string", UserUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("display_name") != null && !jsonObj.get("display_name").isJsonNull()) && !jsonObj.get("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); + } + if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUpdateRequest + * @throws IOException if the JSON string is invalid with respect to UserUpdateRequest + */ + public static UserUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUpdateRequest.class); + } + + /** + * Convert an instance of UserUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Userspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Userspace.java new file mode 100644 index 0000000..88c9796 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Userspace.java @@ -0,0 +1,352 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The userspace object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Userspace { + public static final String SERIALIZED_NAME_USERSPACE_ID = "userspace_id"; + @SerializedName(SERIALIZED_NAME_USERSPACE_ID) + @javax.annotation.Nonnull + private String userspaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public Userspace() { + } + + public Userspace userspaceId(@javax.annotation.Nonnull String userspaceId) { + this.userspaceId = userspaceId; + return this; + } + + /** + * The userspace's ID + * @return userspaceId + */ + @javax.annotation.Nonnull + public String getUserspaceId() { + return userspaceId; + } + + public void setUserspaceId(@javax.annotation.Nonnull String userspaceId) { + this.userspaceId = userspaceId; + } + + + public Userspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The userspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Userspace icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The userspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + public Userspace createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The datetime the userspace was created (in UTC) + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Userspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The userspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Userspace updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The datetime the userspace was updated (in UTC) + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Userspace userspace = (Userspace) o; + return Objects.equals(this.userspaceId, userspace.userspaceId) && + Objects.equals(this.name, userspace.name) && + Objects.equals(this.icon, userspace.icon) && + Objects.equals(this.createdAt, userspace.createdAt) && + Objects.equals(this.description, userspace.description) && + Objects.equals(this.updatedAt, userspace.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(userspaceId, name, icon, createdAt, description, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Userspace {\n"); + sb.append(" userspaceId: ").append(toIndentedString(userspaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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(Arrays.asList("userspace_id", "name", "icon", "created_at", "description", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("userspace_id", "name", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Userspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Userspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Userspace is not found in the empty JSON string", Userspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Userspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Userspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Userspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userspace_id").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())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Userspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Userspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Userspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Userspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Userspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Userspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of Userspace + * @throws IOException if the JSON string is invalid with respect to Userspace + */ + public static Userspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Userspace.class); + } + + /** + * Convert an instance of Userspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceGetResponse.java new file mode 100644 index 0000000..f7db793 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Userspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a userspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserspaceGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Userspace data; + + public UserspaceGetResponse() { + } + + public UserspaceGetResponse data(@javax.annotation.Nonnull Userspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Userspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Userspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserspaceGetResponse userspaceGetResponse = (UserspaceGetResponse) o; + return Objects.equals(this.data, userspaceGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserspaceGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserspaceGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserspaceGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserspaceGetResponse is not found in the empty JSON string", UserspaceGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserspaceGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserspaceGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserspaceGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Userspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserspaceGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserspaceGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserspaceGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserspaceGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserspaceGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserspaceGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserspaceGetResponse + * @throws IOException if the JSON string is invalid with respect to UserspaceGetResponse + */ + public static UserspaceGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserspaceGetResponse.class); + } + + /** + * Convert an instance of UserspaceGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceUpdateRequest.java new file mode 100644 index 0000000..9776909 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/UserspaceUpdateRequest.java @@ -0,0 +1,263 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a userspace + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class UserspaceUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public UserspaceUpdateRequest() { + } + + public UserspaceUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The userspace name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UserspaceUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The userspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UserspaceUpdateRequest icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * The userspace icon as a UTF8-encoded Unicode symbol, e.g. 🚀 + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserspaceUpdateRequest userspaceUpdateRequest = (UserspaceUpdateRequest) o; + return Objects.equals(this.name, userspaceUpdateRequest.name) && + Objects.equals(this.description, userspaceUpdateRequest.description) && + Objects.equals(this.icon, userspaceUpdateRequest.icon); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, icon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserspaceUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).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(Arrays.asList("name", "description", "icon")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserspaceUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserspaceUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserspaceUpdateRequest is not found in the empty JSON string", UserspaceUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserspaceUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserspaceUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserspaceUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserspaceUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserspaceUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserspaceUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserspaceUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserspaceUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserspaceUpdateRequest + * @throws IOException if the JSON string is invalid with respect to UserspaceUpdateRequest + */ + public static UserspaceUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserspaceUpdateRequest.class); + } + + /** + * Convert an instance of UserspaceUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationError.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationError.java new file mode 100644 index 0000000..74d3d44 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationError.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.ValidationErrorField; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing data about a handled error by REST server + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ValidationError { + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nonnull + private List fields = new ArrayList<>(); + + public ValidationError() { + } + + public ValidationError fields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + return this; + } + + public ValidationError addFieldsItem(ValidationErrorField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * The list of fields that failed validation + * @return fields + */ + @javax.annotation.Nonnull + public List getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nonnull List fields) { + this.fields = fields; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationError validationError = (ValidationError) o; + return Objects.equals(this.fields, validationError.fields); + } + + @Override + public int hashCode() { + return Objects.hash(fields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationError {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).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(Arrays.asList("fields")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("fields")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidationError + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidationError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationError is not found in the empty JSON string", ValidationError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidationError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationError` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidationError.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + // validate the required field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + ValidationErrorField.validateJsonElement(jsonArrayfields.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidationError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidationError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidationError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidationError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidationError read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidationError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidationError + * @throws IOException if the JSON string is invalid with respect to ValidationError + */ + public static ValidationError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidationError.class); + } + + /** + * Convert an instance of ValidationError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationErrorField.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationErrorField.java new file mode 100644 index 0000000..c65913e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/ValidationErrorField.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object containing data about a handled error by REST server + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class ValidationErrorField { + public static final String SERIALIZED_NAME_FIELD = "field"; + @SerializedName(SERIALIZED_NAME_FIELD) + @javax.annotation.Nonnull + private String field; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public ValidationErrorField() { + } + + public ValidationErrorField field(@javax.annotation.Nonnull String field) { + this.field = field; + return this; + } + + /** + * The name of the field that failed validation + * @return field + */ + @javax.annotation.Nonnull + public String getField() { + return field; + } + + public void setField(@javax.annotation.Nonnull String field) { + this.field = field; + } + + + public ValidationErrorField message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * A friendly message about the validation error + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationErrorField validationErrorField = (ValidationErrorField) o; + return Objects.equals(this.field, validationErrorField.field) && + Objects.equals(this.message, validationErrorField.message); + } + + @Override + public int hashCode() { + return Objects.hash(field, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationErrorField {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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(Arrays.asList("field", "message")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("field", "message")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidationErrorField + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidationErrorField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationErrorField is not found in the empty JSON string", ValidationErrorField.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidationErrorField.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationErrorField` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidationErrorField.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidationErrorField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidationErrorField' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidationErrorField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidationErrorField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidationErrorField read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidationErrorField given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidationErrorField + * @throws IOException if the JSON string is invalid with respect to ValidationErrorField + */ + public static ValidationErrorField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidationErrorField.class); + } + + /** + * Convert an instance of ValidationErrorField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Versions.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Versions.java new file mode 100644 index 0000000..9533725 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Versions.java @@ -0,0 +1,397 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Various version numbers for the server + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Versions { + public static final String SERIALIZED_NAME_GO_VERSION = "go_version"; + @SerializedName(SERIALIZED_NAME_GO_VERSION) + @javax.annotation.Nonnull + private String goVersion; + + public static final String SERIALIZED_NAME_TILEDB_VERSION = "tiledb_version"; + @SerializedName(SERIALIZED_NAME_TILEDB_VERSION) + @javax.annotation.Nonnull + private String tiledbVersion; + + public static final String SERIALIZED_NAME_UDF_IMAGES_VERSION = "udf_images_version"; + @SerializedName(SERIALIZED_NAME_UDF_IMAGES_VERSION) + @javax.annotation.Nonnull + private List udfImagesVersion = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VCS_NAME = "vcs_name"; + @SerializedName(SERIALIZED_NAME_VCS_NAME) + @javax.annotation.Nullable + private String vcsName; + + public static final String SERIALIZED_NAME_VCS_REVISION = "vcs_revision"; + @SerializedName(SERIALIZED_NAME_VCS_REVISION) + @javax.annotation.Nullable + private String vcsRevision; + + public static final String SERIALIZED_NAME_VCS_TIME = "vcs_time"; + @SerializedName(SERIALIZED_NAME_VCS_TIME) + @javax.annotation.Nullable + private OffsetDateTime vcsTime; + + public static final String SERIALIZED_NAME_BUILD_ID = "build_id"; + @SerializedName(SERIALIZED_NAME_BUILD_ID) + @javax.annotation.Nullable + private String buildId; + + public Versions() { + } + + public Versions goVersion(@javax.annotation.Nonnull String goVersion) { + this.goVersion = goVersion; + return this; + } + + /** + * The version of Go used to build the server + * @return goVersion + */ + @javax.annotation.Nonnull + public String getGoVersion() { + return goVersion; + } + + public void setGoVersion(@javax.annotation.Nonnull String goVersion) { + this.goVersion = goVersion; + } + + + public Versions tiledbVersion(@javax.annotation.Nonnull String tiledbVersion) { + this.tiledbVersion = tiledbVersion; + return this; + } + + /** + * The version of TileDB used by the server + * @return tiledbVersion + */ + @javax.annotation.Nonnull + public String getTiledbVersion() { + return tiledbVersion; + } + + public void setTiledbVersion(@javax.annotation.Nonnull String tiledbVersion) { + this.tiledbVersion = tiledbVersion; + } + + + public Versions udfImagesVersion(@javax.annotation.Nonnull List udfImagesVersion) { + this.udfImagesVersion = udfImagesVersion; + return this; + } + + public Versions addUdfImagesVersionItem(String udfImagesVersionItem) { + if (this.udfImagesVersion == null) { + this.udfImagesVersion = new ArrayList<>(); + } + this.udfImagesVersion.add(udfImagesVersionItem); + return this; + } + + /** + * The UDF images that the server supports + * @return udfImagesVersion + */ + @javax.annotation.Nonnull + public List getUdfImagesVersion() { + return udfImagesVersion; + } + + public void setUdfImagesVersion(@javax.annotation.Nonnull List udfImagesVersion) { + this.udfImagesVersion = udfImagesVersion; + } + + + public Versions vcsName(@javax.annotation.Nullable String vcsName) { + this.vcsName = vcsName; + return this; + } + + /** + * The name of the version control system (vcs) used to develop the server + * @return vcsName + */ + @javax.annotation.Nullable + public String getVcsName() { + return vcsName; + } + + public void setVcsName(@javax.annotation.Nullable String vcsName) { + this.vcsName = vcsName; + } + + + public Versions vcsRevision(@javax.annotation.Nullable String vcsRevision) { + this.vcsRevision = vcsRevision; + return this; + } + + /** + * The vcs revision of the server + * @return vcsRevision + */ + @javax.annotation.Nullable + public String getVcsRevision() { + return vcsRevision; + } + + public void setVcsRevision(@javax.annotation.Nullable String vcsRevision) { + this.vcsRevision = vcsRevision; + } + + + public Versions vcsTime(@javax.annotation.Nullable OffsetDateTime vcsTime) { + this.vcsTime = vcsTime; + return this; + } + + /** + * The modification time associated with the vcs revision + * @return vcsTime + */ + @javax.annotation.Nullable + public OffsetDateTime getVcsTime() { + return vcsTime; + } + + public void setVcsTime(@javax.annotation.Nullable OffsetDateTime vcsTime) { + this.vcsTime = vcsTime; + } + + + public Versions buildId(@javax.annotation.Nullable String buildId) { + this.buildId = buildId; + return this; + } + + /** + * The build ID of the server. If set, this will be either the branch name or the git tag. + * @return buildId + */ + @javax.annotation.Nullable + public String getBuildId() { + return buildId; + } + + public void setBuildId(@javax.annotation.Nullable String buildId) { + this.buildId = buildId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Versions versions = (Versions) o; + return Objects.equals(this.goVersion, versions.goVersion) && + Objects.equals(this.tiledbVersion, versions.tiledbVersion) && + Objects.equals(this.udfImagesVersion, versions.udfImagesVersion) && + Objects.equals(this.vcsName, versions.vcsName) && + Objects.equals(this.vcsRevision, versions.vcsRevision) && + Objects.equals(this.vcsTime, versions.vcsTime) && + Objects.equals(this.buildId, versions.buildId); + } + + @Override + public int hashCode() { + return Objects.hash(goVersion, tiledbVersion, udfImagesVersion, vcsName, vcsRevision, vcsTime, buildId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Versions {\n"); + sb.append(" goVersion: ").append(toIndentedString(goVersion)).append("\n"); + sb.append(" tiledbVersion: ").append(toIndentedString(tiledbVersion)).append("\n"); + sb.append(" udfImagesVersion: ").append(toIndentedString(udfImagesVersion)).append("\n"); + sb.append(" vcsName: ").append(toIndentedString(vcsName)).append("\n"); + sb.append(" vcsRevision: ").append(toIndentedString(vcsRevision)).append("\n"); + sb.append(" vcsTime: ").append(toIndentedString(vcsTime)).append("\n"); + sb.append(" buildId: ").append(toIndentedString(buildId)).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(Arrays.asList("go_version", "tiledb_version", "udf_images_version", "vcs_name", "vcs_revision", "vcs_time", "build_id")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("go_version", "tiledb_version", "udf_images_version")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Versions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Versions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Versions is not found in the empty JSON string", Versions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Versions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Versions` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Versions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("go_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `go_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("go_version").toString())); + } + if (!jsonObj.get("tiledb_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tiledb_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tiledb_version").toString())); + } + // ensure the required json array is present + if (jsonObj.get("udf_images_version") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("udf_images_version").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `udf_images_version` to be an array in the JSON string but got `%s`", jsonObj.get("udf_images_version").toString())); + } + if ((jsonObj.get("vcs_name") != null && !jsonObj.get("vcs_name").isJsonNull()) && !jsonObj.get("vcs_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vcs_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vcs_name").toString())); + } + if ((jsonObj.get("vcs_revision") != null && !jsonObj.get("vcs_revision").isJsonNull()) && !jsonObj.get("vcs_revision").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vcs_revision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vcs_revision").toString())); + } + if ((jsonObj.get("build_id") != null && !jsonObj.get("build_id").isJsonNull()) && !jsonObj.get("build_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `build_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("build_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Versions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Versions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Versions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Versions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Versions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Versions given an JSON string + * + * @param jsonString JSON string + * @return An instance of Versions + * @throws IOException if the JSON string is invalid with respect to Versions + */ + public static Versions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Versions.class); + } + + /** + * Convert an instance of Versions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/VersionsResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/VersionsResponse.java new file mode 100644 index 0000000..d270e35 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/VersionsResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Versions; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * Object for versions response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class VersionsResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Versions data; + + public VersionsResponse() { + } + + public VersionsResponse data(@javax.annotation.Nonnull Versions data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Versions getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Versions data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionsResponse versionsResponse = (VersionsResponse) o; + return Objects.equals(this.data, versionsResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionsResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to VersionsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VersionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VersionsResponse is not found in the empty JSON string", VersionsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!VersionsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VersionsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VersionsResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Versions.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VersionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VersionsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VersionsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VersionsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VersionsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VersionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionsResponse + * @throws IOException if the JSON string is invalid with respect to VersionsResponse + */ + public static VersionsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VersionsResponse.class); + } + + /** + * Convert an instance of VersionsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/Workspace.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Workspace.java new file mode 100644 index 0000000..c4388e2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/Workspace.java @@ -0,0 +1,409 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object of the GetWorkspace endpoint + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class Workspace { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspace_id"; + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + @javax.annotation.Nonnull + private String workspaceId; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_CREATED_BY = "created_by"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + @javax.annotation.Nonnull + private WorkspaceUser createdBy; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_SELF = "self"; + @SerializedName(SERIALIZED_NAME_SELF) + @javax.annotation.Nonnull + private WorkspaceUser self; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private OffsetDateTime updatedAt; + + public Workspace() { + } + + public Workspace workspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * The workspace's ID + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(@javax.annotation.Nonnull String workspaceId) { + this.workspaceId = workspaceId; + } + + + public Workspace imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public Workspace name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * workspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Workspace createdBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + */ + @javax.annotation.Nonnull + public WorkspaceUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(@javax.annotation.Nonnull WorkspaceUser createdBy) { + this.createdBy = createdBy; + } + + + public Workspace description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Workspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Workspace self(@javax.annotation.Nonnull WorkspaceUser self) { + this.self = self; + return this; + } + + /** + * Get self + * @return self + */ + @javax.annotation.Nonnull + public WorkspaceUser getSelf() { + return self; + } + + public void setSelf(@javax.annotation.Nonnull WorkspaceUser self) { + this.self = self; + } + + + public Workspace createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime workspace was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Workspace updatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Datetime workspace was updated in UTC + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Workspace workspace = (Workspace) o; + return Objects.equals(this.workspaceId, workspace.workspaceId) && + Objects.equals(this.imageId, workspace.imageId) && + Objects.equals(this.name, workspace.name) && + Objects.equals(this.createdBy, workspace.createdBy) && + Objects.equals(this.description, workspace.description) && + Objects.equals(this.self, workspace.self) && + Objects.equals(this.createdAt, workspace.createdAt) && + Objects.equals(this.updatedAt, workspace.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(workspaceId, imageId, name, createdBy, description, self, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Workspace {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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(Arrays.asList("workspace_id", "image_id", "name", "created_by", "description", "self", "created_at", "updated_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("workspace_id", "name", "created_by", "self", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Workspace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Workspace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Workspace is not found in the empty JSON string", Workspace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Workspace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Workspace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Workspace.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workspace_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workspace_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workspace_id").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").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())); + } + // validate the required field `created_by` + WorkspaceUser.validateJsonElement(jsonObj.get("created_by")); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the required field `self` + WorkspaceUser.validateJsonElement(jsonObj.get("self")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Workspace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Workspace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Workspace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Workspace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Workspace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Workspace given an JSON string + * + * @param jsonString JSON string + * @return An instance of Workspace + * @throws IOException if the JSON string is invalid with respect to Workspace + */ + public static Workspace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Workspace.class); + } + + /** + * Convert an instance of Workspace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateRequest.java new file mode 100644 index 0000000..9f99b0d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateRequest.java @@ -0,0 +1,328 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.CredentialCreateRequest; +import io.tiledb.cloud.rest_api.v4.model.StorageSettingsCreateRequest; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object metadata for a workspace that will be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceCreateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + @javax.annotation.Nullable + private String image; + + public static final String SERIALIZED_NAME_DEFAULT_CREDENTIAL = "default_credential"; + @SerializedName(SERIALIZED_NAME_DEFAULT_CREDENTIAL) + @javax.annotation.Nonnull + private CredentialCreateRequest defaultCredential; + + public static final String SERIALIZED_NAME_DEFAULT_STORAGE_SETTING = "default_storage_setting"; + @SerializedName(SERIALIZED_NAME_DEFAULT_STORAGE_SETTING) + @javax.annotation.Nonnull + private StorageSettingsCreateRequest defaultStorageSetting; + + public WorkspaceCreateRequest() { + } + + public WorkspaceCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * workspace name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public WorkspaceCreateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Workspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public WorkspaceCreateRequest image(@javax.annotation.Nullable String image) { + this.image = image; + return this; + } + + /** + * Image data in the form data:image/png;base64,iVBORw0KGgoAAAA + * @return image + */ + @javax.annotation.Nullable + public String getImage() { + return image; + } + + public void setImage(@javax.annotation.Nullable String image) { + this.image = image; + } + + + public WorkspaceCreateRequest defaultCredential(@javax.annotation.Nonnull CredentialCreateRequest defaultCredential) { + this.defaultCredential = defaultCredential; + return this; + } + + /** + * Get defaultCredential + * @return defaultCredential + */ + @javax.annotation.Nonnull + public CredentialCreateRequest getDefaultCredential() { + return defaultCredential; + } + + public void setDefaultCredential(@javax.annotation.Nonnull CredentialCreateRequest defaultCredential) { + this.defaultCredential = defaultCredential; + } + + + public WorkspaceCreateRequest defaultStorageSetting(@javax.annotation.Nonnull StorageSettingsCreateRequest defaultStorageSetting) { + this.defaultStorageSetting = defaultStorageSetting; + return this; + } + + /** + * Get defaultStorageSetting + * @return defaultStorageSetting + */ + @javax.annotation.Nonnull + public StorageSettingsCreateRequest getDefaultStorageSetting() { + return defaultStorageSetting; + } + + public void setDefaultStorageSetting(@javax.annotation.Nonnull StorageSettingsCreateRequest defaultStorageSetting) { + this.defaultStorageSetting = defaultStorageSetting; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceCreateRequest workspaceCreateRequest = (WorkspaceCreateRequest) o; + return Objects.equals(this.name, workspaceCreateRequest.name) && + Objects.equals(this.description, workspaceCreateRequest.description) && + Objects.equals(this.image, workspaceCreateRequest.image) && + Objects.equals(this.defaultCredential, workspaceCreateRequest.defaultCredential) && + Objects.equals(this.defaultStorageSetting, workspaceCreateRequest.defaultStorageSetting); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, image, defaultCredential, defaultStorageSetting); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" defaultCredential: ").append(toIndentedString(defaultCredential)).append("\n"); + sb.append(" defaultStorageSetting: ").append(toIndentedString(defaultStorageSetting)).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(Arrays.asList("name", "description", "image", "default_credential", "default_storage_setting")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "default_credential", "default_storage_setting")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceCreateRequest is not found in the empty JSON string", WorkspaceCreateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceCreateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceCreateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceCreateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); + } + // validate the required field `default_credential` + CredentialCreateRequest.validateJsonElement(jsonObj.get("default_credential")); + // validate the required field `default_storage_setting` + StorageSettingsCreateRequest.validateJsonElement(jsonObj.get("default_storage_setting")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceCreateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceCreateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceCreateRequest + * @throws IOException if the JSON string is invalid with respect to WorkspaceCreateRequest + */ + public static WorkspaceCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceCreateRequest.class); + } + + /** + * Convert an instance of WorkspaceCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateResponse.java new file mode 100644 index 0000000..c8550d1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceCreateResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Workspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for create workspace response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Workspace data; + + public WorkspaceCreateResponse() { + } + + public WorkspaceCreateResponse data(@javax.annotation.Nonnull Workspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Workspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Workspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceCreateResponse workspaceCreateResponse = (WorkspaceCreateResponse) o; + return Objects.equals(this.data, workspaceCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceCreateResponse is not found in the empty JSON string", WorkspaceCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Workspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceCreateResponse + * @throws IOException if the JSON string is invalid with respect to WorkspaceCreateResponse + */ + public static WorkspaceCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceCreateResponse.class); + } + + /** + * Convert an instance of WorkspaceCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceGetResponse.java new file mode 100644 index 0000000..fa238e9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.Workspace; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * object for get workspace response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Workspace data; + + public WorkspaceGetResponse() { + } + + public WorkspaceGetResponse data(@javax.annotation.Nonnull Workspace data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Workspace getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Workspace data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceGetResponse workspaceGetResponse = (WorkspaceGetResponse) o; + return Objects.equals(this.data, workspaceGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceGetResponse is not found in the empty JSON string", WorkspaceGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + Workspace.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceGetResponse + * @throws IOException if the JSON string is invalid with respect to WorkspaceGetResponse + */ + public static WorkspaceGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceGetResponse.class); + } + + /** + * Convert an instance of WorkspaceGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceRole.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceRole.java new file mode 100644 index 0000000..5308994 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceRole.java @@ -0,0 +1,80 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The enumeration of roles a user can have within a workspace + */ +@JsonAdapter(WorkspaceRole.Adapter.class) +public enum WorkspaceRole { + + OWNER("owner"), + + ADMIN("admin"), + + MEMBER("member"); + + private String value; + + WorkspaceRole(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WorkspaceRole fromValue(String value) { + for (WorkspaceRole b : WorkspaceRole.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 WorkspaceRole enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WorkspaceRole read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WorkspaceRole.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WorkspaceRole.fromValue(value); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUpdateRequest.java new file mode 100644 index 0000000..604fd7a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUpdateRequest.java @@ -0,0 +1,263 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The workspace update object of the UpdateWorkspace endpoint + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_IMAGE = "image"; + @SerializedName(SERIALIZED_NAME_IMAGE) + @javax.annotation.Nullable + private String image; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public WorkspaceUpdateRequest() { + } + + public WorkspaceUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * workspace name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public WorkspaceUpdateRequest image(@javax.annotation.Nullable String image) { + this.image = image; + return this; + } + + /** + * Image data in the form data:image/png;base64,iVBORw0KGgoAAAA + * @return image + */ + @javax.annotation.Nullable + public String getImage() { + return image; + } + + public void setImage(@javax.annotation.Nullable String image) { + this.image = image; + } + + + public WorkspaceUpdateRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Workspace description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUpdateRequest workspaceUpdateRequest = (WorkspaceUpdateRequest) o; + return Objects.equals(this.name, workspaceUpdateRequest.name) && + Objects.equals(this.image, workspaceUpdateRequest.image) && + Objects.equals(this.description, workspaceUpdateRequest.description); + } + + @Override + public int hashCode() { + return Objects.hash(name, image, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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(Arrays.asList("name", "image", "description")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUpdateRequest is not found in the empty JSON string", WorkspaceUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("image") != null && !jsonObj.get("image").isJsonNull()) && !jsonObj.get("image").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUpdateRequest + * @throws IOException if the JSON string is invalid with respect to WorkspaceUpdateRequest + */ + public static WorkspaceUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUpdateRequest.class); + } + + /** + * Convert an instance of WorkspaceUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUser.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUser.java new file mode 100644 index 0000000..36da44a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUser.java @@ -0,0 +1,439 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The workspace user object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUser { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_IMAGE_ID = "image_id"; + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable + private String imageId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole role; + + public static final String SERIALIZED_NAME_ADDED_BY = "added_by"; + @SerializedName(SERIALIZED_NAME_ADDED_BY) + @javax.annotation.Nonnull + private String addedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DELETED_AT = "deleted_at"; + @SerializedName(SERIALIZED_NAME_DELETED_AT) + @javax.annotation.Nullable + private OffsetDateTime deletedAt; + + public WorkspaceUser() { + } + + public WorkspaceUser userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public WorkspaceUser username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The user's username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public WorkspaceUser displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The user's display name + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public WorkspaceUser email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The user's email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public WorkspaceUser imageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + return this; + } + + /** + * The image's ID + * @return imageId + */ + @javax.annotation.Nullable + public String getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable String imageId) { + this.imageId = imageId; + } + + + public WorkspaceUser role(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public WorkspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + } + + + public WorkspaceUser addedBy(@javax.annotation.Nonnull String addedBy) { + this.addedBy = addedBy; + return this; + } + + /** + * The user's ID + * @return addedBy + */ + @javax.annotation.Nonnull + public String getAddedBy() { + return addedBy; + } + + public void setAddedBy(@javax.annotation.Nonnull String addedBy) { + this.addedBy = addedBy; + } + + + public WorkspaceUser createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Datetime workspace user was created in UTC + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public WorkspaceUser deletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Datetime workspace user was deleted in UTC + * @return deletedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(@javax.annotation.Nullable OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUser workspaceUser = (WorkspaceUser) o; + return Objects.equals(this.userId, workspaceUser.userId) && + Objects.equals(this.username, workspaceUser.username) && + Objects.equals(this.displayName, workspaceUser.displayName) && + Objects.equals(this.email, workspaceUser.email) && + Objects.equals(this.imageId, workspaceUser.imageId) && + Objects.equals(this.role, workspaceUser.role) && + Objects.equals(this.addedBy, workspaceUser.addedBy) && + Objects.equals(this.createdAt, workspaceUser.createdAt) && + Objects.equals(this.deletedAt, workspaceUser.deletedAt); + } + + @Override + public int hashCode() { + return Objects.hash(userId, username, displayName, email, imageId, role, addedBy, createdAt, deletedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUser {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" addedBy: ").append(toIndentedString(addedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).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(Arrays.asList("user_id", "username", "display_name", "email", "image_id", "role", "added_by", "created_at", "deleted_at")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "username", "display_name", "email", "role", "added_by", "created_at")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUser is not found in the empty JSON string", WorkspaceUser.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUser.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUser.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("display_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display_name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("image_id") != null && !jsonObj.get("image_id").isJsonNull()) && !jsonObj.get("image_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `image_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_id").toString())); + } + // validate the required field `role` + WorkspaceRole.validateJsonElement(jsonObj.get("role")); + if (!jsonObj.get("added_by").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `added_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("added_by").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUser + * @throws IOException if the JSON string is invalid with respect to WorkspaceUser + */ + public static WorkspaceUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUser.class); + } + + /** + * Convert an instance of WorkspaceUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserGetResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserGetResponse.java new file mode 100644 index 0000000..821ad2f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserGetResponse.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting a single workspace user + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUserGetResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private WorkspaceUser data; + + public WorkspaceUserGetResponse() { + } + + public WorkspaceUserGetResponse data(@javax.annotation.Nonnull WorkspaceUser data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public WorkspaceUser getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull WorkspaceUser data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUserGetResponse workspaceUserGetResponse = (WorkspaceUserGetResponse) o; + return Objects.equals(this.data, workspaceUserGetResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUserGetResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUserGetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUserGetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUserGetResponse is not found in the empty JSON string", WorkspaceUserGetResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUserGetResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUserGetResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUserGetResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + WorkspaceUser.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUserGetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUserGetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUserGetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUserGetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUserGetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUserGetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUserGetResponse + * @throws IOException if the JSON string is invalid with respect to WorkspaceUserGetResponse + */ + public static WorkspaceUserGetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUserGetResponse.class); + } + + /** + * Convert an instance of WorkspaceUserGetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserUpdateRequest.java new file mode 100644 index 0000000..2cbf3e5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUserUpdateRequest.java @@ -0,0 +1,212 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The request object for updating a single workspace users + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUserUpdateRequest { + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole role; + + public WorkspaceUserUpdateRequest() { + } + + public WorkspaceUserUpdateRequest role(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public WorkspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUserUpdateRequest workspaceUserUpdateRequest = (WorkspaceUserUpdateRequest) o; + return Objects.equals(this.role, workspaceUserUpdateRequest.role); + } + + @Override + public int hashCode() { + return Objects.hash(role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUserUpdateRequest {\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUserUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUserUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUserUpdateRequest is not found in the empty JSON string", WorkspaceUserUpdateRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUserUpdateRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUserUpdateRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUserUpdateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `role` + WorkspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUserUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUserUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUserUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUserUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUserUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUserUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUserUpdateRequest + * @throws IOException if the JSON string is invalid with respect to WorkspaceUserUpdateRequest + */ + public static WorkspaceUserUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUserUpdateRequest.class); + } + + /** + * Convert an instance of WorkspaceUserUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersBulkUpdateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersBulkUpdateRequestInner.java new file mode 100644 index 0000000..d905d47 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersBulkUpdateRequestInner.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The workspace user update object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUsersBulkUpdateRequestInner { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole role; + + public WorkspaceUsersBulkUpdateRequestInner() { + } + + public WorkspaceUsersBulkUpdateRequestInner userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public WorkspaceUsersBulkUpdateRequestInner role(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public WorkspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUsersBulkUpdateRequestInner workspaceUsersBulkUpdateRequestInner = (WorkspaceUsersBulkUpdateRequestInner) o; + return Objects.equals(this.userId, workspaceUsersBulkUpdateRequestInner.userId) && + Objects.equals(this.role, workspaceUsersBulkUpdateRequestInner.role); + } + + @Override + public int hashCode() { + return Objects.hash(userId, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUsersBulkUpdateRequestInner {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("user_id", "role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUsersBulkUpdateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUsersBulkUpdateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUsersBulkUpdateRequestInner is not found in the empty JSON string", WorkspaceUsersBulkUpdateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUsersBulkUpdateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUsersBulkUpdateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUsersBulkUpdateRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + // validate the required field `role` + WorkspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUsersBulkUpdateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUsersBulkUpdateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUsersBulkUpdateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUsersBulkUpdateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUsersBulkUpdateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUsersBulkUpdateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUsersBulkUpdateRequestInner + * @throws IOException if the JSON string is invalid with respect to WorkspaceUsersBulkUpdateRequestInner + */ + public static WorkspaceUsersBulkUpdateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUsersBulkUpdateRequestInner.class); + } + + /** + * Convert an instance of WorkspaceUsersBulkUpdateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateRequestInner.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateRequestInner.java new file mode 100644 index 0000000..8ded362 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateRequestInner.java @@ -0,0 +1,241 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceRole; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The workspace user that should be created + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUsersCreateRequestInner { + public static final String SERIALIZED_NAME_USER_ID = "user_id"; + @SerializedName(SERIALIZED_NAME_USER_ID) + @javax.annotation.Nonnull + private String userId; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nonnull + private WorkspaceRole role; + + public WorkspaceUsersCreateRequestInner() { + } + + public WorkspaceUsersCreateRequestInner userId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + return this; + } + + /** + * The user's ID + * @return userId + */ + @javax.annotation.Nonnull + public String getUserId() { + return userId; + } + + public void setUserId(@javax.annotation.Nonnull String userId) { + this.userId = userId; + } + + + public WorkspaceUsersCreateRequestInner role(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + public WorkspaceRole getRole() { + return role; + } + + public void setRole(@javax.annotation.Nonnull WorkspaceRole role) { + this.role = role; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUsersCreateRequestInner workspaceUsersCreateRequestInner = (WorkspaceUsersCreateRequestInner) o; + return Objects.equals(this.userId, workspaceUsersCreateRequestInner.userId) && + Objects.equals(this.role, workspaceUsersCreateRequestInner.role); + } + + @Override + public int hashCode() { + return Objects.hash(userId, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUsersCreateRequestInner {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).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(Arrays.asList("user_id", "role")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("user_id", "role")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUsersCreateRequestInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUsersCreateRequestInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUsersCreateRequestInner is not found in the empty JSON string", WorkspaceUsersCreateRequestInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUsersCreateRequestInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUsersCreateRequestInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUsersCreateRequestInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_id").toString())); + } + // validate the required field `role` + WorkspaceRole.validateJsonElement(jsonObj.get("role")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUsersCreateRequestInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUsersCreateRequestInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUsersCreateRequestInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUsersCreateRequestInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUsersCreateRequestInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUsersCreateRequestInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUsersCreateRequestInner + * @throws IOException if the JSON string is invalid with respect to WorkspaceUsersCreateRequestInner + */ + public static WorkspaceUsersCreateRequestInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUsersCreateRequestInner.class); + } + + /** + * Convert an instance of WorkspaceUsersCreateRequestInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateResponse.java new file mode 100644 index 0000000..d70a3d1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersCreateResponse.java @@ -0,0 +1,230 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when creating multiple workspace users + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUsersCreateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public WorkspaceUsersCreateResponse() { + } + + public WorkspaceUsersCreateResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public WorkspaceUsersCreateResponse addDataItem(WorkspaceUser dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of workspace users that were created + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUsersCreateResponse workspaceUsersCreateResponse = (WorkspaceUsersCreateResponse) o; + return Objects.equals(this.data, workspaceUsersCreateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUsersCreateResponse {\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(Arrays.asList("data")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUsersCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUsersCreateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUsersCreateResponse is not found in the empty JSON string", WorkspaceUsersCreateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUsersCreateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUsersCreateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUsersCreateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + WorkspaceUser.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUsersCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUsersCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUsersCreateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUsersCreateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUsersCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUsersCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUsersCreateResponse + * @throws IOException if the JSON string is invalid with respect to WorkspaceUsersCreateResponse + */ + public static WorkspaceUsersCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUsersCreateResponse.class); + } + + /** + * Convert an instance of WorkspaceUsersCreateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersListResponse.java new file mode 100644 index 0000000..1fea651 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v4/model/WorkspaceUsersListResponse.java @@ -0,0 +1,261 @@ +/* + * Specification file for tiledb-server v4 API + * This spec is exposed to the public under /v4 route group + * + * The version of the OpenAPI document: 0.0.1 + * Contact: info@tiledb.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 io.tiledb.cloud.rest_api.v4.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.tiledb.cloud.rest_api.v4.model.PaginationMetadata; +import io.tiledb.cloud.rest_api.v4.model.WorkspaceUser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import io.tiledb.cloud.rest_api.v4.JSON; + +/** + * The response object when requesting multiple workspace users + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.15.0") +public class WorkspaceUsersListResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + @javax.annotation.Nullable + private PaginationMetadata paginationMetadata; + + public WorkspaceUsersListResponse() { + } + + public WorkspaceUsersListResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public WorkspaceUsersListResponse addDataItem(WorkspaceUser dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * An array of workspace users + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public WorkspaceUsersListResponse paginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + */ + @javax.annotation.Nullable + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + public void setPaginationMetadata(@javax.annotation.Nullable PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkspaceUsersListResponse workspaceUsersListResponse = (WorkspaceUsersListResponse) o; + return Objects.equals(this.data, workspaceUsersListResponse.data) && + Objects.equals(this.paginationMetadata, workspaceUsersListResponse.paginationMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, paginationMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkspaceUsersListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).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(Arrays.asList("data", "pagination_metadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkspaceUsersListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkspaceUsersListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkspaceUsersListResponse is not found in the empty JSON string", WorkspaceUsersListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WorkspaceUsersListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WorkspaceUsersListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WorkspaceUsersListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + WorkspaceUser.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `pagination_metadata` + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WorkspaceUsersListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkspaceUsersListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkspaceUsersListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WorkspaceUsersListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WorkspaceUsersListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkspaceUsersListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkspaceUsersListResponse + * @throws IOException if the JSON string is invalid with respect to WorkspaceUsersListResponse + */ + public static WorkspaceUsersListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkspaceUsersListResponse.class); + } + + /** + * Convert an instance of WorkspaceUsersListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +